HBASE-17313 Add BufferedMutatorParams#clone method (Joep Rottinghuis); AMENDMENT -- ADD MISSING FIELD
This commit is contained in:
parent
a73b0b3e6d
commit
a5a48dbd23
|
@ -138,6 +138,7 @@ public class BufferedMutatorParams {
|
||||||
clone.maxKeyValueSize = maxKeyValueSize;
|
clone.maxKeyValueSize = maxKeyValueSize;
|
||||||
clone.pool = this.pool;
|
clone.pool = this.pool;
|
||||||
clone.listener = this.listener;
|
clone.listener = this.listener;
|
||||||
|
clone.implementationClassName = this.implementationClassName;
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,18 +121,24 @@ public class TestBufferedMutatorParams {
|
||||||
|
|
||||||
BufferedMutator.ExceptionListener listener = new MockExceptionListener();
|
BufferedMutator.ExceptionListener listener = new MockExceptionListener();
|
||||||
bmp.writeBufferSize(17).maxKeyValueSize(13).pool(pool).listener(listener);
|
bmp.writeBufferSize(17).maxKeyValueSize(13).pool(pool).listener(listener);
|
||||||
|
bmp.implementationClassName("someClassName");
|
||||||
BufferedMutatorParams clone = bmp.clone();
|
BufferedMutatorParams clone = bmp.clone();
|
||||||
|
|
||||||
// Confirm some literals
|
// Confirm some literals
|
||||||
assertEquals("SomeTableName", clone.getTableName().toString());
|
assertEquals("SomeTableName", clone.getTableName().toString());
|
||||||
assertEquals(17, clone.getWriteBufferSize());
|
assertEquals(17, clone.getWriteBufferSize());
|
||||||
assertEquals(13, clone.getMaxKeyValueSize());
|
assertEquals(13, clone.getMaxKeyValueSize());
|
||||||
|
assertEquals("someClassName", clone.getImplementationClassName());
|
||||||
|
|
||||||
cloneTest(bmp, clone);
|
cloneTest(bmp, clone);
|
||||||
|
|
||||||
BufferedMutatorParams cloneWars = clone.clone();
|
BufferedMutatorParams cloneWars = clone.clone();
|
||||||
cloneTest(clone, cloneWars);
|
cloneTest(clone, cloneWars);
|
||||||
cloneTest(bmp, 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());
|
assertEquals(some.getMaxKeyValueSize(), clone.getMaxKeyValueSize());
|
||||||
assertTrue(some.getListener() == clone.getListener());
|
assertTrue(some.getListener() == clone.getListener());
|
||||||
assertTrue(some.getPool() == clone.getPool());
|
assertTrue(some.getPool() == clone.getPool());
|
||||||
|
assertEquals(some.getImplementationClassName(), clone.getImplementationClassName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue