public abstract class KeyColumnValueStoreTest extends AbstractKCVSTest implements JanusGraphBaseStoreFeaturesTest
| Modifier and Type | Class and Description |
|---|---|
protected class |
KeyColumnValueStoreTest.ConcurrentRandomSliceReader |
| Modifier and Type | Field and Description |
|---|---|
KeyColumnValueStoreManager |
manager |
KeyColumnValueStore |
store |
protected String |
storeName |
static int |
TRIALS |
StoreTransaction |
tx |
times| Constructor and Description |
|---|
KeyColumnValueStoreTest() |
getConsistentTxConfig, getTxConfigpublic static final int TRIALS
protected final String storeName
public KeyColumnValueStoreManager manager
public StoreTransaction tx
public KeyColumnValueStore store
public abstract KeyColumnValueStoreManager openStorageManager() throws BackendException
BackendExceptionpublic void open()
throws BackendException
BackendExceptionpublic StoreFeatures getStoreFeatures()
getStoreFeatures in interface JanusGraphBaseStoreFeaturesTestpublic StoreTransaction startTx() throws BackendException
BackendExceptionpublic StoreFeatures storeFeatures()
public void clopen()
throws BackendException
BackendExceptionpublic void close()
throws BackendException
BackendExceptionpublic void newTx()
throws BackendException
BackendException@Test public void createDatabase()
public String[][] generateValues()
public void loadValues(String[][] values) throws BackendException
BackendExceptionpublic void loadValues(String[][] values, int shiftEveryNthRow, int shiftSliceLength) throws BackendException
BackendExceptionpublic void loadLowerTriangularValues(int dimension,
int offset)
throws BackendException
Iterate over key values 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)BackendException - unexpected failurepublic 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
BackendException@Test
public void storeAndRetrieve()
throws BackendException
BackendExceptionpublic void compareStores()
throws BackendException
BackendException@Test
public void storeAndRetrievePerformance()
throws BackendException
BackendException@Test
public void storeAndRetrieveWithClosing()
throws BackendException
BackendException@Test
public void deleteColumnsTest1()
throws BackendException
BackendException@Test
public void deleteColumnsTest2()
throws BackendException
BackendException@Test
public void deleteKeys()
throws BackendException
BackendException@Test public void deleteNonExistingKeys()
@Test
public 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.
BackendException@Test
public void testOrderedGetKeysRespectsKeyLimit(org.junit.jupiter.api.TestInfo testInfo)
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.BackendException@Test
public void testGetKeysColumnSlicesSimple()
throws BackendException
getKeys methods respect column slice bounds. Uses
nearly the same data as testOrderedGetKeysRespectsKeyLimit(TestInfo),
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.
BackendException@Test
public 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
BackendException@Test
public void intervalTest1()
throws BackendException
BackendException@Test
public void intervalTest2()
throws BackendException
BackendExceptionprotected void checkRandomSlices(String[][] values, Set<KeyColumn> deleted) throws BackendException
BackendException@Test
public void testConcurrentGetSlice()
throws ExecutionException,
InterruptedException,
BackendException
@Test
public void testConcurrentGetSliceAndMutate()
throws BackendException,
ExecutionException,
InterruptedException
protected void testConcurrentStoreOps(boolean deletionEnabled)
throws BackendException,
ExecutionException,
InterruptedException
@Test
public void getNonExistentKeyReturnsNull()
throws Exception
Exception@Test
public void insertingGettingAndDeletingSimpleDataWorks()
throws Exception
Exception@Test
public void getSliceRespectsColumnLimit()
throws Exception
Exception@Test
public void getSliceRespectsAllBoundsInclusionArguments()
throws Exception
Exception@Test
public void containsKeyReturnsTrueOnExtantKey()
throws Exception
Exception@Test
public void containsKeyReturnsFalseOnNonexistentKey()
throws Exception
Exception@Test
public void containsKeyColumnReturnsFalseOnNonexistentInput()
throws Exception
Exception@Test
public void containsKeyColumnReturnsTrueOnExtantInput()
throws Exception
Exception@Test
public void testGetKeysWithSliceQuery(org.junit.jupiter.api.TestInfo testInfo)
throws Exception
Exception@Test
public void testGetKeysWithKeyRange(org.junit.jupiter.api.TestInfo testInfo)
throws Exception
Exceptionprotected void populateDBWith100Keys(KeyColumnValueStore store) throws Exception
Exceptionprotected void examineGetKeysResults(KeyIterator keyIterator, long startKey, long endKey)
protected KeyColumnValueStoreManager openStorageManagerForClearStorageTest() throws Exception
ExceptionCopyright © 2012–2024. All rights reserved.