hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject [3/4] hbase git commit: HBASE-18897 Substitute MemStore for Memstore
Date Mon, 02 Oct 2017 13:18:20 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index d059977..80c0433 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -518,23 +518,23 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     final FlushResultImpl result; // indicating a failure result from prepare
     final TreeMap<byte[], StoreFlushContext> storeFlushCtxs;
     final TreeMap<byte[], List<Path>> committedFiles;
-    final TreeMap<byte[], MemstoreSize> storeFlushableSize;
+    final TreeMap<byte[], MemStoreSize> storeFlushableSize;
     final long startTime;
     final long flushOpSeqId;
     final long flushedSeqId;
-    final MemstoreSize totalFlushableSize;
+    final MemStoreSize totalFlushableSize;
 
     /** Constructs an early exit case */
     PrepareFlushResult(FlushResultImpl result, long flushSeqId) {
-      this(result, null, null, null, Math.max(0, flushSeqId), 0, 0, new MemstoreSize());
+      this(result, null, null, null, Math.max(0, flushSeqId), 0, 0, new MemStoreSize());
     }
 
     /** Constructs a successful prepare flush result */
     PrepareFlushResult(
       TreeMap<byte[], StoreFlushContext> storeFlushCtxs,
       TreeMap<byte[], List<Path>> committedFiles,
-      TreeMap<byte[], MemstoreSize> storeFlushableSize, long startTime, long flushSeqId,
-      long flushedSeqId, MemstoreSize totalFlushableSize) {
+      TreeMap<byte[], MemStoreSize> storeFlushableSize, long startTime, long flushSeqId,
+      long flushedSeqId, MemStoreSize totalFlushableSize) {
       this(null, storeFlushCtxs, committedFiles, storeFlushableSize, startTime,
         flushSeqId, flushedSeqId, totalFlushableSize);
     }
@@ -543,8 +543,8 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         FlushResultImpl result,
       TreeMap<byte[], StoreFlushContext> storeFlushCtxs,
       TreeMap<byte[], List<Path>> committedFiles,
-      TreeMap<byte[], MemstoreSize> storeFlushableSize, long startTime, long flushSeqId,
-      long flushedSeqId, MemstoreSize totalFlushableSize) {
+      TreeMap<byte[], MemStoreSize> storeFlushableSize, long startTime, long flushSeqId,
+      long flushedSeqId, MemStoreSize totalFlushableSize) {
       this.result = result;
       this.storeFlushCtxs = storeFlushCtxs;
       this.committedFiles = committedFiles;
@@ -1007,7 +1007,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
           Future<HStore> future = completionService.take();
           HStore store = future.get();
           this.stores.put(store.getColumnFamilyDescriptor().getName(), store);
-          if (store.isSloppyMemstore()) {
+          if (store.isSloppyMemStore()) {
             hasSloppyStores = true;
           }
 
@@ -1017,7 +1017,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
           if (maxSeqId == -1 || storeMaxSequenceId > maxSeqId) {
             maxSeqId = storeMaxSequenceId;
           }
-          long maxStoreMemstoreTS = store.getMaxMemstoreTS().orElse(0L);
+          long maxStoreMemstoreTS = store.getMaxMemStoreTS().orElse(0L);
           if (maxStoreMemstoreTS > maxMemstoreTS) {
             maxMemstoreTS = maxStoreMemstoreTS;
           }
@@ -1194,24 +1194,24 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
    * store
    * @return the size of memstore in this region
    */
-  public long addAndGetMemstoreSize(MemstoreSize memstoreSize) {
+  public long addAndGetMemStoreSize(MemStoreSize memstoreSize) {
     if (this.rsAccounting != null) {
-      rsAccounting.incGlobalMemstoreSize(memstoreSize);
+      rsAccounting.incGlobalMemStoreSize(memstoreSize);
     }
     long size = this.memstoreDataSize.addAndGet(memstoreSize.getDataSize());
-    checkNegativeMemstoreDataSize(size, memstoreSize.getDataSize());
+    checkNegativeMemStoreDataSize(size, memstoreSize.getDataSize());
     return size;
   }
 
-  public void decrMemstoreSize(MemstoreSize memstoreSize) {
+  public void decrMemStoreSize(MemStoreSize memstoreSize) {
     if (this.rsAccounting != null) {
-      rsAccounting.decGlobalMemstoreSize(memstoreSize);
+      rsAccounting.decGlobalMemStoreSize(memstoreSize);
     }
     long size = this.memstoreDataSize.addAndGet(-memstoreSize.getDataSize());
-    checkNegativeMemstoreDataSize(size, -memstoreSize.getDataSize());
+    checkNegativeMemStoreDataSize(size, -memstoreSize.getDataSize());
   }
 
-  private void checkNegativeMemstoreDataSize(long memstoreDataSize, long delta) {
+  private void checkNegativeMemStoreDataSize(long memstoreDataSize, long delta) {
     // This is extremely bad if we make memstoreSize negative. Log as much info on the offending
     // caller as possible. (memStoreSize might be a negative value already -- freeing memory)
     if (memstoreDataSize < 0) {
@@ -1260,7 +1260,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
   }
 
   @Override
-  public long getMemstoreSize() {
+  public long getMemStoreSize() {
     return memstoreDataSize.get();
   }
 
@@ -1645,13 +1645,13 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
 
         // close each store in parallel
         for (HStore store : stores.values()) {
-          MemstoreSize flushableSize = store.getFlushableSize();
+          MemStoreSize flushableSize = store.getFlushableSize();
           if (!(abort || flushableSize.getDataSize() == 0 || writestate.readOnly)) {
             if (getRegionServerServices() != null) {
               getRegionServerServices().abort("Assertion failed while closing store "
                 + getRegionInfo().getRegionNameAsString() + " " + store
                 + ". flushableSize expected=0, actual= " + flushableSize
-                + ". Current memstoreSize=" + getMemstoreSize() + ". Maybe a coprocessor "
+                + ". Current memstoreSize=" + getMemStoreSize() + ". Maybe a coprocessor "
                 + "operation failed and left the memstore in a partially updated state.", null);
             }
           }
@@ -1694,7 +1694,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
 
       this.closed.set(true);
       if (!canFlush) {
-        this.decrMemstoreSize(new MemstoreSize(memstoreDataSize.get(), getMemstoreHeapSize()));
+        this.decrMemStoreSize(new MemStoreSize(memstoreDataSize.get(), getMemStoreHeapSize()));
       } else if (memstoreDataSize.get() != 0) {
         LOG.error("Memstore size is " + memstoreDataSize.get());
       }
@@ -1716,7 +1716,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     }
   }
 
-  private long getMemstoreHeapSize() {
+  private long getMemStoreHeapSize() {
     return stores.values().stream().mapToLong(s -> s.getMemStoreSize().getHeapSize()).sum();
   }
 
@@ -1906,7 +1906,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     byte[] encodedRegionName = this.getRegionInfo().getEncodedNameAsBytes();
     regionLoadBldr.clearStoreCompleteSequenceId();
     for (byte[] familyName : this.stores.keySet()) {
-      long earliest = this.wal.getEarliestMemstoreSeqNum(encodedRegionName, familyName);
+      long earliest = this.wal.getEarliestMemStoreSeqNum(encodedRegionName, familyName);
       // Subtract - 1 to go earlier than the current oldest, unflushed edit in memstore; this will
       // give us a sequence id that is for sure flushed. We want edit replay to start after this
       // sequence id in this region. If NO_SEQNUM, use the regions maximum flush id.
@@ -2269,7 +2269,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
    * returns true which will make a lot of flush requests.
    */
   boolean shouldFlushStore(HStore store) {
-    long earliest = this.wal.getEarliestMemstoreSeqNum(getRegionInfo().getEncodedNameAsBytes(),
+    long earliest = this.wal.getEarliestMemStoreSeqNum(getRegionInfo().getEncodedNameAsBytes(),
       store.getColumnFamilyDescriptor().getName()) - 1;
     if (earliest > 0 && earliest + flushPerChanges < mvcc.getReadPoint()) {
       if (LOG.isDebugEnabled()) {
@@ -2439,7 +2439,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     // block waiting for the lock for internal flush
     this.updatesLock.writeLock().lock();
     status.setStatus("Preparing flush snapshotting stores in " + getRegionInfo().getEncodedName());
-    MemstoreSize totalSizeOfFlushableStores = new MemstoreSize();
+    MemStoreSize totalSizeOfFlushableStores = new MemStoreSize();
 
     Map<byte[], Long> flushedFamilyNamesToSeq = new HashMap<>();
     for (HStore store : storesToFlush) {
@@ -2449,7 +2449,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
 
     TreeMap<byte[], StoreFlushContext> storeFlushCtxs = new TreeMap<>(Bytes.BYTES_COMPARATOR);
     TreeMap<byte[], List<Path>> committedFiles = new TreeMap<>(Bytes.BYTES_COMPARATOR);
-    TreeMap<byte[], MemstoreSize> storeFlushableSize = new TreeMap<>(Bytes.BYTES_COMPARATOR);
+    TreeMap<byte[], MemStoreSize> storeFlushableSize = new TreeMap<>(Bytes.BYTES_COMPARATOR);
     // The sequence id of this flush operation which is used to log FlushMarker and pass to
     // createFlushContext to use as the store file's sequence id. It can be in advance of edits
     // still in the memstore, edits that are in other column families yet to be flushed.
@@ -2481,8 +2481,8 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
       }
 
       for (HStore s : storesToFlush) {
-        MemstoreSize flushableSize = s.getFlushableSize();
-        totalSizeOfFlushableStores.incMemstoreSize(flushableSize);
+        MemStoreSize flushableSize = s.getFlushableSize();
+        totalSizeOfFlushableStores.incMemStoreSize(flushableSize);
         storeFlushCtxs.put(s.getColumnFamilyDescriptor().getName(), s.createFlushContext(flushOpSeqId));
         committedFiles.put(s.getColumnFamilyDescriptor().getName(), null); // for writing stores to WAL
         storeFlushableSize.put(s.getColumnFamilyDescriptor().getName(), flushableSize);
@@ -2645,15 +2645,15 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         committedFiles.put(storeName, storeCommittedFiles);
         // Flush committed no files, indicating flush is empty or flush was canceled
         if (storeCommittedFiles == null || storeCommittedFiles.isEmpty()) {
-          MemstoreSize storeFlushableSize = prepareResult.storeFlushableSize.get(storeName);
-          prepareResult.totalFlushableSize.decMemstoreSize(storeFlushableSize);
+          MemStoreSize storeFlushableSize = prepareResult.storeFlushableSize.get(storeName);
+          prepareResult.totalFlushableSize.decMemStoreSize(storeFlushableSize);
         }
         flushedOutputFileSize += flush.getOutputFileSize();
       }
       storeFlushCtxs.clear();
 
       // Set down the memstore size by amount of flush.
-      this.decrMemstoreSize(prepareResult.totalFlushableSize);
+      this.decrMemStoreSize(prepareResult.totalFlushableSize);
 
       if (wal != null) {
         // write flush marker to WAL. If fail, we should throw DroppedSnapshotException
@@ -3110,7 +3110,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
           initialized = true;
         }
         doMiniBatchMutate(batchOp);
-        long newSize = this.getMemstoreSize();
+        long newSize = this.getMemStoreSize();
         requestFlushIfNeeded(newSize);
       }
     } finally {
@@ -3182,7 +3182,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     int cellCount = 0;
     /** Keep track of the locks we hold so we can release them in finally clause */
     List<RowLock> acquiredRowLocks = Lists.newArrayListWithCapacity(batchOp.operations.length);
-    MemstoreSize memstoreSize = new MemstoreSize();
+    MemStoreSize memstoreSize = new MemStoreSize();
     final ObservedExceptionsInBatch observedExceptions = new ObservedExceptionsInBatch();
     try {
       // STEP 1. Try to acquire as many locks as we can, and ensure we acquire at least one.
@@ -3414,11 +3414,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
           this.updateSequenceId(familyMaps[i].values(),
             replay? batchOp.getReplaySequenceId(): writeEntry.getWriteNumber());
         }
-        applyFamilyMapToMemstore(familyMaps[i], memstoreSize);
+        applyFamilyMapToMemStore(familyMaps[i], memstoreSize);
       }
 
       // update memstore size
-      this.addAndGetMemstoreSize(memstoreSize);
+      this.addAndGetMemStoreSize(memstoreSize);
 
       // calling the post CP hook for batch mutation
       if (!replay && coprocessorHost != null) {
@@ -3952,13 +3952,13 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
    * @param familyMap Map of Cells by family
    * @param memstoreSize
    */
-  private void applyFamilyMapToMemstore(Map<byte[], List<Cell>> familyMap,
-      MemstoreSize memstoreSize) throws IOException {
+  private void applyFamilyMapToMemStore(Map<byte[], List<Cell>> familyMap,
+      MemStoreSize memstoreSize) throws IOException {
     for (Map.Entry<byte[], List<Cell>> e : familyMap.entrySet()) {
       byte[] family = e.getKey();
       List<Cell> cells = e.getValue();
       assert cells instanceof RandomAccess;
-      applyToMemstore(getStore(family), cells, false, memstoreSize);
+      applyToMemStore(getStore(family), cells, false, memstoreSize);
     }
   }
 
@@ -3966,11 +3966,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
    * @param delta If we are doing delta changes -- e.g. increment/append -- then this flag will be
    *          set; when set we will run operations that make sense in the increment/append scenario
    *          but that do not make sense otherwise.
-   * @see #applyToMemstore(HStore, Cell, long)
+   * @see #applyToMemStore(HStore, Cell, MemStoreSize)
    */
-  private void applyToMemstore(HStore store, List<Cell> cells, boolean delta,
-      MemstoreSize memstoreSize) throws IOException {
-    // Any change in how we update Store/MemStore needs to also be done in other applyToMemstore!!!!
+  private void applyToMemStore(HStore store, List<Cell> cells, boolean delta,
+      MemStoreSize memstoreSize) throws IOException {
+    // Any change in how we update Store/MemStore needs to also be done in other applyToMemStore!!!!
     boolean upsert = delta && store.getColumnFamilyDescriptor().getMaxVersions() == 1;
     if (upsert) {
       store.upsert(cells, getSmallestReadPoint(), memstoreSize);
@@ -3980,11 +3980,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
   }
 
   /**
-   * @see #applyToMemstore(HStore, List, boolean, boolean, long)
+   * @see #applyToMemStore(HStore, List, boolean, MemStoreSize)
    */
-  private void applyToMemstore(HStore store, Cell cell, MemstoreSize memstoreSize)
+  private void applyToMemStore(HStore store, Cell cell, MemStoreSize memstoreSize)
       throws IOException {
-    // Any change in how we update Store/MemStore needs to also be done in other applyToMemstore!!!!
+    // Any change in how we update Store/MemStore needs to also be done in other applyToMemStore!!!!
     if (store == null) {
       checkFamily(CellUtil.cloneFamily(cell));
       // Unreachable because checkFamily will throw exception
@@ -4040,7 +4040,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
   }
 
   private void requestFlushIfNeeded(long memstoreTotalSize) throws RegionTooBusyException {
-    if(memstoreTotalSize > this.getMemstoreFlushSize()) {
+    if(memstoreTotalSize > this.getMemStoreFlushSize()) {
       requestFlush();
     }
   }
@@ -4308,7 +4308,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
           }
 
           boolean flush = false;
-          MemstoreSize memstoreSize = new MemstoreSize();
+          MemStoreSize memstoreSize = new MemStoreSize();
           for (Cell cell: val.getCells()) {
             // Check this edit is for me. Also, guard against writing the special
             // METACOLUMN info such as HBASE::CACHEFLUSH entries
@@ -4358,7 +4358,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
             rsAccounting.addRegionReplayEditsSize(getRegionInfo().getRegionName(),
                 memstoreSize);
           }
-          flush = isFlushSize(this.addAndGetMemstoreSize(memstoreSize));
+          flush = isFlushSize(this.addAndGetMemStoreSize(memstoreSize));
           if (flush) {
             internalFlushcache(null, currentEditSeqId, stores.values(), status, false);
           }
@@ -4667,7 +4667,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
             replayFlushInStores(flush, prepareFlushResult, true);
 
             // Set down the memstore size by amount of flush.
-            this.decrMemstoreSize(prepareFlushResult.totalFlushableSize);
+            this.decrMemStoreSize(prepareFlushResult.totalFlushableSize);
 
             this.prepareFlushResult = null;
             writestate.flushing = false;
@@ -4700,11 +4700,11 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
             replayFlushInStores(flush, prepareFlushResult, true);
 
             // Set down the memstore size by amount of flush.
-            this.decrMemstoreSize(prepareFlushResult.totalFlushableSize);
+            this.decrMemStoreSize(prepareFlushResult.totalFlushableSize);
 
             // Inspect the memstore contents to see whether the memstore contains only edits
             // with seqId smaller than the flush seqId. If so, we can discard those edits.
-            dropMemstoreContentsForSeqId(flush.getFlushSequenceNumber(), null);
+            dropMemStoreContentsForSeqId(flush.getFlushSequenceNumber(), null);
 
             this.prepareFlushResult = null;
             writestate.flushing = false;
@@ -4725,7 +4725,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
 
           // Inspect the memstore contents to see whether the memstore contains only edits
           // with seqId smaller than the flush seqId. If so, we can discard those edits.
-          dropMemstoreContentsForSeqId(flush.getFlushSequenceNumber(), null);
+          dropMemStoreContentsForSeqId(flush.getFlushSequenceNumber(), null);
         }
 
         status.markComplete("Flush commit successful");
@@ -4803,8 +4803,8 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
    * if the memstore edits have seqNums smaller than the given seq id
    * @throws IOException
    */
-  private MemstoreSize dropMemstoreContentsForSeqId(long seqId, HStore store) throws IOException {
-    MemstoreSize totalFreedSize = new MemstoreSize();
+  private MemStoreSize dropMemStoreContentsForSeqId(long seqId, HStore store) throws IOException {
+    MemStoreSize totalFreedSize = new MemStoreSize();
     this.updatesLock.writeLock().lock();
     try {
 
@@ -4818,10 +4818,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         // Prepare flush (take a snapshot) and then abort (drop the snapshot)
         if (store == null) {
           for (HStore s : stores.values()) {
-            totalFreedSize.incMemstoreSize(doDropStoreMemstoreContentsForSeqId(s, currentSeqId));
+            totalFreedSize.incMemStoreSize(doDropStoreMemStoreContentsForSeqId(s, currentSeqId));
           }
         } else {
-          totalFreedSize.incMemstoreSize(doDropStoreMemstoreContentsForSeqId(store, currentSeqId));
+          totalFreedSize.incMemStoreSize(doDropStoreMemStoreContentsForSeqId(store, currentSeqId));
         }
       } else {
         LOG.info(getRegionInfo().getEncodedName() + " : "
@@ -4834,10 +4834,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     return totalFreedSize;
   }
 
-  private MemstoreSize doDropStoreMemstoreContentsForSeqId(HStore s, long currentSeqId)
+  private MemStoreSize doDropStoreMemStoreContentsForSeqId(HStore s, long currentSeqId)
       throws IOException {
-    MemstoreSize flushableSize = s.getFlushableSize();
-    this.decrMemstoreSize(flushableSize);
+    MemStoreSize flushableSize = s.getFlushableSize();
+    this.decrMemStoreSize(flushableSize);
     StoreFlushContext ctx = s.createFlushContext(currentSeqId);
     ctx.prepare();
     ctx.abort();
@@ -4954,16 +4954,16 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
               StoreFlushContext ctx = this.prepareFlushResult.storeFlushCtxs == null ?
                   null : this.prepareFlushResult.storeFlushCtxs.get(family);
               if (ctx != null) {
-                MemstoreSize snapshotSize = store.getFlushableSize();
+                MemStoreSize snapshotSize = store.getFlushableSize();
                 ctx.abort();
-                this.decrMemstoreSize(snapshotSize);
+                this.decrMemStoreSize(snapshotSize);
                 this.prepareFlushResult.storeFlushCtxs.remove(family);
               }
             }
           }
 
           // Drop the memstore contents if they are now smaller than the latest seen flushed file
-          dropMemstoreContentsForSeqId(regionEvent.getLogSequenceNumber(), store);
+          dropMemStoreContentsForSeqId(regionEvent.getLogSequenceNumber(), store);
           if (storeSeqId > this.maxFlushedSeqId) {
             this.maxFlushedSeqId = storeSeqId;
           }
@@ -5148,9 +5148,9 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
                     null : this.prepareFlushResult.storeFlushCtxs.get(
                             store.getColumnFamilyDescriptor().getName());
                 if (ctx != null) {
-                  MemstoreSize snapshotSize = store.getFlushableSize();
+                  MemStoreSize snapshotSize = store.getFlushableSize();
                   ctx.abort();
-                  this.decrMemstoreSize(snapshotSize);
+                  this.decrMemStoreSize(snapshotSize);
                   this.prepareFlushResult.storeFlushCtxs.remove(
                           store.getColumnFamilyDescriptor().getName());
                   totalFreedDataSize += snapshotSize.getDataSize();
@@ -5169,7 +5169,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         // advance the mvcc read point so that the new flushed files are visible.
         // either greater than flush seq number or they were already picked up via flush.
         for (HStore s : stores.values()) {
-          mvcc.advanceTo(s.getMaxMemstoreTS().orElse(0L));
+          mvcc.advanceTo(s.getMaxMemStoreTS().orElse(0L));
         }
 
 
@@ -5184,7 +5184,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
       if (!map.isEmpty()) {
         for (Map.Entry<HStore, Long> entry : map.entrySet()) {
           // Drop the memstore contents if they are now smaller than the latest seen flushed file
-          totalFreedDataSize += dropMemstoreContentsForSeqId(entry.getValue(), entry.getKey())
+          totalFreedDataSize += dropMemStoreContentsForSeqId(entry.getValue(), entry.getKey())
               .getDataSize();
         }
       }
@@ -5235,7 +5235,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
    * @param memstoreSize
    */
   @VisibleForTesting
-  protected void restoreEdit(HStore s, Cell cell, MemstoreSize memstoreSize) {
+  protected void restoreEdit(HStore s, Cell cell, MemStoreSize memstoreSize) {
     s.add(cell, memstoreSize);
   }
 
@@ -6958,7 +6958,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
       return null;
     }
     ClientProtos.RegionLoadStats.Builder stats = ClientProtos.RegionLoadStats.newBuilder();
-    stats.setMemstoreLoad((int) (Math.min(100, (this.memstoreDataSize.get() * 100) / this
+    stats.setMemStoreLoad((int) (Math.min(100, (this.memstoreDataSize.get() * 100) / this
         .memstoreFlushSize)));
     if (rsServices.getHeapMemoryManager() != null) {
       // the HeapMemoryManager uses -0.0 to signal a problem asking the JVM,
@@ -7021,7 +7021,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     // This is assigned by mvcc either explicity in the below or in the guts of the WAL append
     // when it assigns the edit a sequencedid (A.K.A the mvcc write number).
     WriteEntry writeEntry = null;
-    MemstoreSize memstoreSize = new MemstoreSize();
+    MemStoreSize memstoreSize = new MemStoreSize();
     try {
       boolean success = false;
       try {
@@ -7055,7 +7055,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
           long sequenceId = writeEntry.getWriteNumber();
           for (Mutation m : mutations) {
             // Handle any tag based cell features.
-            // TODO: Do we need to call rewriteCellTags down in applyToMemstore()? Why not before
+            // TODO: Do we need to call rewriteCellTags down in applyToMemStore()? Why not before
             // so tags go into WAL?
             rewriteCellTags(m.getFamilyCellMap(), m);
             for (CellScanner cellScanner = m.cellScanner(); cellScanner.advance();) {
@@ -7065,7 +7065,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
                 // If no WAL, need to stamp it here.
                 CellUtil.setSequenceId(cell, sequenceId);
               }
-              applyToMemstore(getStore(cell), cell, memstoreSize);
+              applyToMemStore(getStore(cell), cell, memstoreSize);
             }
           }
 
@@ -7101,7 +7101,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     } finally {
       closeRegionOperation();
       if (!mutations.isEmpty()) {
-        long newSize = this.addAndGetMemstoreSize(memstoreSize);
+        long newSize = this.addAndGetMemStoreSize(memstoreSize);
         requestFlushIfNeeded(newSize);
       }
     }
@@ -7206,7 +7206,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     startRegionOperation(op);
     List<Cell> results = returnResults? new ArrayList<>(mutation.size()): null;
     RowLock rowLock = null;
-    MemstoreSize memstoreSize = new MemstoreSize();
+    MemStoreSize memstoreSize = new MemStoreSize();
     try {
       rowLock = getRowLockInternal(mutation.getRow(), false);
       lock(this.updatesLock.readLock());
@@ -7232,7 +7232,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         }
         // Now write to MemStore. Do it a column family at a time.
         for (Map.Entry<HStore, List<Cell>> e : forMemStore.entrySet()) {
-          applyToMemstore(e.getKey(), e.getValue(), true, memstoreSize);
+          applyToMemStore(e.getKey(), e.getValue(), true, memstoreSize);
         }
         mvcc.completeAndWait(writeEntry);
         if (rsServices != null && rsServices.getNonceManager() != null) {
@@ -7255,7 +7255,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         rowLock.release();
       }
       // Request a cache flush if over the limit.  Do it outside update lock.
-      if (isFlushSize(addAndGetMemstoreSize(memstoreSize))) {
+      if (isFlushSize(addAndGetMemStoreSize(memstoreSize))) {
         requestFlush();
       }
       closeRegionOperation(op);
@@ -7982,7 +7982,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
 
   @Override
   public long getOldestSeqIdOfStore(byte[] familyName) {
-    return wal.getEarliestMemstoreSeqNum(getRegionInfo().getEncodedNameAsBytes(), familyName);
+    return wal.getEarliestMemStoreSeqNum(getRegionInfo().getEncodedNameAsBytes(), familyName);
   }
 
   @Override
@@ -8059,7 +8059,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
         : CellComparator.COMPARATOR;
   }
 
-  public long getMemstoreFlushSize() {
+  public long getMemStoreFlushSize() {
     return this.memstoreFlushSize;
   }
 
@@ -8079,7 +8079,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
     }
     buf.append("end-of-stores");
     buf.append(", memstore size ");
-    buf.append(getMemstoreSize());
+    buf.append(getMemStoreSize());
     if (getRegionInfo().getRegionNameAsString().startsWith(regionName)) {
       throw new RuntimeException(buf.toString());
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index 5ef0358..f69695a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -949,7 +949,7 @@ public class HRegionServer extends HasThread implements
     // Background thread to check for compactions; needed if region has not gotten updates
     // in a while. It will take care of not checking too frequently on store-by-store basis.
     this.compactionChecker = new CompactionChecker(this, this.threadWakeFrequency, this);
-    this.periodicFlusher = new PeriodicMemstoreFlusher(this.threadWakeFrequency, this);
+    this.periodicFlusher = new PeriodicMemStoreFlusher(this.threadWakeFrequency, this);
     this.leases = new Leases(this.threadWakeFrequency);
 
     // Create the thread to clean the moved regions list
@@ -1622,7 +1622,7 @@ public class HRegionServer extends HasThread implements
       // MSLAB is enabled. So initialize MemStoreChunkPool
       // By this time, the MemstoreFlusher is already initialized. We can get the global limits from
       // it.
-      Pair<Long, MemoryType> pair = MemorySizeUtil.getGlobalMemstoreSize(conf);
+      Pair<Long, MemoryType> pair = MemorySizeUtil.getGlobalMemStoreSize(conf);
       long globalMemStoreSize = pair.getFirst();
       boolean offheap = this.regionServerAccounting.isOffheap();
       // When off heap memstore in use, take full area for chunk pool.
@@ -1679,7 +1679,7 @@ public class HRegionServer extends HasThread implements
     int storefiles = 0;
     int storeUncompressedSizeMB = 0;
     int storefileSizeMB = 0;
-    int memstoreSizeMB = (int) (r.getMemstoreSize() / 1024 / 1024);
+    int memstoreSizeMB = (int) (r.getMemStoreSize() / 1024 / 1024);
     long storefileIndexSizeKB = 0;
     int rootIndexSizeKB = 0;
     int totalStaticIndexSizeKB = 0;
@@ -1718,7 +1718,7 @@ public class HRegionServer extends HasThread implements
       .setStorefiles(storefiles)
       .setStoreUncompressedSizeMB(storeUncompressedSizeMB)
       .setStorefileSizeMB(storefileSizeMB)
-      .setMemstoreSizeMB(memstoreSizeMB)
+      .setMemStoreSizeMB(memstoreSizeMB)
       .setStorefileIndexSizeKB(storefileIndexSizeKB)
       .setRootIndexSizeKB(rootIndexSizeKB)
       .setTotalStaticIndexSizeKB(totalStaticIndexSizeKB)
@@ -1809,11 +1809,11 @@ public class HRegionServer extends HasThread implements
     }
   }
 
-  static class PeriodicMemstoreFlusher extends ScheduledChore {
+  static class PeriodicMemStoreFlusher extends ScheduledChore {
     final HRegionServer server;
     final static int RANGE_OF_DELAY = 5 * 60 * 1000; // 5 min in milliseconds
     final static int MIN_DELAY_TIME = 0; // millisec
-    public PeriodicMemstoreFlusher(int cacheFlushInterval, final HRegionServer server) {
+    public PeriodicMemStoreFlusher(int cacheFlushInterval, final HRegionServer server) {
       super("MemstoreFlusherChore", server, cacheFlushInterval);
       this.server = server;
     }
@@ -2778,7 +2778,7 @@ public class HRegionServer extends HasThread implements
         });
     // Copy over all regions. Regions are sorted by size with biggest first.
     for (Region region : this.onlineRegions.values()) {
-      sortedRegions.put(region.getMemstoreSize(), region);
+      sortedRegions.put(region.getMemStoreSize(), region);
     }
     return sortedRegions;
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index f232ddd..8668649 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -393,18 +393,18 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
   }
 
   @Override
-  public long getMemstoreFlushSize() {
+  public long getMemStoreFlushSize() {
     // TODO: Why is this in here?  The flushsize of the region rather than the store?  St.Ack
     return this.region.memstoreFlushSize;
   }
 
   @Override
-  public MemstoreSize getFlushableSize() {
+  public MemStoreSize getFlushableSize() {
     return this.memstore.getFlushableSize();
   }
 
   @Override
-  public MemstoreSize getSnapshotSize() {
+  public MemStoreSize getSnapshotSize() {
     return this.memstore.getSnapshotSize();
   }
 
@@ -461,8 +461,8 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
   }
 
   @Override
-  public OptionalLong getMaxMemstoreTS() {
-    return StoreUtils.getMaxMemstoreTSInList(this.getStorefiles());
+  public OptionalLong getMaxMemStoreTS() {
+    return StoreUtils.getMaxMemStoreTSInList(this.getStorefiles());
   }
 
   /**
@@ -684,7 +684,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
    * @param cell
    * @param memstoreSize
    */
-  public void add(final Cell cell, MemstoreSize memstoreSize) {
+  public void add(final Cell cell, MemStoreSize memstoreSize) {
     lock.readLock().lock();
     try {
        this.memstore.add(cell, memstoreSize);
@@ -698,7 +698,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
    * @param cells
    * @param memstoreSize
    */
-  public void add(final Iterable<Cell> cells, MemstoreSize memstoreSize) {
+  public void add(final Iterable<Cell> cells, MemStoreSize memstoreSize) {
     lock.readLock().lock();
     try {
       memstore.add(cells, memstoreSize);
@@ -2115,7 +2115,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
   }
 
   @Override
-  public MemstoreSize getMemStoreSize() {
+  public MemStoreSize getMemStoreSize() {
     return this.memstore.size();
   }
 
@@ -2169,7 +2169,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
    * @param memstoreSize
    * @throws IOException
    */
-  public void upsert(Iterable<Cell> cells, long readpoint, MemstoreSize memstoreSize)
+  public void upsert(Iterable<Cell> cells, long readpoint, MemStoreSize memstoreSize)
       throws IOException {
     this.lock.readLock().lock();
     try {
@@ -2343,7 +2343,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
 
   @Override
   public long heapSize() {
-    MemstoreSize memstoreSize = this.memstore.size();
+    MemStoreSize memstoreSize = this.memstore.size();
     return DEEP_OVERHEAD + memstoreSize.getHeapSize();
   }
 
@@ -2578,7 +2578,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation, Propagat
   }
 
   @Override
-  public boolean isSloppyMemstore() {
+  public boolean isSloppyMemStore() {
     return this.memstore.isSloppy();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java
index a79af13..5301922 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java
@@ -159,7 +159,7 @@ public class HStoreFile implements StoreFile {
   }
 
   @Override
-  public long getMaxMemstoreTS() {
+  public long getMaxMemStoreTS() {
     return maxMemstoreTS;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
index 0ee03eb..14021ff 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HeapMemoryManager.java
@@ -49,19 +49,19 @@ import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTe
 public class HeapMemoryManager {
   private static final Log LOG = LogFactory.getLog(HeapMemoryManager.class);
   private static final int CONVERT_TO_PERCENTAGE = 100;
-  private static final int CLUSTER_MINIMUM_MEMORY_THRESHOLD = 
+  private static final int CLUSTER_MINIMUM_MEMORY_THRESHOLD =
     (int) (CONVERT_TO_PERCENTAGE * HConstants.HBASE_CLUSTER_MINIMUM_MEMORY_THRESHOLD);
 
   public static final String BLOCK_CACHE_SIZE_MAX_RANGE_KEY = "hfile.block.cache.size.max.range";
   public static final String BLOCK_CACHE_SIZE_MIN_RANGE_KEY = "hfile.block.cache.size.min.range";
-  public static final String MEMSTORE_SIZE_MAX_RANGE_KEY = 
+  public static final String MEMSTORE_SIZE_MAX_RANGE_KEY =
       "hbase.regionserver.global.memstore.size.max.range";
-  public static final String MEMSTORE_SIZE_MIN_RANGE_KEY = 
+  public static final String MEMSTORE_SIZE_MIN_RANGE_KEY =
       "hbase.regionserver.global.memstore.size.min.range";
-  public static final String HBASE_RS_HEAP_MEMORY_TUNER_PERIOD = 
+  public static final String HBASE_RS_HEAP_MEMORY_TUNER_PERIOD =
       "hbase.regionserver.heapmemory.tuner.period";
   public static final int HBASE_RS_HEAP_MEMORY_TUNER_DEFAULT_PERIOD = 60 * 1000;
-  public static final String HBASE_RS_HEAP_MEMORY_TUNER_CLASS = 
+  public static final String HBASE_RS_HEAP_MEMORY_TUNER_CLASS =
       "hbase.regionserver.heapmemory.tuner.class";
 
   public static final float HEAP_OCCUPANCY_ERROR_VALUE = -0.0f;
@@ -255,7 +255,7 @@ public class HeapMemoryManager {
           HBASE_RS_HEAP_MEMORY_TUNER_CLASS, DefaultHeapMemoryTuner.class, HeapMemoryTuner.class);
       heapMemTuner = ReflectionUtils.newInstance(tunerKlass, server.getConfiguration());
       tunerContext
-          .setOffheapMemstore(regionServerAccounting.isOffheap());
+          .setOffheapMemStore(regionServerAccounting.isOffheap());
     }
 
     @Override
@@ -324,7 +324,7 @@ public class HeapMemoryManager {
       // TODO : add support for offheap metrics
       tunerContext.setCurBlockCacheUsed((float) blockCache.getCurrentSize() / maxHeapSize);
       metricsHeapMemoryManager.setCurBlockCacheSizeGauge(blockCache.getCurrentSize());
-      long globalMemstoreHeapSize = regionServerAccounting.getGlobalMemstoreHeapSize();
+      long globalMemstoreHeapSize = regionServerAccounting.getGlobalMemStoreHeapSize();
       tunerContext.setCurMemStoreUsed((float) globalMemstoreHeapSize / maxHeapSize);
       metricsHeapMemoryManager.setCurMemStoreSizeGauge(globalMemstoreHeapSize);
       tunerContext.setCurBlockCacheSize(blockCachePercent);
@@ -336,7 +336,7 @@ public class HeapMemoryManager {
         LOG.error("Exception thrown from the HeapMemoryTuner implementation", t);
       }
       if (result != null && result.needsTuning()) {
-        float memstoreSize = result.getMemstoreSize();
+        float memstoreSize = result.getMemStoreSize();
         float blockCacheSize = result.getBlockCacheSize();
         LOG.debug("From HeapMemoryTuner new memstoreSize: " + memstoreSize
             + ". new blockCacheSize: " + blockCacheSize);
@@ -388,7 +388,7 @@ public class HeapMemoryManager {
           globalMemStorePercent = memstoreSize;
           // Internally sets it to RegionServerAccounting
           // TODO : Set directly on RSAccounting??
-          memStoreFlusher.setGlobalMemstoreLimit(newMemstoreSize);
+          memStoreFlusher.setGlobalMemStoreLimit(newMemstoreSize);
           for (HeapMemoryTuneObserver observer : tuneObservers) {
             // Risky.. If this newMemstoreSize decreases we reduce the count in offheap chunk pool
             observer.onHeapMemoryTune(newMemstoreSize, newBlockCacheSize);
@@ -500,11 +500,11 @@ public class HeapMemoryManager {
         this.curMemStoreUsed = d;
     }
 
-    public void setOffheapMemstore(boolean offheapMemstore) {
+    public void setOffheapMemStore(boolean offheapMemstore) {
       this.offheapMemstore = offheapMemstore;
     }
 
-    public boolean isOffheapMemstore() {
+    public boolean isOffheapMemStore() {
       return this.offheapMemstore;
     }
   }
@@ -522,11 +522,11 @@ public class HeapMemoryManager {
       this.needsTuning = needsTuning;
     }
 
-    public float getMemstoreSize() {
+    public float getMemStoreSize() {
       return memstoreSize;
     }
 
-    public void setMemstoreSize(float memstoreSize) {
+    public void setMemStoreSize(float memstoreSize) {
       this.memstoreSize = memstoreSize;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
index cd80c29..324afbe 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
@@ -57,13 +57,13 @@ public interface MemStore {
    *
    * @return size of data that is going to be flushed
    */
-  MemstoreSize getFlushableSize();
+  MemStoreSize getFlushableSize();
 
   /**
    * Return the size of the snapshot(s) if any
    * @return size of the memstore snapshot
    */
-  MemstoreSize getSnapshotSize();
+  MemStoreSize getSnapshotSize();
 
   /**
    * Write an update
@@ -71,7 +71,7 @@ public interface MemStore {
    * @param memstoreSize The delta in memstore size will be passed back via this.
    *        This will include both data size and heap overhead delta.
    */
-  void add(final Cell cell, MemstoreSize memstoreSize);
+  void add(final Cell cell, MemStoreSize memstoreSize);
 
   /**
    * Write the updates
@@ -79,7 +79,7 @@ public interface MemStore {
    * @param memstoreSize The delta in memstore size will be passed back via this.
    *        This will include both data size and heap overhead delta.
    */
-  void add(Iterable<Cell> cells, MemstoreSize memstoreSize);
+  void add(Iterable<Cell> cells, MemStoreSize memstoreSize);
 
   /**
    * @return Oldest timestamp of all the Cells in the MemStore
@@ -102,7 +102,7 @@ public interface MemStore {
    * @param memstoreSize The delta in memstore size will be passed back via this.
    *        This will include both data size and heap overhead delta.
    */
-  void upsert(Iterable<Cell> cells, long readpoint, MemstoreSize memstoreSize);
+  void upsert(Iterable<Cell> cells, long readpoint, MemStoreSize memstoreSize);
 
   /**
    * @return scanner over the memstore. This might include scanner over the snapshot when one is
@@ -116,7 +116,7 @@ public interface MemStore {
    *         the memstore may be changed while computing its size. It is the responsibility of the
    *         caller to make sure this doesn't happen.
    */
-  MemstoreSize size();
+  MemStoreSize size();
 
   /**
    * This method is called before the flush is executed.

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
index 8fa686c..f37f8f6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreFlusher.java
@@ -107,10 +107,10 @@ class MemStoreFlusher implements FlushRequester {
     this.flushHandlers = new FlushHandler[handlerCount];
     LOG.info("globalMemStoreLimit="
         + TraditionalBinaryPrefix
-            .long2String(this.server.getRegionServerAccounting().getGlobalMemstoreLimit(), "", 1)
+            .long2String(this.server.getRegionServerAccounting().getGlobalMemStoreLimit(), "", 1)
         + ", globalMemStoreLimitLowMark="
         + TraditionalBinaryPrefix.long2String(
-          this.server.getRegionServerAccounting().getGlobalMemstoreLimitLowMark(), "", 1)
+          this.server.getRegionServerAccounting().getGlobalMemStoreLimitLowMark(), "", 1)
         + ", Offheap="
         + (this.server.getRegionServerAccounting().isOffheap()));
   }
@@ -136,12 +136,12 @@ class MemStoreFlusher implements FlushRequester {
     while (!flushedOne) {
       // Find the biggest region that doesn't have too many storefiles
       // (might be null!)
-      Region bestFlushableRegion = getBiggestMemstoreRegion(regionsBySize, excludedRegions, true);
+      Region bestFlushableRegion = getBiggestMemStoreRegion(regionsBySize, excludedRegions, true);
       // Find the biggest region, total, even if it might have too many flushes.
-      Region bestAnyRegion = getBiggestMemstoreRegion(
+      Region bestAnyRegion = getBiggestMemStoreRegion(
           regionsBySize, excludedRegions, false);
       // Find the biggest region that is a secondary region
-      Region bestRegionReplica = getBiggestMemstoreOfRegionReplica(regionsBySize,
+      Region bestRegionReplica = getBiggestMemStoreOfRegionReplica(regionsBySize,
         excludedRegions);
 
       if (bestAnyRegion == null && bestRegionReplica == null) {
@@ -151,7 +151,7 @@ class MemStoreFlusher implements FlushRequester {
 
       Region regionToFlush;
       if (bestFlushableRegion != null &&
-          bestAnyRegion.getMemstoreSize() > 2 * bestFlushableRegion.getMemstoreSize()) {
+          bestAnyRegion.getMemStoreSize() > 2 * bestFlushableRegion.getMemStoreSize()) {
         // Even if it's not supposed to be flushed, pick a region if it's more than twice
         // as big as the best flushable one - otherwise when we're under pressure we make
         // lots of little flushes and cause lots of compactions, etc, which just makes
@@ -160,9 +160,9 @@ class MemStoreFlusher implements FlushRequester {
           LOG.debug("Under global heap pressure: " + "Region "
               + bestAnyRegion.getRegionInfo().getRegionNameAsString()
               + " has too many " + "store files, but is "
-              + TraditionalBinaryPrefix.long2String(bestAnyRegion.getMemstoreSize(), "", 1)
+              + TraditionalBinaryPrefix.long2String(bestAnyRegion.getMemStoreSize(), "", 1)
               + " vs best flushable region's "
-              + TraditionalBinaryPrefix.long2String(bestFlushableRegion.getMemstoreSize(), "", 1)
+              + TraditionalBinaryPrefix.long2String(bestFlushableRegion.getMemStoreSize(), "", 1)
               + ". Choosing the bigger.");
         }
         regionToFlush = bestAnyRegion;
@@ -175,20 +175,20 @@ class MemStoreFlusher implements FlushRequester {
       }
 
       Preconditions.checkState(
-        (regionToFlush != null && regionToFlush.getMemstoreSize() > 0) ||
-        (bestRegionReplica != null && bestRegionReplica.getMemstoreSize() > 0));
+        (regionToFlush != null && regionToFlush.getMemStoreSize() > 0) ||
+        (bestRegionReplica != null && bestRegionReplica.getMemStoreSize() > 0));
 
       if (regionToFlush == null ||
           (bestRegionReplica != null &&
            ServerRegionReplicaUtil.isRegionReplicaStoreFileRefreshEnabled(conf) &&
-           (bestRegionReplica.getMemstoreSize()
-               > secondaryMultiplier * regionToFlush.getMemstoreSize()))) {
+           (bestRegionReplica.getMemStoreSize()
+               > secondaryMultiplier * regionToFlush.getMemStoreSize()))) {
         LOG.info("Refreshing storefiles of region " + bestRegionReplica
             + " due to global heap pressure. Total memstore datasize="
             + StringUtils
-                .humanReadableInt(server.getRegionServerAccounting().getGlobalMemstoreDataSize())
+                .humanReadableInt(server.getRegionServerAccounting().getGlobalMemStoreDataSize())
             + " memstore heap size=" + StringUtils.humanReadableInt(
-                server.getRegionServerAccounting().getGlobalMemstoreHeapSize()));
+                server.getRegionServerAccounting().getGlobalMemStoreHeapSize()));
         flushedOne = refreshStoreFilesAndReclaimMemory(bestRegionReplica);
         if (!flushedOne) {
           LOG.info("Excluding secondary region " + bestRegionReplica +
@@ -198,9 +198,9 @@ class MemStoreFlusher implements FlushRequester {
       } else {
         LOG.info("Flush of region " + regionToFlush + " due to global heap pressure. "
             + "Total Memstore size="
-            + humanReadableInt(server.getRegionServerAccounting().getGlobalMemstoreDataSize())
+            + humanReadableInt(server.getRegionServerAccounting().getGlobalMemStoreDataSize())
             + ", Region memstore size="
-            + humanReadableInt(regionToFlush.getMemstoreSize()));
+            + humanReadableInt(regionToFlush.getMemStoreSize()));
         flushedOne = flushRegion(regionToFlush, true, false);
 
         if (!flushedOne) {
@@ -231,7 +231,7 @@ class MemStoreFlusher implements FlushRequester {
             if (type != FlushType.NORMAL) {
               LOG.debug("Flush thread woke up because memory above low water="
                   + TraditionalBinaryPrefix.long2String(
-                    server.getRegionServerAccounting().getGlobalMemstoreLimitLowMark(), "", 1));
+                    server.getRegionServerAccounting().getGlobalMemStoreLimitLowMark(), "", 1));
               // For offheap memstore, even if the lower water mark was breached due to heap overhead
               // we still select the regions based on the region's memstore data size.
               // TODO : If we want to decide based on heap over head it can be done without tracking
@@ -283,7 +283,7 @@ class MemStoreFlusher implements FlushRequester {
     }
   }
 
-  private Region getBiggestMemstoreRegion(
+  private Region getBiggestMemStoreRegion(
       SortedMap<Long, Region> regionsBySize,
       Set<Region> excludedRegions,
       boolean checkStoreFileCount) {
@@ -307,7 +307,7 @@ class MemStoreFlusher implements FlushRequester {
     return null;
   }
 
-  private Region getBiggestMemstoreOfRegionReplica(SortedMap<Long, Region> regionsBySize,
+  private Region getBiggestMemStoreOfRegionReplica(SortedMap<Long, Region> regionsBySize,
       Set<Region> excludedRegions) {
     synchronized (regionsInQueue) {
       for (Region region : regionsBySize.values()) {
@@ -588,19 +588,19 @@ class MemStoreFlusher implements FlushRequester {
               startTime = EnvironmentEdgeManager.currentTime();
               if (!server.getRegionServerAccounting().isOffheap()) {
                 logMsg("global memstore heapsize",
-                    server.getRegionServerAccounting().getGlobalMemstoreHeapSize(),
-                    server.getRegionServerAccounting().getGlobalMemstoreLimit());
+                    server.getRegionServerAccounting().getGlobalMemStoreHeapSize(),
+                    server.getRegionServerAccounting().getGlobalMemStoreLimit());
               } else {
                 switch (flushType) {
                 case ABOVE_OFFHEAP_HIGHER_MARK:
                   logMsg("the global offheap memstore datasize",
-                      server.getRegionServerAccounting().getGlobalMemstoreDataSize(),
-                      server.getRegionServerAccounting().getGlobalMemstoreLimit());
+                      server.getRegionServerAccounting().getGlobalMemStoreDataSize(),
+                      server.getRegionServerAccounting().getGlobalMemStoreLimit());
                   break;
                 case ABOVE_ONHEAP_HIGHER_MARK:
                   logMsg("global memstore heapsize",
-                      server.getRegionServerAccounting().getGlobalMemstoreHeapSize(),
-                      server.getRegionServerAccounting().getGlobalOnHeapMemstoreLimit());
+                      server.getRegionServerAccounting().getGlobalMemStoreHeapSize(),
+                      server.getRegionServerAccounting().getGlobalOnHeapMemStoreLimit());
                   break;
                 default:
                   break;
@@ -691,8 +691,8 @@ class MemStoreFlusher implements FlushRequester {
    * @param globalMemStoreSize
    */
   @Override
-  public void setGlobalMemstoreLimit(long globalMemStoreSize) {
-    this.server.getRegionServerAccounting().setGlobalMemstoreLimits(globalMemStoreSize);
+  public void setGlobalMemStoreLimit(long globalMemStoreSize) {
+    this.server.getRegionServerAccounting().setGlobalMemStoreLimits(globalMemStoreSize);
     reclaimMemStoreMemory();
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
new file mode 100644
index 0000000..a588b20
--- /dev/null
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSize.java
@@ -0,0 +1,107 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.regionserver;
+
+import org.apache.yetus.audience.InterfaceAudience;
+
+/**
+ * Wraps the data size part and total heap space occupied by the memstore.
+ */
+@InterfaceAudience.Private
+public class MemStoreSize {
+
+  // 'dataSize' tracks the Cell's data bytes size alone (Key bytes, value bytes). A cell's data can
+  // be in on heap or off heap area depending on the MSLAB and its configuration to be using on heap
+  // or off heap LABs
+  private long dataSize;
+  // 'heapSize' tracks all Cell's heap size occupancy. This will include Cell POJO heap overhead.
+  // When Cells in on heap area, this will include the cells data size as well.
+  private long heapSize;
+  final private boolean isEmpty;
+
+  public MemStoreSize() {
+    dataSize = 0;
+    heapSize = 0;
+    isEmpty = false;
+  }
+
+  public MemStoreSize(boolean isEmpty) {
+    dataSize = 0;
+    heapSize = 0;
+    this.isEmpty = isEmpty;
+  }
+
+  public boolean isEmpty() {
+    return isEmpty;
+  }
+
+  public MemStoreSize(long dataSize, long heapSize) {
+    this.dataSize = dataSize;
+    this.heapSize = heapSize;
+    this.isEmpty = false;
+  }
+
+  public void incMemStoreSize(long dataSizeDelta, long heapSizeDelta) {
+    this.dataSize += dataSizeDelta;
+    this.heapSize += heapSizeDelta;
+  }
+
+  public void incMemStoreSize(MemStoreSize delta) {
+    this.dataSize += delta.dataSize;
+    this.heapSize += delta.heapSize;
+  }
+
+  public void decMemStoreSize(long dataSizeDelta, long heapSizeDelta) {
+    this.dataSize -= dataSizeDelta;
+    this.heapSize -= heapSizeDelta;
+  }
+
+  public void decMemStoreSize(MemStoreSize delta) {
+    this.dataSize -= delta.dataSize;
+    this.heapSize -= delta.heapSize;
+  }
+
+  public long getDataSize() {
+    return isEmpty ? 0 : dataSize;
+  }
+
+  public long getHeapSize() {
+    return isEmpty ? 0 : heapSize;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj == null || !(obj instanceof MemStoreSize)) {
+      return false;
+    }
+    MemStoreSize other = (MemStoreSize) obj;
+    return this.dataSize == other.dataSize && this.heapSize == other.heapSize;
+  }
+
+  @Override
+  public int hashCode() {
+    long h = 13 * this.dataSize;
+    h = h + 14 * this.heapSize;
+    return (int) h;
+  }
+
+  @Override
+  public String toString() {
+    return "dataSize=" + this.dataSize + " , heapSize=" + this.heapSize;
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemstoreSize.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemstoreSize.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemstoreSize.java
deleted file mode 100644
index 8693598..0000000
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemstoreSize.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hbase.regionserver;
-
-import org.apache.yetus.audience.InterfaceAudience;
-
-/**
- * Wraps the data size part and total heap space occupied by the memstore.
- */
-@InterfaceAudience.Private
-public class MemstoreSize {
-
-  // 'dataSize' tracks the Cell's data bytes size alone (Key bytes, value bytes). A cell's data can
-  // be in on heap or off heap area depending on the MSLAB and its configuration to be using on heap
-  // or off heap LABs
-  private long dataSize;
-  // 'heapSize' tracks all Cell's heap size occupancy. This will include Cell POJO heap overhead.
-  // When Cells in on heap area, this will include the cells data size as well.
-  private long heapSize;
-  final private boolean isEmpty;
-
-  public MemstoreSize() {
-    dataSize = 0;
-    heapSize = 0;
-    isEmpty = false;
-  }
-
-  public MemstoreSize(boolean isEmpty) {
-    dataSize = 0;
-    heapSize = 0;
-    this.isEmpty = isEmpty;
-  }
-
-  public boolean isEmpty() {
-    return isEmpty;
-  }
-
-  public MemstoreSize(long dataSize, long heapSize) {
-    this.dataSize = dataSize;
-    this.heapSize = heapSize;
-    this.isEmpty = false;
-  }
-
-  public void incMemstoreSize(long dataSizeDelta, long heapSizeDelta) {
-    this.dataSize += dataSizeDelta;
-    this.heapSize += heapSizeDelta;
-  }
-
-  public void incMemstoreSize(MemstoreSize delta) {
-    this.dataSize += delta.dataSize;
-    this.heapSize += delta.heapSize;
-  }
-
-  public void decMemstoreSize(long dataSizeDelta, long heapSizeDelta) {
-    this.dataSize -= dataSizeDelta;
-    this.heapSize -= heapSizeDelta;
-  }
-
-  public void decMemstoreSize(MemstoreSize delta) {
-    this.dataSize -= delta.dataSize;
-    this.heapSize -= delta.heapSize;
-  }
-
-  public long getDataSize() {
-    return isEmpty ? 0 : dataSize;
-  }
-
-  public long getHeapSize() {
-    return isEmpty ? 0 : heapSize;
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (obj == null || !(obj instanceof MemstoreSize)) {
-      return false;
-    }
-    MemstoreSize other = (MemstoreSize) obj;
-    return this.dataSize == other.dataSize && this.heapSize == other.heapSize;
-  }
-
-  @Override
-  public int hashCode() {
-    long h = 13 * this.dataSize;
-    h = h + 14 * this.heapSize;
-    return (int) h;
-  }
-
-  @Override
-  public String toString() {
-    return "dataSize=" + this.dataSize + " , heapSize=" + this.heapSize;
-  }
-}

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServer.java
index 00ca8ec..1d0a899 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServer.java
@@ -148,7 +148,7 @@ public class MetricsRegionServer {
 
   public void updateFlush(long t, long memstoreSize, long fileSize) {
     serverSource.updateFlushTime(t);
-    serverSource.updateFlushMemstoreSize(memstoreSize);
+    serverSource.updateFlushMemStoreSize(memstoreSize);
     serverSource.updateFlushOutputSize(fileSize);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
index a99dcd6..a7feb94 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java
@@ -284,8 +284,8 @@ class MetricsRegionServerWrapperImpl
   }
 
   @Override
-  public long getMemstoreLimit() {
-	  return this.regionServer.getRegionServerAccounting().getGlobalMemstoreLimit();
+  public long getMemStoreLimit() {
+    return this.regionServer.getRegionServerAccounting().getGlobalMemStoreLimit();
   }
 
   @Override
@@ -458,7 +458,7 @@ class MetricsRegionServerWrapperImpl
   public long getNumStores() {
     return numStores;
   }
-  
+
   @Override
   public long getNumWALFiles() {
     return numWALFiles;
@@ -473,7 +473,7 @@ class MetricsRegionServerWrapperImpl
   public long getNumWALSlowAppend() {
     return metricsWALSource.getSlowAppendCount();
   }
-  
+
   @Override
   public long getNumStoreFiles() {
     return numStoreFiles;
@@ -500,7 +500,7 @@ class MetricsRegionServerWrapperImpl
   }
 
   @Override
-  public long getMemstoreSize() {
+  public long getMemStoreSize() {
     return memstoreSize;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java
index 24e1ae5..7f37bbf 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionWrapperImpl.java
@@ -110,7 +110,7 @@ public class MetricsRegionWrapperImpl implements MetricsRegionWrapper, Closeable
   }
 
   @Override
-  public long getMemstoreSize() {
+  public long getMemStoreSize() {
     return memstoreSize;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableWrapperAggregateImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableWrapperAggregateImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableWrapperAggregateImpl.java
index 4eea146..10656fe 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableWrapperAggregateImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableWrapperAggregateImpl.java
@@ -72,9 +72,9 @@ public class MetricsTableWrapperAggregateImpl implements MetricsTableWrapperAggr
         for (Store store : r.getStores()) {
           tempStorefilesSize += store.getStorefilesSize();
         }
-        metricsTable.setMemstoresSize(metricsTable.getMemstoresSize() + r.getMemstoreSize());
+        metricsTable.setMemStoresSize(metricsTable.getMemStoresSize() + r.getMemStoreSize());
         metricsTable.setStoreFilesSize(metricsTable.getStoreFilesSize() + tempStorefilesSize);
-        metricsTable.setTableSize(metricsTable.getMemstoresSize() + metricsTable.getStoreFilesSize());
+        metricsTable.setTableSize(metricsTable.getMemStoresSize() + metricsTable.getStoreFilesSize());
         metricsTable.setReadRequestsCount(metricsTable.getReadRequestsCount() + r.getReadRequestsCount());
         metricsTable.setWriteRequestsCount(metricsTable.getWriteRequestsCount() + r.getWriteRequestsCount());
         metricsTable.setTotalRequestsCount(metricsTable.getReadRequestsCount() + metricsTable.getWriteRequestsCount());
@@ -133,12 +133,12 @@ public class MetricsTableWrapperAggregateImpl implements MetricsTableWrapperAggr
   }
 
   @Override
-  public long getMemstoresSize(String table) {
+  public long getMemStoresSize(String table) {
     MetricsTableValues metricsTable = metricsTableMap.get(TableName.valueOf(table));
     if (metricsTable == null)
       return 0;
     else
-      return metricsTable.getMemstoresSize();
+      return metricsTable.getMemStoresSize();
   }
 
   @Override
@@ -197,11 +197,11 @@ public class MetricsTableWrapperAggregateImpl implements MetricsTableWrapperAggr
       this.writeRequestsCount = writeRequestsCount;
     }
 
-    public long getMemstoresSize() {
+    public long getMemStoresSize() {
       return memstoresSize;
     }
 
-    public void setMemstoresSize(long memstoresSize) {
+    public void setMemStoresSize(long memstoresSize) {
       this.memstoresSize = memstoresSize;
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
index ea8dfde..856f40e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
@@ -51,11 +51,11 @@ public class MutableSegment extends Segment {
    * @param mslabUsed whether using MSLAB
    * @param memstoreSize
    */
-  public void add(Cell cell, boolean mslabUsed, MemstoreSize memstoreSize) {
+  public void add(Cell cell, boolean mslabUsed, MemStoreSize memstoreSize) {
     internalAdd(cell, mslabUsed, memstoreSize);
   }
 
-  public void upsert(Cell cell, long readpoint, MemstoreSize memstoreSize) {
+  public void upsert(Cell cell, long readpoint, MemStoreSize memstoreSize) {
     internalAdd(cell, false, memstoreSize);
 
     // Get the Cells for the row/family/qualifier regardless of timestamp.
@@ -89,7 +89,7 @@ public class MutableSegment extends Segment {
             long heapSize = heapSizeChange(cur, true);
             this.incSize(-cellLen, -heapSize);
             if (memstoreSize != null) {
-              memstoreSize.decMemstoreSize(cellLen, heapSize);
+              memstoreSize.decMemStoreSize(cellLen, heapSize);
             }
             it.remove();
           } else {

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java
index f410e57..e3ba2fa 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java
@@ -211,7 +211,7 @@ public interface Region extends ConfigurationObserver {
    *         the memstores of this Region. Means size in bytes for key, value and tags within Cells.
    *         It wont consider any java heap overhead for the cell objects or any other.
    */
-  long getMemstoreSize();
+  long getMemStoreSize();
 
   /** @return store services for this region, to access services required by store level needs */
   RegionServicesForStores getRegionServicesForStores();

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerAccounting.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerAccounting.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerAccounting.java
index bd8ff17..8d1656f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerAccounting.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerAccounting.java
@@ -46,7 +46,7 @@ public class RegionServerAccounting {
 
   // Store the edits size during replaying WAL. Use this to roll back the
   // global memstore size once a region opening failed.
-  private final ConcurrentMap<byte[], MemstoreSize> replayEditsPerRegion =
+  private final ConcurrentMap<byte[], MemStoreSize> replayEditsPerRegion =
     new ConcurrentSkipListMap<>(Bytes.BYTES_COMPARATOR);
 
   private long globalMemStoreLimit;
@@ -57,7 +57,7 @@ public class RegionServerAccounting {
   private long globalOnHeapMemstoreLimitLowMark;
 
   public RegionServerAccounting(Configuration conf) {
-    Pair<Long, MemoryType> globalMemstoreSizePair = MemorySizeUtil.getGlobalMemstoreSize(conf);
+    Pair<Long, MemoryType> globalMemstoreSizePair = MemorySizeUtil.getGlobalMemStoreSize(conf);
     this.globalMemStoreLimit = globalMemstoreSizePair.getFirst();
     this.memType = globalMemstoreSizePair.getSecond();
     this.globalMemStoreLimitLowMarkPercent =
@@ -73,21 +73,21 @@ public class RegionServerAccounting {
     // "hbase.regionserver.global.memstore.lowerLimit". Can get rid of this boolean passing then.
     this.globalMemStoreLimitLowMark =
         (long) (this.globalMemStoreLimit * this.globalMemStoreLimitLowMarkPercent);
-    this.globalOnHeapMemstoreLimit = MemorySizeUtil.getOnheapGlobalMemstoreSize(conf);
+    this.globalOnHeapMemstoreLimit = MemorySizeUtil.getOnheapGlobalMemStoreSize(conf);
     this.globalOnHeapMemstoreLimitLowMark =
         (long) (this.globalOnHeapMemstoreLimit * this.globalMemStoreLimitLowMarkPercent);
   }
 
-  long getGlobalMemstoreLimit() {
+  long getGlobalMemStoreLimit() {
     return this.globalMemStoreLimit;
   }
 
-  long getGlobalOnHeapMemstoreLimit() {
+  long getGlobalOnHeapMemStoreLimit() {
     return this.globalOnHeapMemstoreLimit;
   }
 
   // Called by the tuners.
-  void setGlobalMemstoreLimits(long newGlobalMemstoreLimit) {
+  void setGlobalMemStoreLimits(long newGlobalMemstoreLimit) {
     if (this.memType == MemoryType.HEAP) {
       this.globalMemStoreLimit = newGlobalMemstoreLimit;
       this.globalMemStoreLimitLowMark =
@@ -103,38 +103,38 @@ public class RegionServerAccounting {
     return this.memType == MemoryType.NON_HEAP;
   }
 
-  long getGlobalMemstoreLimitLowMark() {
+  long getGlobalMemStoreLimitLowMark() {
     return this.globalMemStoreLimitLowMark;
   }
 
-  float getGlobalMemstoreLimitLowMarkPercent() {
+  float getGlobalMemStoreLimitLowMarkPercent() {
     return this.globalMemStoreLimitLowMarkPercent;
   }
 
   /**
    * @return the global Memstore data size in the RegionServer
    */
-  public long getGlobalMemstoreDataSize() {
+  public long getGlobalMemStoreDataSize() {
     return globalMemstoreDataSize.sum();
   }
 
   /**
    * @return the global memstore heap size in the RegionServer
    */
-  public long getGlobalMemstoreHeapSize() {
+  public long getGlobalMemStoreHeapSize() {
     return this.globalMemstoreHeapSize.sum();
   }
 
   /**
-   * @param memStoreSize the Memstore size will be added to 
-   *        the global Memstore size 
+   * @param memStoreSize the Memstore size will be added to
+   *        the global Memstore size
    */
-  public void incGlobalMemstoreSize(MemstoreSize memStoreSize) {
+  public void incGlobalMemStoreSize(MemStoreSize memStoreSize) {
     globalMemstoreDataSize.add(memStoreSize.getDataSize());
     globalMemstoreHeapSize.add(memStoreSize.getHeapSize());
   }
 
-  public void decGlobalMemstoreSize(MemstoreSize memStoreSize) {
+  public void decGlobalMemStoreSize(MemStoreSize memStoreSize) {
     globalMemstoreDataSize.add(-memStoreSize.getDataSize());
     globalMemstoreHeapSize.add(-memStoreSize.getHeapSize());
   }
@@ -147,7 +147,7 @@ public class RegionServerAccounting {
     // for onheap memstore we check if the global memstore size and the
     // global heap overhead is greater than the global memstore limit
     if (memType == MemoryType.HEAP) {
-      if (getGlobalMemstoreHeapSize() >= globalMemStoreLimit) {
+      if (getGlobalMemStoreHeapSize() >= globalMemStoreLimit) {
         return FlushType.ABOVE_ONHEAP_HIGHER_MARK;
       }
     } else {
@@ -158,11 +158,11 @@ public class RegionServerAccounting {
       // global memstore limit 'hbase.regionserver.global.memstore.size'.
       // We do this to avoid OOME incase of scenarios where the heap is occupied with
       // lot of onheap references to the cells in memstore
-      if (getGlobalMemstoreDataSize() >= globalMemStoreLimit) {
+      if (getGlobalMemStoreDataSize() >= globalMemStoreLimit) {
         // Indicates that global memstore size is above the configured
         // 'hbase.regionserver.offheap.global.memstore.size'
         return FlushType.ABOVE_OFFHEAP_HIGHER_MARK;
-      } else if (getGlobalMemstoreHeapSize() >= this.globalOnHeapMemstoreLimit) {
+      } else if (getGlobalMemStoreHeapSize() >= this.globalOnHeapMemstoreLimit) {
         // Indicates that the offheap memstore's heap overhead is greater than the
         // configured 'hbase.regionserver.global.memstore.size'.
         return FlushType.ABOVE_ONHEAP_HIGHER_MARK;
@@ -178,15 +178,15 @@ public class RegionServerAccounting {
     // for onheap memstore we check if the global memstore size and the
     // global heap overhead is greater than the global memstore lower mark limit
     if (memType == MemoryType.HEAP) {
-      if (getGlobalMemstoreHeapSize() >= globalMemStoreLimitLowMark) {
+      if (getGlobalMemStoreHeapSize() >= globalMemStoreLimitLowMark) {
         return FlushType.ABOVE_ONHEAP_LOWER_MARK;
       }
     } else {
-      if (getGlobalMemstoreDataSize() >= globalMemStoreLimitLowMark) {
+      if (getGlobalMemStoreDataSize() >= globalMemStoreLimitLowMark) {
         // Indicates that the offheap memstore's data size is greater than the global memstore
         // lower limit
         return FlushType.ABOVE_OFFHEAP_LOWER_MARK;
-      } else if (getGlobalMemstoreHeapSize() >= globalOnHeapMemstoreLimitLowMark) {
+      } else if (getGlobalMemStoreHeapSize() >= globalOnHeapMemstoreLimitLowMark) {
         // Indicates that the offheap memstore's heap overhead is greater than the global memstore
         // onheap lower limit
         return FlushType.ABOVE_ONHEAP_LOWER_MARK;
@@ -202,10 +202,10 @@ public class RegionServerAccounting {
    */
   public double getFlushPressure() {
     if (memType == MemoryType.HEAP) {
-      return (getGlobalMemstoreHeapSize()) * 1.0 / globalMemStoreLimitLowMark;
+      return (getGlobalMemStoreHeapSize()) * 1.0 / globalMemStoreLimitLowMark;
     } else {
-      return Math.max(getGlobalMemstoreDataSize() * 1.0 / globalMemStoreLimitLowMark,
-          getGlobalMemstoreHeapSize() * 1.0 / globalOnHeapMemstoreLimitLowMark);
+      return Math.max(getGlobalMemStoreDataSize() * 1.0 / globalMemStoreLimitLowMark,
+          getGlobalMemStoreHeapSize() * 1.0 / globalOnHeapMemstoreLimitLowMark);
     }
   }
 
@@ -215,37 +215,37 @@ public class RegionServerAccounting {
    * @param regionName region name.
    * @param memStoreSize the Memstore size will be added to replayEditsPerRegion.
    */
-  public void addRegionReplayEditsSize(byte[] regionName, MemstoreSize memStoreSize) {
-    MemstoreSize replayEdistsSize = replayEditsPerRegion.get(regionName);
-    // All ops on the same MemstoreSize object is going to be done by single thread, sequentially
+  public void addRegionReplayEditsSize(byte[] regionName, MemStoreSize memStoreSize) {
+    MemStoreSize replayEdistsSize = replayEditsPerRegion.get(regionName);
+    // All ops on the same MemStoreSize object is going to be done by single thread, sequentially
     // only. First calls to this method to increment the per region reply edits size and then call
     // to either rollbackRegionReplayEditsSize or clearRegionReplayEditsSize as per the result of
     // the region open operation. No need to handle multi thread issues on one region's entry in
     // this Map.
     if (replayEdistsSize == null) {
-      replayEdistsSize = new MemstoreSize();
+      replayEdistsSize = new MemStoreSize();
       replayEditsPerRegion.put(regionName, replayEdistsSize);
     }
-    replayEdistsSize.incMemstoreSize(memStoreSize);
+    replayEdistsSize.incMemStoreSize(memStoreSize);
   }
 
   /**
    * Roll back the global MemStore size for a specified region when this region
    * can't be opened.
-   * 
+   *
    * @param regionName the region which could not open.
    */
   public void rollbackRegionReplayEditsSize(byte[] regionName) {
-    MemstoreSize replayEditsSize = replayEditsPerRegion.get(regionName);
+    MemStoreSize replayEditsSize = replayEditsPerRegion.get(regionName);
     if (replayEditsSize != null) {
       clearRegionReplayEditsSize(regionName);
-      decGlobalMemstoreSize(replayEditsSize);
+      decGlobalMemStoreSize(replayEditsSize);
     }
   }
 
   /**
    * Clear a region from replayEditsPerRegion.
-   * 
+   *
    * @param regionName region name.
    */
   public void clearRegionReplayEditsSize(byte[] regionName) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServicesForStores.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServicesForStores.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServicesForStores.java
index aea92f8..61815a5 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServicesForStores.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServicesForStores.java
@@ -27,6 +27,8 @@ import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.wal.WAL;
 import org.apache.yetus.audience.InterfaceAudience;
 
+import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
+
 /**
  * Services a Store needs from a Region.
  * RegionServicesForStores class is the interface through which memstore access services at the
@@ -63,8 +65,8 @@ public class RegionServicesForStores {
     region.unblockUpdates();
   }
 
-  public void addMemstoreSize(MemstoreSize size) {
-    region.addAndGetMemstoreSize(size);
+  public void addMemStoreSize(MemStoreSize size) {
+    region.addAndGetMemStoreSize(size);
   }
 
   public RegionInfo getRegionInfo() {
@@ -77,16 +79,16 @@ public class RegionServicesForStores {
 
   public ThreadPoolExecutor getInMemoryCompactionPool() { return INMEMORY_COMPACTION_POOL; }
 
-  public long getMemstoreFlushSize() {
-    return region.getMemstoreFlushSize();
+  public long getMemStoreFlushSize() {
+    return region.getMemStoreFlushSize();
   }
 
   public int getNumStores() {
     return region.getTableDescriptor().getColumnFamilyCount();
   }
 
-  // methods for tests
-  long getMemstoreSize() {
-    return region.getMemstoreSize();
+  @VisibleForTesting
+  long getMemStoreSize() {
+    return region.getMemStoreSize();
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
index 0b5d81a..23b386f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
@@ -275,13 +275,13 @@ public abstract class Segment {
     return comparator;
   }
 
-  protected void internalAdd(Cell cell, boolean mslabUsed, MemstoreSize memstoreSize) {
+  protected void internalAdd(Cell cell, boolean mslabUsed, MemStoreSize memstoreSize) {
     boolean succ = getCellSet().add(cell);
     updateMetaInfo(cell, succ, mslabUsed, memstoreSize);
   }
 
   protected void updateMetaInfo(Cell cellToAdd, boolean succ, boolean mslabUsed,
-      MemstoreSize memstoreSize) {
+      MemStoreSize memstoreSize) {
     long cellSize = 0;
     // If there's already a same cell in the CellSet and we are using MSLAB, we must count in the
     // MSLAB allocation size as well, or else there will be memory leak (occupied heap size larger
@@ -292,7 +292,7 @@ public abstract class Segment {
     long heapSize = heapSizeChange(cellToAdd, succ);
     incSize(cellSize, heapSize);
     if (memstoreSize != null) {
-      memstoreSize.incMemstoreSize(cellSize, heapSize);
+      memstoreSize.incMemStoreSize(cellSize, heapSize);
     }
     getTimeRangeTracker().includeTimestamp(cellToAdd);
     minSequenceId = Math.min(minSequenceId, cellToAdd.getSequenceId());
@@ -305,7 +305,7 @@ public abstract class Segment {
     }
   }
 
-  protected void updateMetaInfo(Cell cellToAdd, boolean succ, MemstoreSize memstoreSize) {
+  protected void updateMetaInfo(Cell cellToAdd, boolean succ, MemStoreSize memstoreSize) {
     updateMetaInfo(cellToAdd, succ, (getMemStoreLAB()!=null), memstoreSize);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentFactory.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentFactory.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentFactory.java
index d609e6f..63d1baa 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentFactory.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentFactory.java
@@ -18,7 +18,6 @@
  */
 package org.apache.hadoop.hbase.regionserver;
 
-import org.apache.hadoop.hbase.shaded.com.google.common.base.Preconditions;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.yetus.audience.InterfaceAudience;
@@ -96,7 +95,7 @@ public final class SegmentFactory {
   // create flat immutable segment from non-flat immutable segment
   // for flattening
   public ImmutableSegment createImmutableSegmentByFlattening(
-      CSLMImmutableSegment segment, CompactingMemStore.IndexType idxType, MemstoreSize memstoreSize) {
+      CSLMImmutableSegment segment, CompactingMemStore.IndexType idxType, MemStoreSize memstoreSize) {
     ImmutableSegment res = null;
     switch (idxType) {
     case CHUNK_MAP:

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
index 9c01301..6f6f31c 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
@@ -97,19 +97,19 @@ public interface Store {
   /**
    * @return The size of this store's memstore.
    */
-  MemstoreSize getMemStoreSize();
+  MemStoreSize getMemStoreSize();
 
   /**
    * @return The amount of memory we could flush from this memstore; usually this is equal to
    * {@link #getMemStoreSize()} unless we are carrying snapshots and then it will be the size of
    * outstanding snapshots.
    */
-  MemstoreSize getFlushableSize();
+  MemStoreSize getFlushableSize();
 
   /**
    * @return size of the memstore snapshot
    */
-  MemstoreSize getSnapshotSize();
+  MemStoreSize getSnapshotSize();
 
   ColumnFamilyDescriptor getColumnFamilyDescriptor();
 
@@ -121,7 +121,7 @@ public interface Store {
   /**
    * @return The maximum memstoreTS in all store files.
    */
-  OptionalLong getMaxMemstoreTS();
+  OptionalLong getMaxMemStoreTS();
 
   /** @return aggregate size of all HStores used in the last compaction */
   long getLastCompactSize();
@@ -289,5 +289,5 @@ public interface Store {
   /**
    * @return true if the memstore may need some extra memory space
    */
-  boolean isSloppyMemstore();
+  boolean isSloppyMemStore();
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreConfigInformation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreConfigInformation.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreConfigInformation.java
index 63493b7..f9cce7f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreConfigInformation.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreConfigInformation.java
@@ -35,7 +35,7 @@ public interface StoreConfigInformation {
    */
   // TODO: Why is this in here?  It should be in Store and it should return the Store flush size,
   // not the Regions.  St.Ack
-  long getMemstoreFlushSize();
+  long getMemStoreFlushSize();
 
   /**
    * @return Gets the cf-specific time-to-live for store files.

http://git-wip-us.apache.org/repos/asf/hbase/blob/d35d8376/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
index 0097bd7..c11c8a3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
@@ -59,7 +59,7 @@ public interface StoreFile {
   /**
    * Get max of the MemstoreTS in the KV's in this store file.
    */
-  long getMaxMemstoreTS();
+  long getMaxMemStoreTS();
 
   /**
    * @return Path or null if this StoreFile was made with a Stream.


Mime
View raw message