public void test_journal_oneIndexRandomData() throws IOException, InterruptedException, ExecutionException {
  final File out=File.createTempFile(getName(),Options.JNL);
  try {
    final Journal src=getStore(getProperties());
    try {
      final String NAME="testIndex";
      int ntuples=0;
      src.registerIndex(new IndexMetadata(NAME,UUID.randomUUID()));
{
        final BTree ndx=src.getIndex(NAME);
        final KV[] a=AbstractBTreeTestCase.getRandomKeyValues(1000);
        for (        KV kv : a) {
          if (ndx.insert(kv.key,kv.val) == null) {
            ntuples++;
          }
        }
      }
      src.commit();
      final Future<Map<String,BaseIndexStats>> f=src.warmUp(null);
      final Map<String,BaseIndexStats> map=f.get();
      assertEquals(1,map.size());
      final BaseIndexStats stats=map.get(NAME);
      assertNotNull(stats);
      assertEquals(ntuples,stats.ntuples);
    }
  finally {
      src.destroy();
    }
  }
  finally {
    out.delete();
  }
}

public void test_journal_oneIndexRandomData ( ) throws IOException , InterruptedException , ExecutionException { final File out = File . createTempFile ( getName ( ) , Options . JNL ) ; try { final Journal src = getStore ( getProperties ( ) ) ; try { final String NAME = "testIndex" ; int ntuples = 0 ; src . registerIndex ( new IndexMetadata ( NAME , UUID . randomUUID ( ) ) ) ; { final BTree ndx = src . getIndex ( NAME ) ; final KV [ ] a = AbstractBTreeTestCase . getRandomKeyValues ( 1000 ) ; for ( KV kv : a ) { if ( ndx . insert ( kv . key , kv . val ) == null ) { ntuples ++ ; } } } src . commit ( ) ; final Future < Map < String , BaseIndexStats > > f = src . warmUp ( null ) ; final Map < String , BaseIndexStats > map = f . get ( ) ; assertEquals ( 1 , map . size ( ) ) ; final BaseIndexStats stats = map . get ( NAME ) ; assertNotNull ( stats ) ; assertEquals ( ntuples , stats . ntuples ) ; } finally { src . destroy ( ) ; } } finally { out . delete ( ) ; } }
test with a journal on which a single index has been registered with random data on the index .
