hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Fox <randy....@connexity.com>
Subject Re: Off-heap block cache fails in 0.94.6
Date Thu, 01 May 2014 16:37:02 GMT
Sorry it took us so long.  I tried the patch and got the same results:

java.lang.IllegalStateException: Schema metrics requested before 
table/CF name initialization: {"tableName":"null","cfName":"null"}
         at 
org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured.getSchemaMetrics(SchemaConfigured.java:180)
         at 
org.apache.hadoop.hbase.io.hfile.LruBlockCache.updateSizeMetrics(LruBlockCache.java:337)
         at 
org.apache.hadoop.hbase.io.hfile.LruBlockCache.cacheBlock(LruBlockCache.java:292)
         at 
org.apache.hadoop.hbase.io.hfile.LruBlockCache.cacheBlock(LruBlockCache.java:320)
         at 
org.apache.hadoop.hbase.io.hfile.DoubleBlockCache.getBlock(DoubleBlockCache.java:102)
         at 
org.apache.hadoop.hbase.io.hfile.HFileReaderV2.readBlock(HFileReaderV2.java:303)
         at 
org.apache.hadoop.hbase.io.hfile.HFileBlockIndex$BlockIndexReader.loadDataBlockWithScanInfo(HFileBlockIndex.java:254)
         at 
org.apache.hadoop.hbase.io.hfile.HFileReaderV2$AbstractScannerV2.seekTo(HFileReaderV2.java:480)
         at 
org.apache.hadoop.hbase.io.hfile.HFileReaderV2$AbstractScannerV2.seekTo(HFileReaderV2.java:501)
         at 
org.apache.hadoop.hbase.regionserver.StoreFileScanner.seekAtOrAfter(StoreFileScanner.java:220)
         at 
org.apache.hadoop.hbase.regionserver.StoreFileScanner.seek(StoreFileScanner.java:140)
         at 
org.apache.hadoop.hbase.regionserver.StoreScanner.<init>(StoreScanner.java:131)
         at 
org.apache.hadoop.hbase.regionserver.Store.getScanner(Store.java:2135)
         at 
org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.<init>(HRegion.java:3738)
         at 
org.apache.hadoop.hbase.regionserver.HRegion.instantiateRegionScanner(HRegion.java:1762)
         at 
org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:1754)
         at 
org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:1731)
         at 
org.apache.hadoop.hbase.regionserver.HRegion.get(HRegion.java:4759)
         at 
org.apache.hadoop.hbase.regionserver.HRegion.get(HRegion.java:4733)
         at 
org.apache.hadoop.hbase.regionserver.HRegionServer.get(HRegionServer.java:2072)
         at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.call(WritableRpcEngine.java:320)
         at 
org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1428)

 >git diff .
diff --git 
a/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java 
b/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
index 6bf7437..fc4e8ed 100644
--- a/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
+++ b/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java
@@ -41,6 +41,7 @@ import 
org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
  import org.apache.hadoop.hbase.io.hfile.Compression.Algorithm;
  import org.apache.hadoop.hbase.regionserver.MemStore;
  import org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured;
+import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics;
  import org.apache.hadoop.hbase.util.Bytes;
  import org.apache.hadoop.hbase.util.ChecksumType;
  import org.apache.hadoop.hbase.util.ClassSize;
@@ -138,6 +139,9 @@ public class HFileBlock extends SchemaConfigured 
implements Cacheable {
     */
    static final int CHECKSUM_SIZE = Bytes.SIZEOF_INT;

+  private static SchemaConfigured UNKNOWN_TABLE_AND_CF = new 
SchemaConfigured(
+      SchemaMetrics.UNKNOWN, SchemaMetrics.UNKNOWN);
+
    private static final CacheableDeserializer<Cacheable> 
blockDeserializer =
        new CacheableDeserializer<Cacheable>() {
          public HFileBlock deserialize(ByteBuffer buf) throws IOException{
@@ -153,6 +157,7 @@ public class HFileBlock extends SchemaConfigured 
implements Cacheable {
            buf.limit(buf.limit() + HFileBlock.EXTRA_SERIALIZATION_SPACE);
            ourBuffer.offset = buf.getLong();
            ourBuffer.nextBlockOnDiskSizeWithHeader = buf.getInt();
+          UNKNOWN_TABLE_AND_CF.passSchemaMetricsTo(ourBuffer);
            return ourBuffer;
          }
        };
diff --git 
a/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java 
b/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java
index 7493951..0764ec8 100644
--- 
a/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java
+++ 
b/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/SchemaConfigured.java
@@ -163,6 +163,11 @@ public class SchemaConfigured implements HeapSize, 
SchemaAware {
      schemaMetrics = that.getSchemaMetrics();
    }

+  public SchemaConfigured(String tableName, String cfName) {
+    this.tableName = tableName != null ? tableName.intern() : tableName;
+    this.cfName = cfName != null ? cfName.intern() : cfName;
+  }
+
    @Override
    public String getTableName() {
      return tableName;
On 2/18/14 5:37 PM, Nick Dimiduk wrote:
> Hi Dean,
>
> Any chance you've tested Ram's patch? Does it work for you?
>
> Thanks,
> Nick
>
>
> On Mon, Jan 27, 2014 at 8:28 AM, Dean <hikeonpast@gmail.com> wrote:
>
>> Hi Ram,
>>
>> We'll give it a shot, thanks!
>>
>> -Dean
>>


Mime
View raw message