Thanks for the reply.

I changed the log level to DEBUG and here is the output from the zookeeper log from after the 2nd run (which fails) (I have not modified the way I create the tables yet, will try that next).

The hbase log is kind of big so I didn't want to send that, but there were no visible ERRORs reported in it. Only in this zookeeper log did I see errors .

2009-10-19 09:31:11,694 INFO org.apache.zookeeper.server.NIOServerCnxn: Connected to / fe80:0:0:0:0:0:0:1%1:59703 lastZxid 0 2009-10-19 09:31:11,694 INFO org.apache.zookeeper.server.NIOServerCnxn: Creating new session 0x1246d672ea00004 2009-10-19 09:31:11,696 INFO org.apache.zookeeper.server.NIOServerCnxn: Finished init of 0x1246d672ea00004 valid:true 2009-10-19 09:31:12,133 WARN org.apache.zookeeper.server.PrepRequestProcessor: Got exception when processing sessionid:0x1246d672ea00004 type:create cxid:0x2 zxid: 0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org .apache .zookeeper .server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org .apache .zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java: 114) 2009-10-19 09:31:12,323 WARN org.apache.zookeeper.server.PrepRequestProcessor: Got exception when processing sessionid:0x1246d672ea00004 type:create cxid:0x5 zxid: 0xfffffffffffffffe txntype:unknown n/a org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists at org .apache .zookeeper .server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:245) at org .apache .zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java: 114) 2009-10-19 09:33:18,243 WARN org.apache.zookeeper.server.NIOServerCnxn: Exception causing close of session 0x1246d672ea00002 due to java.io.IOException: Read error 2009-10-19 09:33:18,245 INFO org.apache.zookeeper.server.NIOServerCnxn: closing session: 0x1246d672ea00002 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/127.0.0.1:2181 remote=/127.0.0.1:59663] 2009-10-19 09:33:47,468 WARN org.apache.zookeeper.server.NIOServerCnxn: Exception causing close of session 0x1246d672ea00004 due to java.io.IOException: Read error 2009-10-19 09:33:47,469 INFO org.apache.zookeeper.server.NIOServerCnxn: closing session: 0x1246d672ea00004 NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/ fe80:0:0:0:0:0:0:1%1:2181 remote=/fe80:0:0:0:0:0:0:1%1:59703] 2009-10-19 09:33:56,001 INFO org.apache.zookeeper.server.SessionTrackerImpl: Expiring session 0x1246d672ea00002 2009-10-19 09:33:56,001 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x1246d672ea00002 2009-10-19 09:33:56,001 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination request for id: 0x1246d672ea00002 2009-10-19 09:34:20,000 INFO org.apache.zookeeper.server.SessionTrackerImpl: Expiring session 0x1246d672ea00004 2009-10-19 09:34:20,000 INFO org.apache.zookeeper.server.ZooKeeperServer: Expiring session 0x1246d672ea00004 2009-10-19 09:34:20,000 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination request for id: 0x1246d672ea00004



On Oct 19, 2009, at 9:11 AM, Tatsuya Kawano wrote:

Hi,

Could you please set the logging level to DEBUG and check the hbase
master log and region server log if they have some error or warning
messages? By default, those logs should be under $HBASE_HOME/logs/ and
you can set DEBUG logging by un-commenting the following line in
$HBASE_HOME/conf/log4j.properties

log4j.logger.org.apache.hadoop.hbase=DEBUG


Also, when you create a table, you can skip disabling and enabling
steps by adding HColumnDescriptor ***before*** creating the table. So
why don't you try this?

================================
HTableDescriptor tableDesc = new HTableDescriptor(tableName);

String[] columns = this.getColumns(clazz);

for (String column : columns) {
   tableDesc.addFamily(tableName, new HColumnDescriptor(column));
}

admin.createTable(tableDesc);
================================

Thanks,

--
Tatsuya Kawano (Mr.)
Tokyo, Japan



On Mon, Oct 19, 2009 at 9:53 AM, yz5od2 <woods5242- [email protected]> wrote:
And another followup.

One of the table's has around 30 columns (MyTable1). If I do not create any
of the columns in this table on the 2nd run of the test, the table is
created, disabled, enabled, then dropped successfully.

Are there any restrictions in column names or anything related to inserting data into that table, then dropping it that I would need to be aware of?

On Oct 18, 2009, at 11:48 AM, yz5od2 wrote:

Hi,
I am running the latest version of Hbase in standalone mode.

I have a Junit test which connects to the local Hbase process, creates 2 tables, inserts some records, reads those records, then deletes the records. When the test is done, it disables both tables and then deletes the tables. All of these actions complete successfully. When I bring up the Hbase shell,
I verify that the tables do not exist. (code below)

-----------------
1st run
-----------------
Here is the console output when it creates the new tables before inserting
data

[18/10/09 11:35:57:057 MDT] INFO client.HBaseAdmin: Disabled MyTable1 [18/10/09 11:35:57:057 MDT] INFO client.HBaseAdmin: Disabled MyTable1
[18/10/09 11:35:58:058 MDT]  INFO client.HBaseAdmin: Enabled table
MyTable1
[18/10/09 11:35:58:058 MDT]  INFO client.HBaseAdmin: Enabled table
MyTable1
[18/10/09 11:36:10:010 MDT] INFO client.HBaseAdmin: Disabled MyTable2 [18/10/09 11:36:10:010 MDT] INFO client.HBaseAdmin: Disabled MyTable2
[18/10/09 11:36:10:010 MDT]  INFO client.HBaseAdmin: Enabled table
MyTable2
[18/10/09 11:36:10:010 MDT]  INFO client.HBaseAdmin: Enabled table
MyTable2

DATA IS PUT, GET and DELETEd here.....

[18/10/09 11:37:27:027 MDT] INFO client.HBaseAdmin: Disabled MyTable1 [18/10/09 11:37:27:027 MDT] INFO client.HBaseAdmin: Disabled MyTable1 [18/10/09 11:37:27:027 MDT] INFO client.HBaseAdmin: Deleted MyTable1 [18/10/09 11:37:27:027 MDT] INFO client.HBaseAdmin: Deleted MyTable1 [18/10/09 11:37:33:033 MDT] INFO client.HBaseAdmin: Disabled MyTable2 [18/10/09 11:37:33:033 MDT] INFO client.HBaseAdmin: Disabled MyTable2 [18/10/09 11:37:33:033 MDT] INFO client.HBaseAdmin: Deleted MyTable2 [18/10/09 11:37:33:033 MDT] INFO client.HBaseAdmin: Deleted MyTable2

After the process completes, I verify in Hbase shell that the tables in
fact do not exist.


-------------------
2nd run
-------------------

However when I run the same test the 2nd time, it fails on trying to
enable the first table it re-creates, with the following error.

[18/10/09 11:39:42:042 MDT] INFO zookeeper.ClientCnxn: Server connection
successful
[18/10/09 11:39:55:055 MDT] INFO client.HBaseAdmin: Disabled MyTable1 [18/10/09 11:39:55:055 MDT] INFO client.HBaseAdmin: Disabled MyTable1

At this point it seems to sit there, and fails with the following error. When I go to Hbase shell, I see that the MyTable1 does in fact exist. However it looks like my code fails on enabling it. What might be the
problem?


Caused by: java.io.IOException: Unable to enable table MyTable1
       at
org .apache.hadoop.hbase.client.HBaseAdmin.enableTable(HBaseAdmin.java: 356)
       at
org .apache.hadoop.hbase.client.HBaseAdmin.enableTable(HBaseAdmin.java: 315)


I really don't follow why this error is occurring. here is my code that
creates the tables and deletes them:


this.config = new HBaseConfiguration();
try {
       admin = new HBaseAdmin(config);
} catch(MasterNotRunningException e) {
throw new Exception("Could not setup HBaseAdmin as no master is
running...");
}

// FOR EACH of my tables (MyTable1 and MyTable2)
...

String tableName = clazz.getSimpleName();

if (!admin.tableExists(tableName)) {
       admin.createTable(new HTableDescriptor(tableName));
       admin.disableTable(tableName);

       String[] columns = this.getColumns(clazz);

       for (String column : columns) {
admin.addColumn(tableName, new HColumnDescriptor(column));
       }

}

if (!admin.isTableEnabled(tableName)) {
       admin.enableTable(tableName);
}

.....


// MY CODE TO DELETE THE TABLES (for each ... MyTable1 etc..)
if (admin.tableExists(tableName)) {
       admin.disableTable(tableName);
       admin.deleteTable(tableName);
}






Reply via email to