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 fa1fa86dab6..a325eb6b471 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; } } 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 3010083edca..d98e281ad98 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()); } }