You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ji...@apache.org on 2009/01/20 23:33:08 UTC

svn commit: r736144 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/HLog.java

Author: jimk
Date: Tue Jan 20 14:33:08 2009
New Revision: 736144

URL: http://svn.apache.org/viewvc?rev=736144&view=rev
Log:
HBASE-1138  Test that readers opened after a sync can see all data up to the sync (temporary until HADOOP-4379 is resolved)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=736144&r1=736143&r2=736144&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Jan 20 14:33:08 2009
@@ -7,6 +7,8 @@
    HBASE-1129  Master won't go down; stuck joined on rootScanner
    HBASE-1136  HashFunction inadvertently destroys some randomness
                (Jonathan Ellis via Stack)
+   HBASE-1138  Test that readers opened after a sync can see all data up to the
+               sync (temporary until HADOOP-4379 is resolved)
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java?rev=736144&r1=736143&r2=736144&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/HLog.java Tue Jan 20 14:33:08 2009
@@ -51,7 +51,9 @@
 import org.apache.hadoop.io.SequenceFile;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.SequenceFile.CompressionType;
+import org.apache.hadoop.io.SequenceFile.Metadata;
 import org.apache.hadoop.io.SequenceFile.Reader;
+import org.apache.hadoop.io.compress.DefaultCodec;
 
 /**
  * HLog stores all the edits to the HStore.
@@ -98,6 +100,7 @@
   final LogRollListener listener;
   private final int maxlogentries;
   private final long optionalFlushInterval;
+  private final long blocksize;
   private final int flushlogentries;
   private volatile int unflushedEntries = 0;
   private volatile long lastLogFlushTime;
@@ -170,6 +173,8 @@
       conf.getInt("hbase.regionserver.maxlogentries", 100000);
     this.flushlogentries =
       conf.getInt("hbase.regionserver.flushlogentries", 100);
+    this.blocksize =
+      conf.getLong("hbase.regionserver.hlog.blocksize", 1024L * 1024L);
     this.optionalFlushInterval =
       conf.getLong("hbase.regionserver.optionallogflushinterval", 10 * 1000);
     this.threadWakeFrequency = conf.getLong(THREAD_WAKE_FREQUENCY, 10 * 1000);
@@ -182,7 +187,7 @@
     rollWriter();
   }
 
-  /*
+  /**
    * Accessor for tests. Not a part of the public API.
    * @return Current state of the monotonically increasing file id.
    */
@@ -260,8 +265,14 @@
         this.old_filenum = this.filenum;
         this.filenum = System.currentTimeMillis();
         Path newPath = computeFilename(this.filenum);
+
         this.writer = SequenceFile.createWriter(this.fs, this.conf, newPath,
-          HLogKey.class, HLogEdit.class, getCompressionType(this.conf));
+          HLogKey.class, HLogEdit.class,
+          fs.getConf().getInt("io.file.buffer.size", 4096),
+          fs.getDefaultReplication(), this.blocksize,
+          SequenceFile.CompressionType.NONE, new DefaultCodec(), null,
+          new Metadata());
+
         LOG.info((oldFile != null?
           "Closed " + oldFile + ", entries=" + this.numEntries + ". ": "") +
           "New log writer: " + FSUtils.getPath(newPath));