HBASE-1138 Test that readers opened after a sync can see all data up to the sync (temporary until HADOOP-4379 is resolved)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@736144 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Kellerman 2009-01-20 22:33:08 +00:00
parent a4971ab1a4
commit 1dd27a5c82
2 changed files with 15 additions and 2 deletions

View File

@ -7,6 +7,8 @@ Release 0.20.0 - Unreleased
HBASE-1129 Master won't go down; stuck joined on rootScanner HBASE-1129 Master won't go down; stuck joined on rootScanner
HBASE-1136 HashFunction inadvertently destroys some randomness HBASE-1136 HashFunction inadvertently destroys some randomness
(Jonathan Ellis via Stack) (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 IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -51,7 +51,9 @@ import org.apache.hadoop.hbase.util.FSUtils;
import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.SequenceFile.CompressionType; 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.SequenceFile.Reader;
import org.apache.hadoop.io.compress.DefaultCodec;
/** /**
* HLog stores all the edits to the HStore. * HLog stores all the edits to the HStore.
@ -98,6 +100,7 @@ public class HLog implements HConstants, Syncable {
final LogRollListener listener; final LogRollListener listener;
private final int maxlogentries; private final int maxlogentries;
private final long optionalFlushInterval; private final long optionalFlushInterval;
private final long blocksize;
private final int flushlogentries; private final int flushlogentries;
private volatile int unflushedEntries = 0; private volatile int unflushedEntries = 0;
private volatile long lastLogFlushTime; private volatile long lastLogFlushTime;
@ -170,6 +173,8 @@ public class HLog implements HConstants, Syncable {
conf.getInt("hbase.regionserver.maxlogentries", 100000); conf.getInt("hbase.regionserver.maxlogentries", 100000);
this.flushlogentries = this.flushlogentries =
conf.getInt("hbase.regionserver.flushlogentries", 100); conf.getInt("hbase.regionserver.flushlogentries", 100);
this.blocksize =
conf.getLong("hbase.regionserver.hlog.blocksize", 1024L * 1024L);
this.optionalFlushInterval = this.optionalFlushInterval =
conf.getLong("hbase.regionserver.optionallogflushinterval", 10 * 1000); conf.getLong("hbase.regionserver.optionallogflushinterval", 10 * 1000);
this.threadWakeFrequency = conf.getLong(THREAD_WAKE_FREQUENCY, 10 * 1000); this.threadWakeFrequency = conf.getLong(THREAD_WAKE_FREQUENCY, 10 * 1000);
@ -182,7 +187,7 @@ public class HLog implements HConstants, Syncable {
rollWriter(); rollWriter();
} }
/* /**
* Accessor for tests. Not a part of the public API. * Accessor for tests. Not a part of the public API.
* @return Current state of the monotonically increasing file id. * @return Current state of the monotonically increasing file id.
*/ */
@ -260,8 +265,14 @@ public class HLog implements HConstants, Syncable {
this.old_filenum = this.filenum; this.old_filenum = this.filenum;
this.filenum = System.currentTimeMillis(); this.filenum = System.currentTimeMillis();
Path newPath = computeFilename(this.filenum); Path newPath = computeFilename(this.filenum);
this.writer = SequenceFile.createWriter(this.fs, this.conf, newPath, 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? LOG.info((oldFile != null?
"Closed " + oldFile + ", entries=" + this.numEntries + ". ": "") + "Closed " + oldFile + ", entries=" + this.numEntries + ". ": "") +
"New log writer: " + FSUtils.getPath(newPath)); "New log writer: " + FSUtils.getPath(newPath));