hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Daniel Cryans" <jdcry...@gmail.com>
Subject Re: Insert programm for hbase
Date Thu, 10 Jul 2008 15:42:43 GMT
Marcus,

It should work. Maybe you will hit a wall if your table is near empty or
just plain empty at the beginning of the process because the load will not
be distributed. If this happens, one of your region server will stale.

Feel free to come and have a chat on IRC if this happens!

J-D

On Thu, Jul 10, 2008 at 10:21 AM, Marcus Schl├╝ter <marcus.schlueter@mac.com>
wrote:

> Hi everyone,
>
> I'm trying to insert a large amount of rows from a mysql table into Hbase
> with the java api.
> Can i insert the rows with the following code?
>
> rs = stmt.executeQuery("SELECT *,UNIX_TIMESTAMP(time) as time1 FROM log" +
> date + " LIMIT "+count+",100000");
> System.out.print(".");
> while(rs.next())
> {
>  long lockId = table.startUpdate(new Text(rs.getString("id")));
>  table.put(lockId, new Text("logtype:"), rs.getBytes("logtype"));
>  table.commit(lockId);
> }
> rs.close();
>
> Or is this completly wrong?
>
> Marcus
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message