Thanks for the quick response.
Attached are the hbase-master and the zookeeper logs after i issue "QUIT" to
the processes.
Things run fine till I do this one call. My other test runs fine and does not
hang. Only when I hit this one call, it hangs and like I mentioned have to kill
the processes and come back again.
@Test
public void usingIncrement() throws Exception
{
long siteId = 1234;
long publisherId = 5678;
Date eventTime = DATE_INPUT_FORMAT.parse("2009-06-15 13:08:54");
long[] metrics = new long[] { 10, 22, 32 };
byte[] rowKey = Bytes.toBytes(siteId + "_" +
ROW_KEY_FORMAT.format(eventTime));
byte[] family = Bytes.toBytes(FAMILY_PUBLISHER);
byte[] qualifier = Bytes.toBytes(publisherId);
HTable table = getTable();
for (int i1 = 0, n1 = metrics.length; n1 > 0; i1++, n1--) {
table.incrementColumnValue(rowKey, family, qualifier, metrics[i1]);
}
table.close();
queryMetrics(table, siteId, publisherId, eventTime);
}
/**
* test using the new {...@link Put} method.
*
* @throws Exception all exceptions are propagated back to the client
*/
@Test
public void usingPuts() throws Exception
{
long siteId = 1234;
long publisherId = 5678;
Date eventTime = DATE_INPUT_FORMAT.parse("2009-06-15 13:08:54");
long[] metrics = new long[] { 10, 22, 32, 45 };
byte[] rowKey = Bytes.toBytes(siteId + "_" +
ROW_KEY_FORMAT.format(eventTime));
byte[] family = Bytes.toBytes(FAMILY_PUBLISHER);
byte[] qualifier = Bytes.toBytes(publisherId);
HTable table = getTable();
table.setAutoFlush(false);
Put put = new Put(rowKey);
for (int i1 = 0, n1 = metrics.length; n1 > 0; i1++, n1--) {
long timestamp = System.nanoTime() + ((i1 + 1) * 200);
put.add(family, qualifier, timestamp, Bytes.toBytes(metrics[i1]));
}
table.put(put);
table.close();
queryMetrics(table, siteId, publisherId, eventTime);
}
----- Original Message -----
From: "stack" <[email protected]>
To: [email protected]
Sent: Monday, June 15, 2009 12:38:44 PM GMT -05:00 US/Canada Eastern
Subject: Re: new API method HTable.incrementColumnValue hangs
On Mon, Jun 15, 2009 at 5:55 AM, Irfan Mohammed <[email protected]> wrote:
> using the hbase from the trunk on ubuntu 9.04
>
> ir...@damascus:~$ hbase shell
> HBase Shell; enter 'help<RETURN>' for list of supported commands.
> Version: 0.20.0-dev, r784503, Sun Jun 14 15:36:01 EDT 2009
>
> Whenever I use the new API call [HTable.incrementColumnValue], the process
> hangs. If I kill the process and later try to access the table records
> anywhere including "hbase shell" etc., even that process hangs.
>
> 1. "stop-hbase.sh" hangs as well and I have to kill the hbase processes
Please make a thread dump -- "% kill -QUIT PID" -- and pastebin what you
see. I'd be interested in seeing why hbase won't go down.
>
> 2. restart the hbase using "start-hbase.sh"
> 3. hbase shell> count 't1' ---> throws an error that the table if offline
> 4. so had to enable 't1' and then work with the table.
>
....
Going by above, maybe something else is up in your hbase cluster?
Maybe, ensure all is well before you run your code by doing a few operations
with the shell on initial startup?
Your code doesn't have obvious errors on a quick glance.
Ensure your cluster is healthy before you run your own code, I'd suggest.
St.Ack