public abstract class KeyColumnValueStoreTest extends AbstractKCVSTest
| Modifier and Type | Field and Description |
|---|---|
KeyColumnValueStoreManager |
manager |
org.junit.rules.TestName |
name |
KeyColumnValueStore |
store |
protected String |
storeName |
StoreTransaction |
tx |
times| Constructor and Description |
|---|
KeyColumnValueStoreTest() |
getConsistentTxConfig, getTxConfigpublic org.junit.rules.TestName name
protected String storeName
public KeyColumnValueStoreManager manager
public StoreTransaction tx
public KeyColumnValueStore store
public abstract KeyColumnValueStoreManager openStorageManager() throws BackendException
BackendExceptionpublic void open()
throws BackendException
BackendExceptionpublic StoreTransaction startTx() throws BackendException
BackendExceptionpublic StoreFeatures storeFeatures()
public void clopen()
throws BackendException
BackendExceptionpublic void close()
throws BackendException
BackendExceptionpublic void newTx()
throws BackendException
BackendExceptionpublic void createDatabase()
public String[][] generateValues()
public void loadValues(String[][] values) throws BackendException
BackendExceptionpublic void loadValues(KeyColumnValueStore store, String[][] values) throws BackendException
BackendExceptionpublic void loadValues(String[][] values, int shiftEveryNthRow, int shiftSliceLength) throws BackendException
BackendExceptionpublic void loadValues(KeyColumnValueStore store, String[][] values, int shiftEveryNthRow, int shiftSliceLength) throws BackendException
BackendExceptionpublic void loadLowerTriangularValues(int dimension,
int offset)
throws BackendException
k in the half-open long interval
[offset, offset + dimension -1). For each k, iterate over
the column values c in the half-open integer interval
[offset, k].
For each key-column coordinate specified by a (k, c pair in the
iteration, write a value one byte long with all bits set (unsigned -1 or
signed 255).dimension - size of loaded data (must be positive)offset - offset (must be positive)StorageException - unexpected failureBackendExceptionpublic Set<KeyColumn> deleteValues(int every) throws BackendException
BackendExceptionpublic Set<Integer> deleteKeys(int every) throws BackendException
BackendExceptionpublic void checkKeys(Set<Integer> removed) throws BackendException
BackendExceptionpublic void checkValueExistence(String[][] values) throws BackendException
BackendExceptionpublic void checkValueExistence(String[][] values, Set<KeyColumn> removed) throws BackendException
BackendExceptionpublic void checkValues(String[][] values) throws BackendException
BackendExceptionpublic void checkValues(String[][] values, Set<KeyColumn> removed) throws BackendException
BackendExceptionpublic void storeAndRetrieve()
throws BackendException
BackendExceptionpublic void compareStores()
throws BackendException
BackendExceptionpublic void storeAndRetrievePerformance()
throws BackendException
BackendExceptionpublic void storeAndRetrieveWithClosing()
throws BackendException
BackendExceptionpublic void deleteColumnsTest1()
throws BackendException
BackendExceptionpublic void deleteColumnsTest2()
throws BackendException
BackendExceptionpublic void deleteKeys()
throws BackendException
BackendExceptionpublic void scanTest()
throws BackendException
idOffset is KeyValueStoreUtil.idOffset. Note that
identical columns appear on every key. The loaded values are randomly
generated strings converted to bytes.
Calls the store's supported getKeys method depending on whether
it supports ordered or unordered scan. This logic is delegated to
KCVSUtil.getKeys(KeyColumnValueStore, StoreFeatures, int, int, StoreTransaction)
. That method uses all-zero and all-one buffers for the key and column
limits and retrieves every key.
This method does nothing and returns immediately if the store supports no
scans.BackendExceptionpublic void testOrderedGetKeysRespectsKeyLimit()
throws BackendException
KeyColumnValueStore.getKeys(KeyRangeQuery, StoreTransaction)
treats the lower key bound as inclusive and the upper key bound as
exclusive. Verify that keys less than the start and greater than or equal
to the end containing matching columns are not returned.BackendExceptionpublic void testGetKeysColumnSlicesSimple()
throws BackendException
getKeys methods respect column slice bounds. Uses
nearly the same data as testOrderedGetKeysRespectsKeyLimit(),
except that all columns on every 10th row exceed the getKeys
slice limit.
For each row in this test, either all columns match the slice bounds or
all columns fall outside the slice bounds. For this reason, it could be
described as a "coarse-grained" or "simple" test of getKeys's
column bounds checking.BackendExceptionpublic void testGetKeysColumnSlicesOnLowerTriangular()
throws BackendException,
IOException
getKeys with columns slice values chosen to trigger
potential fencepost bugs.
Description of data generated for and queried by this test:
Generate a sequence of keys as unsigned integers, starting at zero. Each
row has as many columns as the key value. The columns are generated in
the same way as the keys. This results in a sort of "lower triangular"
data space, with no values above the diagonal.BackendException - shouldn't happenIOException - shouldn't happenpublic void checkSlice(String[][] values, Set<KeyColumn> removed, int key, int start, int end, int limit) throws BackendException
BackendExceptionpublic void intervalTest1()
throws BackendException
BackendExceptionpublic void intervalTest2()
throws BackendException
BackendExceptionpublic void testConcurrentGetSlice()
throws ExecutionException,
InterruptedException,
BackendException
public void testConcurrentGetSliceAndMutate()
throws BackendException,
ExecutionException,
InterruptedException
public void getNonExistentKeyReturnsNull()
throws Exception
Exceptionpublic void insertingGettingAndDeletingSimpleDataWorks()
throws Exception
Exceptionpublic void getSliceRespectsColumnLimit()
throws Exception
Exceptionpublic void getSliceRespectsAllBoundsInclusionArguments()
throws Exception
Exceptionpublic void containsKeyReturnsTrueOnExtantKey()
throws Exception
Exceptionpublic void containsKeyReturnsFalseOnNonexistentKey()
throws Exception
Exceptionpublic void containsKeyColumnReturnsFalseOnNonexistentInput()
throws Exception
Exceptionpublic void containsKeyColumnReturnsTrueOnExtantInput()
throws Exception
Exceptionpublic void testGetKeysWithSliceQuery()
throws Exception
Exceptionprotected void populateDBWith100Keys(KeyColumnValueStore store) throws Exception
Exceptionprotected void examineGetKeysResults(KeyIterator keyIterator, long startKey, long endKey, int expectedColumns) throws BackendException
BackendExceptionCopyright © 2012–2016. All rights reserved.