hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Izaak Rubin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-828) HBaseAdmin.tableExists(new Text("TestTable5")) returns false when table actually exists.
Date Tue, 19 Aug 2008 16:55:44 GMT

    [ https://issues.apache.org/jira/browse/HBASE-828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623722#action_12623722

Izaak Rubin commented on HBASE-828:

I don't think there's much more testing I can do on this, based on some advice I got from
Jim Kellerman on the issue:

"you have no control on flushing stuff to disk other than shutting down HBase and restarting
it. There should be no need as the caches should do the right thing. If they don't, I need
to see an example."

I had a thought about your use of Text.  The internal bytes of a Text pad on a few extra '\0'
characters.  So, it's important to note that the bytes returned from {new Text("TestTable5").getBytes();}
are not the same as those returned from {"TestTable5".getBytes();}.  HBase doesn't do anything
fancy to make these two equivalent.  So, if you pass in {new Text("TestTable5").getBytes();}
to the constructor of your HTableDescriptor, using {tableExists(new Text("TestTable5"));}
should work fine, but if you use Strings you'll run into problems.

Ah, and here's another thing I just discovered: the bytes for new Text("tableA") and "tableA"
are the same.  So the amount of padding varies with the length of the String.  

Look into this and let me know if there's still something weird happening.

> HBaseAdmin.tableExists(new Text("TestTable5")) returns false when table actually exists.
> ----------------------------------------------------------------------------------------
>                 Key: HBASE-828
>                 URL: https://issues.apache.org/jira/browse/HBASE-828
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 0.2.0
>            Reporter: Ryan Smith
>            Priority: Minor
>             Fix For: 0.3.0
> Process:
> One the 1st MR job, i use tableExists( new Text("TestTable5")) & tableCreate to create
the table.
> On the 2nd MR job, I call tableExists(new Text("TestTable5")), which returns false, then
i call disableTable, deleteTable, and finally createTable.
> Workaround for now is to avoid using Text.   tableExists(byte[]) works when i tested

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message