public abstract class KVDatabaseTest extends KVTestSupport
| Modifier and Type | Class and Description |
|---|---|
class |
KVDatabaseTest.Committer |
class |
KVDatabaseTest.RandomTask |
class |
KVDatabaseTest.Reader |
protected static interface |
KVDatabaseTest.Transactional<V> |
class |
KVDatabaseTest.Writer |
| Modifier and Type | Field and Description |
|---|---|
protected ExecutorService |
executor |
log, random, validator| Constructor and Description |
|---|
KVDatabaseTest() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowBothTransactionsToFail() |
protected KVTransaction |
createKVTransaction(KVDatabase kvdb) |
protected KVDatabase[][] |
getDBs() |
protected abstract KVDatabase |
getKVDatabase() |
protected int |
getNonconflictingTransactionCount() |
protected int |
getNumTries() |
protected int |
getParallelTransactionLoopCount() |
protected int |
getParallelTransactionTaskCount() |
protected int |
getRandomTaskMaxIterations() |
protected int |
getSequentialTransactionLoopCount() |
protected String |
mapRetryExceptionMessage(String message) |
void |
setup() |
void |
teardown() |
void |
testConflictingTransactions(KVDatabase store) |
void |
testKeyWatch(KVDatabase store) |
void |
testMultipleThreadsTransaction(KVDatabase store)
This test has multiple threads banging away on a single transaction to verify
that the transaction is thread safe.
|
void |
testNonconflictingTransactions(KVDatabase store) |
void |
testParallelTransactions(KVDatabase store)
This test runs transactions in parallel and verifies there is no "leakage" between them.
|
void |
testParallelTransactions(KVDatabase[] stores) |
void |
testSequentialTransactions(KVDatabase store)
This test runs transactions sequentially and verifies that each transaction sees
the changes that were committed in the previous transaction.
|
void |
testSimpleStuff(KVDatabase store) |
protected <V> V |
tryNtimes(KVDatabase kvdb,
KVDatabaseTest.Transactional<V> transactional) |
protected void |
updateRetryStats(RetryTransactionException e) |
kv, s, showKV, showKV, stringView, stringViewb, ba, buildList, buildMap, buildSet, buildSortedMap, buildSortedSet, checkMap, checkSet, checkValid, createTempDirectory, deleteDirectoryHierarchy, getRandom, randomBytes, readResource, readResource, readResource, s, seedRandom, setUpValidator, showprotected ExecutorService executor
protected KVDatabase[][] getDBs()
protected abstract KVDatabase getKVDatabase()
public void testSimpleStuff(KVDatabase store) throws Exception
Exceptionpublic void testKeyWatch(KVDatabase store) throws Exception
Exceptionpublic void testConflictingTransactions(KVDatabase store) throws Exception
Exceptionprotected boolean allowBothTransactionsToFail()
public void testNonconflictingTransactions(KVDatabase store) throws Exception
Exceptionprotected int getNonconflictingTransactionCount()
public void testParallelTransactions(KVDatabase store) throws Exception
store - underlying storeException - if an error occurspublic void testParallelTransactions(KVDatabase[] stores) throws Exception
Exceptionprotected int getParallelTransactionLoopCount()
protected int getParallelTransactionTaskCount()
public void testSequentialTransactions(KVDatabase store) throws Exception
store - underlying storeException - if an error occursprotected int getSequentialTransactionLoopCount()
public void testMultipleThreadsTransaction(KVDatabase store) throws Exception
store - underlying storeException - if an error occursprotected <V> V tryNtimes(KVDatabase kvdb, KVDatabaseTest.Transactional<V> transactional)
protected int getNumTries()
protected KVTransaction createKVTransaction(KVDatabase kvdb)
protected void updateRetryStats(RetryTransactionException e)
protected int getRandomTaskMaxIterations()
Copyright © 2017. All rights reserved.