@After public void tearDown() throws Exception { if (executor != null) { executor.shutdownNow(); } store.stop(); exceptions.clear(); }
@Test public void testConcurrentAddRemove() throws Exception { File directory = store.getDirectory(); store.stop(); IOHelper.mkdirs(directory); IOHelper.deleteChildren(directory);
tempDataStore.stop(); tempDataStore = null;
public void do_testConcurrentAddIterateRemove(boolean enablePageCache) throws Exception { File directory = store.getDirectory(); store.stop(); IOHelper.mkdirs(directory); IOHelper.deleteChildren(directory);
public void testConcurrentAddIterate() throws Exception { File directory = store.getDirectory(); store.stop(); IOHelper.mkdirs(directory); IOHelper.deleteChildren(directory);
@Test public void testConcurrentAddLast() throws Exception { File directory = store.getDirectory(); store.stop(); IOHelper.mkdirs(directory); IOHelper.deleteChildren(directory); store = createPListStore(); store.setDirectory(directory); store.start(); final int numThreads = 20; final int iterations = 1000; executor = Executors.newFixedThreadPool(100); for (int i=0; i<numThreads; i++) { new Job(i, PListTestSupport.TaskType.ADD, iterations).run(); } for (int i=0; i<numThreads; i++) { executor.execute(new Job(i, PListTestSupport.TaskType.ITERATE, iterations)); } for (int i=0; i<100; i++) { executor.execute(new Job(i+20, PListTestSupport.TaskType.ADD, 100)); } executor.shutdown(); boolean finishedInTime = executor.awaitTermination(60*5, TimeUnit.SECONDS); assertTrue("finished ok", finishedInTime); }
@Test public void testConcurrentAddRemoveWithPreload() throws Exception { File directory = store.getDirectory(); store.stop(); IOHelper.mkdirs(directory); IOHelper.deleteChildren(directory);
@Test public void testOverFlow() throws Exception { File directory = store.getDirectory(); store.stop(); IOHelper.mkdirs(directory); IOHelper.deleteChildren(directory); store = createPListStore(); store.setDirectory(directory); store.start(); for (int i=0;i<2000; i++) { new Job(i, PListTestSupport.TaskType.ADD, 5).run(); } // LOG.info("After Load index file: " + store.pageFile.getFile().length()); // LOG.info("After remove index file: " + store.pageFile.getFile().length()); }
tempDataStore.stop(); tempDataStore = null;
tempDataStore.stop(); tempDataStore = null;
tempDataStore.stop(); tempDataStore = null;