use of org.neo4j.io.pagecache.randomharness.RecordFormat in project neo4j by neo4j.
the class PageCacheHarnessTest method concurrentFlushingWithMischiefMustNotPutInterleavedDataIntoFile.
@Test(timeout = LONG_TIMEOUT_MILLIS)
public void concurrentFlushingWithMischiefMustNotPutInterleavedDataIntoFile() throws Exception {
final RecordFormat recordFormat = new StandardRecordFormat();
final int filePageCount = 2_000;
try (RandomPageCacheTestHarness harness = new RandomPageCacheTestHarness()) {
harness.setConcurrencyLevel(16);
harness.setUseAdversarialIO(true);
harness.setMischiefRate(0.5);
harness.setFailureRate(0.0);
harness.setErrorRate(0.0);
harness.setCachePageCount(filePageCount / 2);
harness.setFilePageCount(filePageCount);
harness.setCachePageSize(pageCachePageSize);
harness.setFilePageSize(pageCachePageSize);
harness.setInitialMappedFiles(3);
harness.setCommandCount(15_000);
harness.setFileSystem(fs);
harness.disableCommands(MapFile, UnmapFile, ReadRecord, ReadMulti);
harness.setVerification(filesAreCorrectlyWrittenVerification(recordFormat, filePageCount));
harness.run(LONG_TIMEOUT_MILLIS, MILLISECONDS);
}
}
use of org.neo4j.io.pagecache.randomharness.RecordFormat in project neo4j by neo4j.
the class PageCacheHarnessTest method concurrentFlushingWithFailuresMustNotPutInterleavedDataIntoFile.
@Test(timeout = LONG_TIMEOUT_MILLIS)
public void concurrentFlushingWithFailuresMustNotPutInterleavedDataIntoFile() throws Exception {
final RecordFormat recordFormat = new StandardRecordFormat();
final int filePageCount = 20_000;
try (RandomPageCacheTestHarness harness = new RandomPageCacheTestHarness()) {
harness.setConcurrencyLevel(16);
harness.setUseAdversarialIO(true);
harness.setMischiefRate(0.0);
harness.setFailureRate(0.5);
harness.setErrorRate(0.0);
harness.setCachePageCount(filePageCount / 2);
harness.setFilePageCount(filePageCount);
harness.setCachePageSize(pageCachePageSize);
harness.setFilePageSize(pageCachePageSize);
harness.setInitialMappedFiles(3);
harness.setCommandCount(150_000);
harness.setFileSystem(fs);
harness.disableCommands(MapFile, UnmapFile, ReadRecord, ReadMulti);
harness.setVerification(filesAreCorrectlyWrittenVerification(recordFormat, filePageCount));
harness.run(LONG_TIMEOUT_MILLIS, MILLISECONDS);
}
}
use of org.neo4j.io.pagecache.randomharness.RecordFormat in project neo4j by neo4j.
the class PageCacheHarnessTest method concurrentPageFaultingMustNotPutInterleavedDataIntoPages.
@Test(timeout = LONG_TIMEOUT_MILLIS)
public void concurrentPageFaultingMustNotPutInterleavedDataIntoPages() throws Exception {
final int filePageCount = 11;
final RecordFormat recordFormat = new PageCountRecordFormat();
try (RandomPageCacheTestHarness harness = new RandomPageCacheTestHarness()) {
harness.setConcurrencyLevel(11);
harness.setUseAdversarialIO(false);
harness.setCachePageCount(3);
harness.setCachePageSize(pageCachePageSize);
harness.setFilePageCount(filePageCount);
harness.setFilePageSize(pageCachePageSize);
harness.setInitialMappedFiles(1);
harness.setCommandCount(10000);
harness.setRecordFormat(recordFormat);
harness.setFileSystem(fs);
harness.disableCommands(FlushCache, FlushFile, MapFile, UnmapFile, WriteRecord, WriteMulti);
harness.setPreparation((pageCache1, fs1, filesTouched) -> {
File file = filesTouched.iterator().next();
try (PagedFile pf = pageCache1.map(file, pageCachePageSize);
PageCursor cursor = pf.io(0, PF_SHARED_WRITE_LOCK)) {
for (int pageId = 0; pageId < filePageCount; pageId++) {
cursor.next();
recordFormat.fillWithRecords(cursor);
}
}
});
harness.run(LONG_TIMEOUT_MILLIS, MILLISECONDS);
}
}
use of org.neo4j.io.pagecache.randomharness.RecordFormat in project neo4j by neo4j.
the class PageCacheHarnessTest method concurrentFlushingMustNotPutInterleavedDataIntoFile.
@Test(timeout = LONG_TIMEOUT_MILLIS)
public void concurrentFlushingMustNotPutInterleavedDataIntoFile() throws Exception {
final RecordFormat recordFormat = new StandardRecordFormat();
final int filePageCount = 2_000;
try (RandomPageCacheTestHarness harness = new RandomPageCacheTestHarness()) {
harness.setConcurrencyLevel(16);
harness.setUseAdversarialIO(false);
harness.setCachePageCount(filePageCount / 2);
harness.setFilePageCount(filePageCount);
harness.setCachePageSize(pageCachePageSize);
harness.setFilePageSize(pageCachePageSize);
harness.setInitialMappedFiles(3);
harness.setCommandCount(15_000);
harness.setFileSystem(fs);
harness.disableCommands(MapFile, UnmapFile, ReadRecord, ReadMulti);
harness.setVerification(filesAreCorrectlyWrittenVerification(recordFormat, filePageCount));
harness.run(LONG_TIMEOUT_MILLIS, MILLISECONDS);
}
}
Aggregations