Something is off.
Update your hbase so you don't have to do the handmade querying.
Instead, you'll be able to do:
hbase> list
hbase> exists 'allusers_counters'
hbase> create 'allusers_counters', 'pageSize:', 'firstPageId:', etc.
Can also do:
hbase> scan '.META.'
Look for instances of regions that have 'allusers_counters' as prefix.
Lets try and figure whats broken.
By the way, in TRUNK, the client API now has overrides so you can pass
plain String rather than have to make Text instances. So in the below
you could have just done "admin.tableExists('allusers_counters')".
St.Ack
Look at output and see if any mention of
Krzysztof Szlapinski wrote:
Hi all,
I got this problem of tables that are present in the hbase but hbase
"is not fully aware" of their presence
Here is what I do in jrib shell:
-----> checking if table allusers_counters exists
irb(main):208:0> tablename = "allusers_counters"
=> "allusers_counters"
irb(main):209:0> tablename_text = Text.new(tablename)
=> #<Java::OrgApacheHadoopIo::Text:0x397577f9
@java_object=allusers_counters>
irb(main):210:0> admin.tableExists(tablename_text)
2008-06-19 12:05:57,117 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName .META.: location server
192.168.1.203:60020, location region name .META.,,1
2008-06-19 12:05:57,139 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_counters: location server
192.168.1.201:60020, location region name
allusers_counters,,1213865977997
2008-06-19 12:05:57,143 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_index: location server
192.168.1.201:60020, location region name allusers_index,,1213866000317
2008-06-19 12:05:57,144 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_indexlist: location server
192.168.1.201:60020, location region name
allusers_indexlist,,1213865967175
2008-06-19 12:05:57,146 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_pages: location server
192.168.1.201:60020, location region name allusers_pages,,1213865989247
2008-06-19 12:05:57,147 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName users: location server
192.168.1.201:60020, location region name users,,1213865912445
2008-06-19 12:05:57,148 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_counters: location
server 192.168.1.202:60020, location region name
userssearch_counters,,1213865934224
2008-06-19 12:05:57,151 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_index: location server
192.168.1.202:60020, location region name
userssearch_index,,1213865956115
2008-06-19 12:05:57,152 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_indexlist: location
server 192.168.1.201:60020, location region name
userssearch_indexlist,,1213865923078
2008-06-19 12:05:57,153 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_pages: location server
192.168.1.201:60020, location region name
userssearch_pages,,1213865945020
=> false
-----> tableExists(tablename_text) says FALSE ???
-----> trying to create this table
irb(main):212:0> tablename_text = Text.new(tablename)
=> #<Java::OrgApacheHadoopIo::Text:0x5d91dd1d
@java_object=allusers_counters>
irb(main):213:0> desc = HTableDescriptor.new(tablename)
=> #<Java::OrgApacheHadoopHbase::HTableDescriptor:0x3f6a5bcb
@java_object=NAME => 'allusers_counters', FAMILIES => []>
irb(main):214:0> desc.addFamily(HColumnDescriptor.new("pageSize:"))
=> nil
irb(main):215:0> desc.addFamily(HColumnDescriptor.new("firstPageId:"))
=> nil
irb(main):216:0> desc.addFamily(HColumnDescriptor.new("lastPageId:"))
=> nil
irb(main):217:0> desc.addFamily(HColumnDescriptor.new("childrenCount:"))
=> nil
irb(main):218:0>
desc.addFamily(HColumnDescriptor.new("stickyChildrenCount:"))
=> nil
irb(main):219:0> if admin.tableExists(tablename_text)
irb(main):220:1> admin.disableTable(tablename_text)
irb(main):221:1> admin.deleteTable(tablename_text)
irb(main):222:1> end
2008-06-19 12:08:06,999 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName .META.: location server
192.168.1.203:60020, location region name .META.,,1
2008-06-19 12:08:07,023 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_counters: location server
192.168.1.201:60020, location region name
allusers_counters,,1213865977997
2008-06-19 12:08:07,027 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_index: location server
192.168.1.201:60020, location region name allusers_index,,1213866000317
2008-06-19 12:08:07,028 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_indexlist: location server
192.168.1.201:60020, location region name
allusers_indexlist,,1213865967175
2008-06-19 12:08:07,029 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName allusers_pages: location server
192.168.1.201:60020, location region name allusers_pages,,1213865989247
2008-06-19 12:08:07,031 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName users: location server
192.168.1.201:60020, location region name users,,1213865912445
2008-06-19 12:08:07,032 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_counters: location
server 192.168.1.202:60020, location region name
userssearch_counters,,1213865934224
2008-06-19 12:08:07,034 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_index: location server
192.168.1.202:60020, location region name
userssearch_index,,1213865956115
2008-06-19 12:08:07,035 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_indexlist: location
server 192.168.1.201:60020, location region name
userssearch_indexlist,,1213865923078
2008-06-19 12:08:07,037 DEBUG [main]
client.HConnectionManager$TableServers(516): Cache hit in table
locations for row <> and tableName userssearch_pages: location server
192.168.1.201:60020, location region name
userssearch_pages,,1213865945020
=> nil
irb(main):223:0> admin.createTable(desc)
NativeException: org.apache.hadoop.hbase.TableExistsException:
org.apache.hadoop.hbase.TableExistsException: allusers_counters
at
org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:627)
at
org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:590)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.hadoop.hbase.ipc.HbaseRPC$Server.call(HbaseRPC.java:424)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:896)
from sun/reflect/NativeConstructorAccessorImpl.java:-2:in
`newInstance0'
from sun/reflect/NativeConstructorAccessorImpl.java:39:in
`newInstance'
from sun/reflect/DelegatingConstructorAccessorImpl.java:27:in
`newInstance'
from java/lang/reflect/Constructor.java:513:in `newInstance'
from org/apache/hadoop/hbase/RemoteExceptionHandler.java:82:in
`decodeRemoteException'
from org/apache/hadoop/hbase/client/HBaseAdmin.java:187:in
`createTableAsync'
from org/apache/hadoop/hbase/client/HBaseAdmin.java:145:in
`createTable'
from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
from java/lang/reflect/Method.java:597:in `invoke'
from org/jruby/javasupport/JavaMethod.java:250:in
`invokeWithExceptionHandling'
from org/jruby/javasupport/JavaMethod.java:219:in `invoke'
from org/jruby/javasupport/JavaClass.java:417:in `execute'
from
org/jruby/internal/runtime/methods/SimpleCallbackMethod.java:67:in `call'
from
org/jruby/internal/runtime/methods/DynamicMethod.java:78:in `call'
... 102 levels...
from org/jruby/evaluator/ASTInterpreter.java:632:in `blockNode'
from org/jruby/evaluator/ASTInterpreter.java:303:in `evalInternal'
from org/jruby/evaluator/ASTInterpreter.java:169:in `eval'
from
org/jruby/internal/runtime/methods/DefaultMethod.java:172:in
`interpretedCall'
from
org/jruby/internal/runtime/methods/DefaultMethod.java:148:in `call'
from
org/jruby/internal/runtime/methods/DefaultMethod.java:223:in `call'
from org/jruby/runtime/CallSite.java:116:in `cacheAndCall'
from org/jruby/runtime/CallSite.java:270:in `call'
from ruby/bin//bin/jirb:1:in `__file__'
from ruby/bin//bin/jirb:-1:in `load'
from org/jruby/Ruby.java:511:in `runScript'
from org/jruby/Ruby.java:431:in `runNormally'
from org/jruby/Ruby.java:311:in `runFromMain'
from org/jruby/Main.java:144:in `run'
from org/jruby/Main.java:89:in `run'
from org/jruby/Main.java:80:in `main'irb(main):224:0>
so if I check if the table exists by admin.tableExists the hbase says
false but when i try to create it throws the above exception
is this a known issue or my mistake?
greetz
krzysiek