hbase git commit: HBASE-19187 Remove option to create on heap bucket cache.

2017-11-10 Thread anoopsamjohn
Repository: hbase
Updated Branches:
  refs/heads/branch-2 30f55f231 -> 3ee76f857


HBASE-19187 Remove option to create on heap bucket cache.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3ee76f85
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3ee76f85
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3ee76f85

Branch: refs/heads/branch-2
Commit: 3ee76f8573387097c896d0611c30504ed7e57cb0
Parents: 30f55f2
Author: anoopsamjohn 
Authored: Sat Nov 11 12:37:18 2017 +0530
Committer: anoopsamjohn 
Committed: Sat Nov 11 12:41:09 2017 +0530

--
 .../hadoop/hbase/util/ByteBufferAllocator.java  |  3 +-
 .../hadoop/hbase/util/ByteBufferArray.java  | 18 +++
 .../src/main/resources/hbase-default.xml|  7 +--
 .../hadoop/hbase/util/TestByteBufferArray.java  | 38 +-
 .../hbase/io/hfile/bucket/BucketCache.java  |  6 +--
 .../io/hfile/bucket/ByteBufferIOEngine.java | 18 ++-
 .../hbase/io/hfile/bucket/FileMmapEngine.java   | 14 ++
 .../hadoop/hbase/io/util/MemorySizeUtil.java| 44 +++-
 .../hbase/regionserver/HeapMemoryManager.java   |  8 ++-
 ...estAvoidCellReferencesIntoShippedBlocks.java |  2 +-
 .../client/TestBlockEvictionFromClient.java |  2 +-
 .../hadoop/hbase/io/hfile/TestCacheConfig.java  |  6 ---
 .../io/hfile/TestScannerFromBucketCache.java| 53 +++-
 .../hbase/io/hfile/bucket/TestBucketCache.java  |  4 +-
 .../io/hfile/bucket/TestBucketWriterThread.java |  3 +-
 .../io/hfile/bucket/TestByteBufferIOEngine.java |  4 +-
 .../regionserver/TestHeapMemoryManager.java | 52 ---
 17 files changed, 57 insertions(+), 225 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/3ee76f85/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
index 8e2ac16..2c5eac8 100644
--- 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
+++ 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
@@ -31,9 +31,8 @@ public interface ByteBufferAllocator {
   /**
* Allocates a bytebuffer
* @param size the size of the bytebuffer
-   * @param directByteBuffer indicator to create a direct bytebuffer
* @return the bytebuffer that is created
* @throws IOException exception thrown if there is an error while creating 
the ByteBuffer
*/
-  ByteBuffer allocate(long size, boolean directByteBuffer) throws IOException;
+  ByteBuffer allocate(long size) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/3ee76f85/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
index d1d5e7d..2715740 100644
--- 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
+++ 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
@@ -59,11 +59,10 @@ public class ByteBufferArray {
* of the array bounds for the last byte(see {@link 
ByteBufferArray#multiple}),
* we will allocate one additional buffer with capacity 0;
* @param capacity total size of the byte buffer array
-   * @param directByteBuffer true if we allocate direct buffer
* @param allocator the ByteBufferAllocator that will create the buffers
* @throws IOException throws IOException if there is an exception thrown by 
the allocator
*/
-  public ByteBufferArray(long capacity, boolean directByteBuffer, 
ByteBufferAllocator allocator)
+  public ByteBufferArray(long capacity, ByteBufferAllocator allocator)
   throws IOException {
 this.bufferSize = DEFAULT_BUFFER_SIZE;
 if (this.bufferSize > (capacity / 16))
@@ -71,13 +70,13 @@ public class ByteBufferArray {
 this.bufferCount = (int) (roundUp(capacity, bufferSize) / bufferSize);
 LOG.info("Allocating buffers total=" + StringUtils.byteDesc(capacity)
 + ", sizePerBuffer=" + StringUtils.byteDesc(bufferSize) + ", count="
-+ bufferCount + ", direct=" + directByteBuffer);
++ bufferCount);
 buffers = new ByteBuffer[bufferCount + 1];
-createBuffers(directByteBuffer, allocator);
+createBuffers(allocator);
   }
 
   @VisibleForTesting
-  void createBuffers(boolean directByteBuffer, ByteBufferAllocator allocator)
+  void 

hbase git commit: HBASE-19187 Remove option to create on heap bucket cache.

2017-11-10 Thread anoopsamjohn
Repository: hbase
Updated Branches:
  refs/heads/master 72270866c -> bff619ef7


HBASE-19187 Remove option to create on heap bucket cache.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bff619ef
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bff619ef
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bff619ef

Branch: refs/heads/master
Commit: bff619ef7b100e8b09f7f5eb0f6e289ca51de096
Parents: 7227086
Author: anoopsamjohn 
Authored: Sat Nov 11 12:37:18 2017 +0530
Committer: anoopsamjohn 
Committed: Sat Nov 11 12:37:18 2017 +0530

--
 .../hadoop/hbase/util/ByteBufferAllocator.java  |  3 +-
 .../hadoop/hbase/util/ByteBufferArray.java  | 18 +++
 .../src/main/resources/hbase-default.xml|  7 +--
 .../hadoop/hbase/util/TestByteBufferArray.java  | 38 +-
 .../hbase/io/hfile/bucket/BucketCache.java  |  6 +--
 .../io/hfile/bucket/ByteBufferIOEngine.java | 18 ++-
 .../hbase/io/hfile/bucket/FileMmapEngine.java   | 14 ++
 .../hadoop/hbase/io/util/MemorySizeUtil.java| 44 +++-
 .../hbase/regionserver/HeapMemoryManager.java   |  8 ++-
 ...estAvoidCellReferencesIntoShippedBlocks.java |  2 +-
 .../client/TestBlockEvictionFromClient.java |  2 +-
 .../hadoop/hbase/io/hfile/TestCacheConfig.java  |  6 ---
 .../io/hfile/TestScannerFromBucketCache.java| 53 +++-
 .../hbase/io/hfile/bucket/TestBucketCache.java  |  4 +-
 .../io/hfile/bucket/TestBucketWriterThread.java |  3 +-
 .../io/hfile/bucket/TestByteBufferIOEngine.java |  4 +-
 .../regionserver/TestHeapMemoryManager.java | 52 ---
 17 files changed, 57 insertions(+), 225 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/bff619ef/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
index 8e2ac16..2c5eac8 100644
--- 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
+++ 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferAllocator.java
@@ -31,9 +31,8 @@ public interface ByteBufferAllocator {
   /**
* Allocates a bytebuffer
* @param size the size of the bytebuffer
-   * @param directByteBuffer indicator to create a direct bytebuffer
* @return the bytebuffer that is created
* @throws IOException exception thrown if there is an error while creating 
the ByteBuffer
*/
-  ByteBuffer allocate(long size, boolean directByteBuffer) throws IOException;
+  ByteBuffer allocate(long size) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/bff619ef/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
--
diff --git 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
index d1d5e7d..2715740 100644
--- 
a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
+++ 
b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferArray.java
@@ -59,11 +59,10 @@ public class ByteBufferArray {
* of the array bounds for the last byte(see {@link 
ByteBufferArray#multiple}),
* we will allocate one additional buffer with capacity 0;
* @param capacity total size of the byte buffer array
-   * @param directByteBuffer true if we allocate direct buffer
* @param allocator the ByteBufferAllocator that will create the buffers
* @throws IOException throws IOException if there is an exception thrown by 
the allocator
*/
-  public ByteBufferArray(long capacity, boolean directByteBuffer, 
ByteBufferAllocator allocator)
+  public ByteBufferArray(long capacity, ByteBufferAllocator allocator)
   throws IOException {
 this.bufferSize = DEFAULT_BUFFER_SIZE;
 if (this.bufferSize > (capacity / 16))
@@ -71,13 +70,13 @@ public class ByteBufferArray {
 this.bufferCount = (int) (roundUp(capacity, bufferSize) / bufferSize);
 LOG.info("Allocating buffers total=" + StringUtils.byteDesc(capacity)
 + ", sizePerBuffer=" + StringUtils.byteDesc(bufferSize) + ", count="
-+ bufferCount + ", direct=" + directByteBuffer);
++ bufferCount);
 buffers = new ByteBuffer[bufferCount + 1];
-createBuffers(directByteBuffer, allocator);
+createBuffers(allocator);
   }
 
   @VisibleForTesting
-  void createBuffers(boolean directByteBuffer, ByteBufferAllocator allocator)
+  void