daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Oct 24th, 2012 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. EnvironmentConfig envConfig = new EnvironmentConfig();
  2. envConfig.setAllowCreate(true);
  3. envConfig.setInitializeRegions(true);
  4.  
  5. envConfig.setTransactional(true);
  6. envConfig.setTxnNoSync(true);
  7. envConfig.setInitializeLocking(false);
  8.  
  9. envConfig.setCacheSize(600000000);
  10. envConfig.setInitializeCache(true);
  11.  
  12. envConfig.setErrorStream(System.err);
  13. envConfig.setErrorPrefix("DiskIndexC5Env");
  14.  
  15. DatabaseConfig myDbConfig = new DatabaseConfig();
  16. myDbConfig.setAllowCreate(true);
  17. myDbConfig.setType(DatabaseType.HASH);
  18. myDbConfig.setHashNumElements(1000000);
  19. myDbConfig.setHashFillFactor(74);
  20. myDbConfig.setTransactional(true);
  21.  
  22. Environment environment = new Environment(new File(path), envConfig);
  23. Transaction transaction = environment.beginTransaction(null, null);
  24. Database database = environment.openDatabase(transaction, "kvC5.db", "kvC5", myDbConfig);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top