public abstract class AbstractMRMWTestCase extends AbstractRawStoreTestCase implements com.bigdata.testutil.ExperimentDriver.IComparisonTest
Supporting MRMW is easy for a fully buffered implementation since it need
only use a read-only view for readers and serialize the assignment of
addresses to written records. If the implementation is not fully buffered,
e.g., DiskOnlyStrategy
, then it needs to serialize reads that are
not buffered. The exception as always is the MappedBufferStrategy
-
since this uses the nio MappedByteBuffer
it supports concurrent
readers using the same approach as a fully buffered strategy even though data
may not always reside in memory.
IMRMW
Modifier and Type | Class and Description |
---|---|
static class |
AbstractMRMWTestCase.GenerateExperiment
Experiment generation utility class.
|
static class |
AbstractMRMWTestCase.GroundTruth
Class maintains ground truth for the store.
|
static class |
AbstractMRMWTestCase.ReaderTask
Run a reader.
|
static class |
AbstractMRMWTestCase.Record
A ground truth record as generated by a
AbstractMRMWTestCase.WriterTask . |
static class |
AbstractMRMWTestCase.StressTestMRMW
Concrete instance for running stress tests and comparisons.
|
static interface |
AbstractMRMWTestCase.TestOptions
Additional properties understood by this test.
|
static class |
AbstractMRMWTestCase.WriterTask
Run a writer.
|
TestCase2.MyProperties, TestCase2.RandomType
Modifier and Type | Field and Description |
---|---|
protected IRawStore |
store |
r
_randomType, log
Constructor and Description |
---|
AbstractMRMWTestCase() |
AbstractMRMWTestCase(String name) |
Modifier and Type | Method and Description |
---|---|
com.bigdata.testutil.ExperimentDriver.Result |
doComparisonTest(Properties properties)
Setup and run a test.
|
static com.bigdata.testutil.ExperimentDriver.Result |
doMRMWTest(IRawStore store,
long timeout,
int ntrials,
int nclients,
double percentReaders,
double percentWriterWillFlush,
int reclen,
int nwritesPerTask,
int nreadsPerTask,
AtomicInteger nerr)
A correctness/stress/performance test with a pool of concurrent clients
designed to verify MRMW operations.
|
static void |
main(String[] args)
Correctness/stress/performance test for MRMW behavior.
|
void |
setUpComparisonTest(Properties properties) |
void |
tearDownComparisonTest() |
void |
testMRMW()
Correctness/stress test verifies that the implementation supports
Multiple Readers, Multiple Writers.
|
getRandomData, getStore, test_close, test_multipleWrites, test_read_correctRejection_0L, test_read_correctRejection_zeroLength, test_readImmutable, test_write_correctRejection_emptyRecord, test_write_correctRejection_null, test_writeImmutable, test_writeRead, test_writeReadRead, testBlobObjectStreams, testEmptyStream, testSimpleStringStream, testSimpleStringStreamFromStandardAllocation, testZipStreams
assertCondition, assertCondition, assertEquals, assertEquals, getBytes, getPort, getRandomData, getRandomData, setUp, tearDown
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getProperties, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
protected IRawStore store
public AbstractMRMWTestCase()
public AbstractMRMWTestCase(String name)
name
- public com.bigdata.testutil.ExperimentDriver.Result doComparisonTest(Properties properties) throws Exception
doComparisonTest
in interface com.bigdata.testutil.ExperimentDriver.IComparisonTest
properties
- There are no "optional" properties - you must make sure that
each property has a defined value.Exception
public void setUpComparisonTest(Properties properties) throws Exception
setUpComparisonTest
in interface com.bigdata.testutil.ExperimentDriver.IComparisonTest
Exception
public void tearDownComparisonTest() throws Exception
tearDownComparisonTest
in interface com.bigdata.testutil.ExperimentDriver.IComparisonTest
Exception
public void testMRMW() throws Exception
Note: You may have to run this test several times to detect some rare problems. For example, there is a Sun bug which can arise when a read operation runs concurrent with a change in the size of the file under Windows. This bug is not demonstrated each time, so you may need to run the test more than once if you suspect this issue. The problem is being addressed by the introduction of a read-write lock to restrict readers when we need to extend the backing store (unfortunately, that does not seem to do the trick).
Exception
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6371642
public static com.bigdata.testutil.ExperimentDriver.Result doMRMWTest(IRawStore store, long timeout, int ntrials, int nclients, double percentReaders, double percentWriterWillFlush, int reclen, int nwritesPerTask, int nreadsPerTask, AtomicInteger nerr) throws Exception
StressTestConcurrentTx
is designed to reveal concurrency problems
in the higher level data structures (transaction process and especially
the indices).store
- The store.timeout
- The timeout (seconds).ntrials
- The #of distinct client trials to execute.nclients
- The #of concurrent clients. Each client will be either a
AbstractMRMWTestCase.WriterTask
or a AbstractMRMWTestCase.ReaderTask
.percentReaders
- The percent of the clients that will be readers (vs writers)
[0.0:1.0]. When 1.0
, only readers will be
created. When 0.0
only writers will be created.percentWriterWillFlush
- The percentage of writer clients that will invoke
IRawStore.force(boolean)
to flush the data to the
store.reclen
- The length of the random byte[] records used in the
operations.nwritesPerTask
- The #of records to write per AbstractMRMWTestCase.WriterTask
.nreadsPerTask
- The #of records to read per AbstractMRMWTestCase.ReaderTask
.nerr
- Used to count and report back the errors as a side-effect.Exception
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.