Package com.sleepycat.je

Examples of com.sleepycat.je.Environment.openDatabase()


      /* Verify the database name by trying to open it. */
      Environment env = new Environment(new File(envHome), null);
      DatabaseConfig dbConfig = new DatabaseConfig();
      dbConfig.setTransactional(transactional);
      Database db = env.openDatabase(null, dbName, dbConfig);
      db.close();
      env.close();
   }

   /**
 
View Full Code Here


        File dirA = new File(bdbMasterDir + "/" + "storeA");
        if(!dirA.exists()) {
            dirA.mkdirs();
        }
        Environment environmentA = new Environment(dirA, environmentConfig);
        Database databaseA = environmentA.openDatabase(null, "storeA", databaseConfig);
        BdbStorageEngine storeA = BdbStorageEngineTest.makeBdbStorageEngine("storeA",
                                                                            environmentA,
                                                                            databaseA,
                                                                            new BdbRuntimeConfig(),
                                                                            this.prefixPartitionId);
View Full Code Here

        File dirB = new File(bdbMasterDir + "/" + "storeB");
        if(!dirB.exists()) {
            dirB.mkdirs();
        }
        Environment environmentB = new Environment(dirB, environmentConfig);
        Database databaseB = environmentB.openDatabase(null, "storeB", databaseConfig);
        BdbStorageEngine storeB = BdbStorageEngineTest.makeBdbStorageEngine("storeB",
                                                                            environmentB,
                                                                            databaseB,
                                                                            new BdbRuntimeConfig(),
                                                                            this.prefixPartitionId);
View Full Code Here

        } else {
            for(File f: bdbDir.listFiles())
                f.delete();
        }
        environment = new Environment(bdbDir, environmentConfig);
        final Database db = environment.openDatabase(null, "test", databaseConfig);

        final Random rand = new Random();
        int iterations = totalSize / increment;
        long[] readTimes = new long[iterations];
        long[] writeTimes = new long[iterations];
View Full Code Here

        Environment environment = new Environment(new File(bdbDir), environmentConfig);
        DatabaseConfig databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        databaseConfig.setTransactional(config.isBdbWriteTransactionsEnabled());
        databaseConfig.setSortedDuplicates(false);
        Database database = environment.openDatabase(null, storeName, databaseConfig);

        StorageEngine<ByteArray, byte[], byte[]> store = null;
        if(config.getBdbPrefixKeysWithPartitionId()) {
            store = new PartitionPrefixedBdbStorageEngine(storeName,
                                                          environment,
View Full Code Here

                dbEnvConfig.setLockTimeout(5, TimeUnit.SECONDS);
                environment = new Environment(dir, dbEnvConfig);
                final DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setTransactional(true);
                dbConfig.setAllowCreate(true);
                database = environment.openDatabase(null, name, dbConfig);
            } catch (final Exception ex) {
                LOGGER.error("Could not create FlumePersistentManager", ex);
                return null;
            }
View Full Code Here

      /* Verify the database name by trying to open it. */
      Environment env = new Environment(new File(envHome), null);
      DatabaseConfig dbConfig = new DatabaseConfig();
      dbConfig.setTransactional(transactional);
      Database db = env.openDatabase(null, dbName, dbConfig);
      db.close();
      env.close();
   }

   /**
 
View Full Code Here

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setReadOnly(true);
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(false);
        Transaction txn = env.beginTransaction(null, null);
        Database db = env.openDatabase(txn, DbType.REP_GROUP.getInternalName(),
                                       dbConfig);

        DatabaseEntry groupEntry = new DatabaseEntry();
        OperationStatus status =
            db.get(txn, groupKeyEntry, groupEntry, LockMode.READ_COMMITTED);
View Full Code Here

            DatabaseConfig dbCfg = new DatabaseConfig();
            dbCfg.setAllowCreate(false);
            dbCfg.setReadOnly(true);
            DbInternal.setUseExistingConfig(dbCfg, true);

            Database db = env.openDatabase(null, dbName, dbCfg);
            out.println("Database: " + dbName + ", Count: " + db.count());
            db.close();
        }

        env.close();
View Full Code Here

                boolean ret = diff(env1, env2);
                env1.close();
                env2.close();
                return ret;
            }
            db2 = env2.openDatabase(null, file2, dbConfig);
        } else {
            db2 = env1.openDatabase(null, file2, dbConfig);
        }
        Database db1 = env1.openDatabase(null, file1, dbConfig);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.