Index: src/java/org/apache/hadoop/hbase/regionserver/HLogKey.java
===================================================================
--- src/java/org/apache/hadoop/hbase/regionserver/HLogKey.java (revision 5514)
+++ src/java/org/apache/hadoop/hbase/regionserver/HLogKey.java (working copy)
@@ -37,7 +37,7 @@
*
Some Transactional edits (START, COMMIT, ABORT) will not have an
* associated row.
*/
-public class HLogKey implements WritableComparable, HeapSize {
+public class HLogKey implements WritableComparable {
private byte [] regionName;
private byte [] tablename;
private long logSeqNum;
@@ -157,7 +157,4 @@
this.writeTime = in.readLong();
}
- public long heapSize() {
- return this.regionName.length + this.tablename.length + HEAP_TAX;
- }
}
Index: src/java/org/apache/hadoop/hbase/regionserver/HLog.java
===================================================================
--- src/java/org/apache/hadoop/hbase/regionserver/HLog.java (revision 5514)
+++ src/java/org/apache/hadoop/hbase/regionserver/HLog.java (working copy)
@@ -157,9 +157,6 @@
//number of transactions in the current Hlog.
private final AtomicInteger numEntries = new AtomicInteger(0);
- // Edit size of the current log. Used in figuring when to rotate logs.
- private final AtomicLong editsSize = new AtomicLong(0);
-
// If > than this size, roll the log. This is typically 0.95 times the size
// of the default Hdfs block size.
private final long logrollsize;
@@ -412,7 +409,7 @@
LOG.info((oldFile != null?
"Roll " + FSUtils.getPath(oldFile) + ", entries=" +
this.numEntries.get() +
- ", calcsize=" + this.editsSize.get() + ", filesize=" +
+ ", filesize=" +
this.fs.getFileStatus(oldFile).getLen() + ". ": "") +
"New hlog " + FSUtils.getPath(newPath));
// Can we delete any of the old log files?
@@ -431,7 +428,6 @@
}
}
this.numEntries.set(0);
- this.editsSize.set(0);
}
} finally {
this.cacheFlushLock.unlock();
@@ -690,7 +686,7 @@
// sync txn to file system
this.sync(isMetaRegion);
- if (this.editsSize.get() > this.logrollsize) {
+ if (this.writer.getLength() > this.logrollsize) {
if (listener != null) {
listener.logRollRequested();
}
@@ -749,7 +745,7 @@
// sync txn to file system
this.sync(isMetaRegion);
- if (this.editsSize.get() > this.logrollsize) {
+ if (this.writer.getLength() > this.logrollsize) {
requestLogRoll();
}
}
@@ -938,7 +934,6 @@
return;
}
try {
- this.editsSize.addAndGet(logKey.heapSize() + logEdit.heapSize());
long now = System.currentTimeMillis();
this.writer.append(logKey, logEdit);
long took = System.currentTimeMillis() - now;
Index: src/java/org/apache/hadoop/hbase/regionserver/WALEdit.java
===================================================================
--- src/java/org/apache/hadoop/hbase/regionserver/WALEdit.java (revision 5514)
+++ src/java/org/apache/hadoop/hbase/regionserver/WALEdit.java (working copy)
@@ -121,17 +121,6 @@
}
}
- public long heapSize() {
- long size = ClassSize.align(ClassSize.OBJECT +
- ClassSize.REFERENCE +
- ClassSize.ARRAYLIST);
- for (KeyValue kv : kvs) {
- size += kv.heapSize();
- }
-
- return size;
- }
-
public String toString() {
StringBuilder sb = new StringBuilder();