hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-17313 Add BufferedMutatorParams#clone method (Joep Rottinghuis); AMENDMENT -- ADD MISSING FIELD
Date Wed, 14 Dec 2016 16:15:57 GMT
Repository: hbase
Updated Branches:
  refs/heads/master a73b0b3e6 -> a5a48dbd2


HBASE-17313 Add BufferedMutatorParams#clone method (Joep Rottinghuis); AMENDMENT -- ADD MISSING
FIELD


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

Branch: refs/heads/master
Commit: a5a48dbd23f3dab0f72635b2422f295a667b9ca4
Parents: a73b0b3
Author: Michael Stack <stack@apache.org>
Authored: Wed Dec 14 08:15:47 2016 -0800
Committer: Michael Stack <stack@apache.org>
Committed: Wed Dec 14 08:15:47 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/client/BufferedMutatorParams.java | 1 +
 .../apache/hadoop/hbase/client/TestBufferedMutatorParams.java | 7 +++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/a5a48dbd/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorParams.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorParams.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorParams.java
index fa1fa86..a325eb6 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorParams.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/BufferedMutatorParams.java
@@ -138,6 +138,7 @@ public class BufferedMutatorParams {
     clone.maxKeyValueSize = maxKeyValueSize;
     clone.pool = this.pool;
     clone.listener = this.listener;
+    clone.implementationClassName = this.implementationClassName;
     return clone;
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/a5a48dbd/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutatorParams.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutatorParams.java
b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutatorParams.java
index 3010083..d98e281 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutatorParams.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestBufferedMutatorParams.java
@@ -121,18 +121,24 @@ public class TestBufferedMutatorParams {
 
     BufferedMutator.ExceptionListener listener = new MockExceptionListener();
     bmp.writeBufferSize(17).maxKeyValueSize(13).pool(pool).listener(listener);
+    bmp.implementationClassName("someClassName");
     BufferedMutatorParams clone = bmp.clone();
 
     // Confirm some literals
     assertEquals("SomeTableName", clone.getTableName().toString());
     assertEquals(17, clone.getWriteBufferSize());
     assertEquals(13, clone.getMaxKeyValueSize());
+    assertEquals("someClassName", clone.getImplementationClassName());
 
     cloneTest(bmp, clone);
 
     BufferedMutatorParams cloneWars = clone.clone();
     cloneTest(clone, cloneWars);
     cloneTest(bmp, cloneWars);
+
+    // Mocking with clone leave original unaffected.
+    clone.implementationClassName(null);
+    assertEquals("someClassName", bmp.getImplementationClassName());
   }
 
   /**
@@ -149,6 +155,7 @@ public class TestBufferedMutatorParams {
     assertEquals(some.getMaxKeyValueSize(), clone.getMaxKeyValueSize());
     assertTrue(some.getListener() == clone.getListener());
     assertTrue(some.getPool() == clone.getPool());
+    assertEquals(some.getImplementationClassName(), clone.getImplementationClassName());
   }
 
 }


Mime
View raw message