@Override public void run() { for (int i = 0; i < ntasks / 2; i++) { // resource names are non-overlapping. final String resource = "" + i; final UUID indexUUID = UUID.randomUUID(); final BTree ndx = BTree.create(journal, new IndexMetadata(resource, indexUUID)); journal.registerIndex(resource, ndx); } lock.lock(); try { ndone.incrementAndGet(); done.signal(); } finally { lock.unlock(); } }
@Override public void run() { for (int i = ntasks / 2; i < ntasks; i++) { // resource names are non-overlapping. final String resource = "" + i; final UUID indexUUID = UUID.randomUUID(); final BTree ndx = BTree.create(journal, new IndexMetadata(resource, indexUUID)); journal.registerIndex(resource, ndx); } lock.lock(); try { ndone.incrementAndGet(); done.signal(); } finally { lock.unlock(); } }
@Override public void run() { for (int i = 0; i < ntasks / 2; i++) { // resource names are non-overlapping. final String resource = "" + i; final UUID indexUUID = UUID.randomUUID(); final BTree ndx = BTree.create(journal, new IndexMetadata(resource, indexUUID)); journal.registerIndex(resource, ndx); } lock.lock(); try { ndone.incrementAndGet(); done.signal(); } finally { lock.unlock(); } }
@Override public void run() { for (int i = ntasks / 2; i < ntasks; i++) { // resource names are non-overlapping. final String resource = "" + i; final UUID indexUUID = UUID.randomUUID(); final BTree ndx = BTree.create(journal, new IndexMetadata(resource, indexUUID)); journal.registerIndex(resource, ndx); } lock.lock(); try { ndone.incrementAndGet(); done.signal(); } finally { lock.unlock(); } }
/** * Test the index write rate using an index that does NOT support * transactional isolation using 32 bit integer keys and 128 byte values for * the index entries. */ public void testNonIsolatableIndexWriteRate() throws IOException { // register named index that does NOT support isolation. String name = "abc"; final BTree btree; { IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setBranchingFactor(getBranchingFactor()); btree = BTree.create(journal, metadata); } journal.registerIndex(name, btree); journal.commit(); // NOT isolated. long tx = 0L; // run test. doIndexWriteRateTest(name, tx, 128); }
/** * Test the index write rate using an index that does NOT support * transactional isolation using 32 bit integer keys and 128 byte values for * the index entries. */ public void testNonIsolatableIndexWriteRate() throws IOException { // register named index that does NOT support isolation. String name = "abc"; final BTree btree; { IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setBranchingFactor(getBranchingFactor()); btree = BTree.create(journal, metadata); } journal.registerIndex(name, btree); journal.commit(); // NOT isolated. long tx = 0L; // run test. doIndexWriteRateTest(name, tx, 128); }
/** * Dump a journal with a single named index. */ public void test_journal_oneIndexNoData() throws IOException, InterruptedException, ExecutionException { final Journal src = getStore(getProperties()); try { // register an index and commit the journal. final String NAME = "testIndex"; src.registerIndex(new IndexMetadata(NAME, UUID.randomUUID())); src.commit(); new DumpJournal(src) .dumpJournal(true/* dumpHistory */, true/* dumpPages */, true/* dumpIndices */, true/* showTuples */); } finally { src.destroy(); } }
/** * Dump a journal with a single named index. */ public void test_journal_oneIndexNoData() throws IOException, InterruptedException, ExecutionException { final Journal src = getStore(getProperties()); try { // register an index and commit the journal. final String NAME = "testIndex"; src.registerIndex(new IndexMetadata(NAME, UUID.randomUUID())); src.commit(); new DumpJournal(src) .dumpJournal(true/* dumpHistory */, true/* dumpPages */, true/* dumpIndices */, true/* showTuples */); } finally { src.destroy(); } }
/** * Test the index write rate using an index that supports transactional * isolation but without transactional isolation using 32 bit integer keys * and 128 byte values for the index entries. */ public void testUnisolatedIndexWriteRate() throws IOException { // register named index that can support isolation. String name = "abc"; final BTree btree; { IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setBranchingFactor(getBranchingFactor()); metadata.setIsolatable(true); btree = BTree.create(journal, metadata); } journal.registerIndex(name, btree ); journal.commit(); // NOT isolated. long tx = 0L; // run test. doIndexWriteRateTest(name, tx, 128); }
/** * Test the index write rate using an index that supports transactional * isolation but without transactional isolation using 32 bit integer keys * and 128 byte values for the index entries. */ public void testUnisolatedIndexWriteRate() throws IOException { // register named index that can support isolation. String name = "abc"; final BTree btree; { IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setBranchingFactor(getBranchingFactor()); metadata.setIsolatable(true); btree = BTree.create(journal, metadata); } journal.registerIndex(name, btree ); journal.commit(); // NOT isolated. long tx = 0L; // run test. doIndexWriteRateTest(name, tx, 128); }
/** * Test the index write rate for a fully isolated transaction using 32 bit * integer keys and 128 byte values for the index entries. */ public void testIsolatedIndexWriteRate() throws IOException { // register named index that can support isolation. String name = "abc"; final BTree btree; { IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setBranchingFactor(getBranchingFactor()); metadata.setIsolatable(true); btree = BTree.create(journal, metadata); } journal.registerIndex(name, btree ); journal.commit(); // fully isolated transaction. long tx = journal.newTx(ITx.UNISOLATED); // run test. doIndexWriteRateTest(name, tx, 128); }
/** * Test the index write rate for a fully isolated transaction using 32 bit * integer keys and 128 byte values for the index entries. */ public void testIsolatedIndexWriteRate() throws IOException { // register named index that can support isolation. String name = "abc"; final BTree btree; { IndexMetadata metadata = new IndexMetadata(UUID.randomUUID()); metadata.setBranchingFactor(getBranchingFactor()); metadata.setIsolatable(true); btree = BTree.create(journal, metadata); } journal.registerIndex(name, btree ); journal.commit(); // fully isolated transaction. long tx = journal.newTx(ITx.UNISOLATED); // run test. doIndexWriteRateTest(name, tx, 128); }
/** * Test with an HTree. */ public void test_journal_oneIndex_HTree_RandomData_dumpPages() throws IOException, InterruptedException, ExecutionException { final Journal src = getStore(getProperties()); try { // register an index and commit the journal. final String NAME = "testIndex"; src.registerIndex(new HTreeIndexMetadata(NAME, UUID.randomUUID())); { final HTree ndx = (HTree) src.getUnisolatedIndex(NAME); final KV[] a = AbstractBTreeTestCase .getRandomKeyValues(1000/* ntuples */); for (KV kv : a) { ndx.insert(kv.key, kv.val); } } src.commit(); new DumpJournal(src) .dumpJournal(true/* dumpHistory */, true/* dumpPages */, true/* dumpIndices */, false/* showTuples */); } finally { src.destroy(); } }
/** * Test with an HTree. * * @see <a href="http://trac.bigdata.com/ticket/1229" > DumpJournal fails on * non-BTree classes </a> */ public void test_journal_oneIndex_HTree_RandomData_withoutDumpPages() throws IOException, InterruptedException, ExecutionException { final Journal src = getStore(getProperties()); try { // register an index and commit the journal. final String NAME = "testIndex"; src.registerIndex(new HTreeIndexMetadata(NAME, UUID.randomUUID())); { final HTree ndx = (HTree) src.getUnisolatedIndex(NAME); final KV[] a = AbstractBTreeTestCase .getRandomKeyValues(1000/* ntuples */); for (KV kv : a) { ndx.insert(kv.key, kv.val); } } src.commit(); new DumpJournal(src) .dumpJournal(true/* dumpHistory */, false/* dumpPages */, true/* dumpIndices */, false/* showTuples */); } finally { src.destroy(); } }
src.registerIndex(new IndexMetadata(NAME, UUID.randomUUID()));
/** * Test with an HTree. */ public void test_journal_oneIndex_HTree_RandomData_dumpPages() throws IOException, InterruptedException, ExecutionException { final Journal src = getStore(getProperties()); try { // register an index and commit the journal. final String NAME = "testIndex"; src.registerIndex(new HTreeIndexMetadata(NAME, UUID.randomUUID())); { final HTree ndx = (HTree) src.getUnisolatedIndex(NAME); final KV[] a = AbstractBTreeTestCase .getRandomKeyValues(1000/* ntuples */); for (KV kv : a) { ndx.insert(kv.key, kv.val); } } src.commit(); new DumpJournal(src) .dumpJournal(true/* dumpHistory */, true/* dumpPages */, true/* dumpIndices */, false/* showTuples */); } finally { src.destroy(); } }
/** * Test with an HTree. * * @see <a href="http://trac.bigdata.com/ticket/1229" > DumpJournal fails on * non-BTree classes </a> */ public void test_journal_oneIndex_HTree_RandomData_withoutDumpPages() throws IOException, InterruptedException, ExecutionException { final Journal src = getStore(getProperties()); try { // register an index and commit the journal. final String NAME = "testIndex"; src.registerIndex(new HTreeIndexMetadata(NAME, UUID.randomUUID())); { final HTree ndx = (HTree) src.getUnisolatedIndex(NAME); final KV[] a = AbstractBTreeTestCase .getRandomKeyValues(1000/* ntuples */); for (KV kv : a) { ndx.insert(kv.key, kv.val); } } src.commit(); new DumpJournal(src) .dumpJournal(true/* dumpHistory */, false/* dumpPages */, true/* dumpIndices */, false/* showTuples */); } finally { src.destroy(); } }
src.registerIndex(new IndexMetadata(NAME, UUID.randomUUID()));
journal.registerIndex(md);