hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r711941 - /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java
Date Thu, 06 Nov 2008 18:53:46 GMT
Author: apurtell
Date: Thu Nov  6 10:53:40 2008
New Revision: 711941

URL: http://svn.apache.org/viewvc?rev=711941&view=rev
Log:
HBASE-981 hbase.io.index.interval doesn't seem to have an effect

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java?rev=711941&r1=711940&r2=711941&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HStore.java Thu Nov 
6 10:53:40 2008
@@ -648,7 +648,7 @@
         this.info,  family.getName(), -1L, null);
       MapFile.Writer out = flushedFile.getWriter(this.fs, this.compression,
         this.family.isBloomfilter(), cache.size());
-       out.setIndexInterval(family.getMapFileIndexInterval());
+      setIndexInterval(out);
       
       // Here we tried picking up an existing HStoreFile from disk and
       // interlacing the memcache flush compacting as we go.  The notion was
@@ -909,7 +909,7 @@
       }
       MapFile.Writer writer = compactedOutputFile.getWriter(this.fs,
         this.compression, this.family.isBloomfilter(), nrows);
-      writer.setIndexInterval(family.getMapFileIndexInterval());
+      setIndexInterval(writer);
       try {
         compact(writer, rdrs, doMajorCompaction);
       } finally {
@@ -932,6 +932,27 @@
   }  
 
   /*
+   * Set the index interval for the mapfile. There are two sources for
+   * configuration information: the HCD, and the global HBase config.
+   * If a source returns the default value, it is ignored. Otherwise,
+   * the smallest non-default value is preferred. 
+   */
+  private void setIndexInterval(MapFile.Writer writer) {
+    int familyInterval = this.family.getMapFileIndexInterval();
+    int interval = this.conf.getInt("hbase.io.index.interval",
+        HColumnDescriptor.DEFAULT_MAPFILE_INDEX_INTERVAL);
+    if (familyInterval != HColumnDescriptor.DEFAULT_MAPFILE_INDEX_INTERVAL) {
+      if (interval != HColumnDescriptor.DEFAULT_MAPFILE_INDEX_INTERVAL) {
+        if (familyInterval < interval)
+          interval = familyInterval;
+      } else {
+        interval = familyInterval;
+      }
+    }
+    writer.setIndexInterval(interval);
+  }
+
+  /*
    * @return True if we should run a major compaction.
    */
   private boolean isMajorCompaction() throws IOException {



Mime
View raw message