HBase bulk load exeception

2019-06-05 00:04发布

问题:

I'm able to generate HFiles using a Java program but whenever I try to import them into my HBase table I get the attached error. I get the same error when, instead of using my Java program, I use completebulkload.

It would be a great help if someone could help me out here. I'm stuck on this for some days now and it's starting to get really frustrating.

Kind regards, Pieterjan

Exception:

12/12/14 17:46:23 WARN mapreduce.LoadIncrementalHFiles: Skipping non-directory hdfs://localhost:9000/hadoopdir/user/data/output/hfiles/test/_SUCCESS
12/12/14 17:46:23 INFO hfile.CacheConfig: Allocating LruBlockCache with maximum size 241.7m
12/12/14 17:46:23 INFO util.ChecksumType: Checksum using org.apache.hadoop.util.PureJavaCrc32
12/12/14 17:46:23 INFO util.ChecksumType: org.apache.hadoop.util.PureJavaCrc32C not available. 
12/12/14 17:46:23 ERROR mapreduce.LoadIncrementalHFiles: Unexpected execution exception during splitting
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: The value of the hbase.metrics.showTableName conf option has not been specified in SchemaMetrics
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.groupOrSplitPhase(LoadIncrementalHFiles.java:333)
at org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.doBulkLoad(LoadIncrementalHFiles.java:232)
at POC.HBaseTest.TestHBaseRun.run(TestHBaseRun.java:67)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at Main.Main.main(Main.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.lang.IllegalStateException: The value of the hbase.metrics.showTableName conf option has not been specified in SchemaMetrics
at org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics.getEffectiveTableName(SchemaMetrics.java:607)
at org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics.getInstance(SchemaMetrics.java:333)
at org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured.getSchemaMetrics(SchemaConfigured.java:185)
at org.apache.hadoop.hbase.io.hfile.HFileReaderV2.close(HFileReaderV2.java:441)
at org.apache.hadoop.hbase.io.hfile.HFileReaderV2.close(HFileReaderV2.java:419)
at org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.groupOrSplit(LoadIncrementalHFiles.java:410)
at org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles$2.call(LoadIncrementalHFiles.java:323)
at org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles$2.call(LoadIncrementalHFiles.java:321)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Error: java.lang.IllegalStateException: The value of the hbase.metrics.showTableName conf option has not been specified in SchemaMetrics

回答1:

Finally found a solution.

I made sure the under $HBASE_HOME/conf-folder was on the classpath of my Java application and in my code I added SchemaMetrics.configureGlobally(conf) which sets the flag to use table names in metric names.

I hope this can help someone later on.

EDIT: I found out this latter thing was something I had to do using HBase 0.94.3.