Package com.sleepycat.je

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


                                                             RoutingStrategy strategy) {
        synchronized(lock) {
            try {
                String storeName = storeDef.getName();
                Environment environment = getEnvironment(storeDef);
                Database db = environment.openDatabase(null, storeName, databaseConfig);
                BdbRuntimeConfig runtimeConfig = new BdbRuntimeConfig(voldemortConfig);
                BdbStorageEngine engine = null;
                if(voldemortConfig.getBdbPrefixKeysWithPartitionId()) {
                    engine = new PartitionPrefixedBdbStorageEngine(storeName,
                                                                   environment,
View Full Code Here


    this.file.mkdirs();
    this.pool = this.poolFactory.createPool(this);
    Environment env = this.pool.take();
    try
    {
      env.openDatabase(null, STATE, new DatabaseConfig().setAllowCreate(true)).close();
      env.openDatabase(null, INVOCATION, new DatabaseConfig().setAllowCreate(true)).close();
      env.openDatabase(null, INVOKER, new DatabaseConfig().setAllowCreate(true)).close();
    }
    finally
    {
View Full Code Here

    this.pool = this.poolFactory.createPool(this);
    Environment env = this.pool.take();
    try
    {
      env.openDatabase(null, STATE, new DatabaseConfig().setAllowCreate(true)).close();
      env.openDatabase(null, INVOCATION, new DatabaseConfig().setAllowCreate(true)).close();
      env.openDatabase(null, INVOKER, new DatabaseConfig().setAllowCreate(true)).close();
    }
    finally
    {
      this.pool.release(env);
View Full Code Here

    Environment env = this.pool.take();
    try
    {
      env.openDatabase(null, STATE, new DatabaseConfig().setAllowCreate(true)).close();
      env.openDatabase(null, INVOCATION, new DatabaseConfig().setAllowCreate(true)).close();
      env.openDatabase(null, INVOKER, new DatabaseConfig().setAllowCreate(true)).close();
    }
    finally
    {
      this.pool.release(env);
    }
View Full Code Here

        DatabaseEntry key = new DatabaseEntry();
        DatabaseEntry data = new DatabaseEntry(new byte[DATA_SIZE]);

        Environment env = new Environment(envHome, envConfig);
        Database db = env.openDatabase(null, "MultiEnvOpenCloseTest",
                                       dbConfig);
        for (int i = 0; i < N_RECORDS; i += 1) {
            IntegerBinding.intToEntry(i, key);
            db.put(null, key, data);
        }
View Full Code Here

        dbConfig.setReadOnly(true);

        for (int i = 1; i <= N_ITERS; i += 1) {
            //System.out.println("MultiEnvOpenCloseTest iteration # " + i);
            env = new Environment(envHome, envConfig);
            db = env.openDatabase(null, "MultiEnvOpenCloseTest", dbConfig);
            for (int j = 0; j < N_RECORDS; j += 1) {
                IntegerBinding.intToEntry(j, key);
                db.get(null, key, data, null);
            }
            db.close();
View Full Code Here

  FileManager fileManager = envImpl.getFileManager();

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        Database exampleDb =
      env.openDatabase(null, "simpleDb", dbConfig);

        assertEquals("Should have 0 as current file", 0L,
                     fileManager.getCurrentFileNum());
  long flipLsn = envImpl.forceLogFileFlip();
  assertEquals("LSN should be 1 post-flip", 1L,
View Full Code Here

                break;
            case DBSTATS:
                DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setReadOnly(true);
                DbInternal.setUseExistingConfig(dbConfig, true);
                Database db = env.openDatabase(null, dbName, dbConfig);
                try {
                    System.out.println(db.getStats(new StatsConfig()));
                } finally {
                    db.close();
                }
View Full Code Here

             * a db created with a non-default configuration.
             */
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setAllowCreate(true);
            dbConfig.setTransactional(true);
            Database db = env.openDatabase(null, "bozo", dbConfig);

            /* insert a record. */
            DatabaseEntry entry = new DatabaseEntry();
            IntegerBinding.intToEntry(1, entry);
            db.put(null, entry, entry);
View Full Code Here

            // Make two databases
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setTransactional(true);
            dbConfig.setAllowCreate(true);
            Database dbHandleAbcd = env.openDatabase(null, "abcd", dbConfig);
            Database dbHandleXyz = env.openDatabase(null, "xyz", dbConfig);

            // Can we get them back?
            dbConfig.setAllowCreate(false);
            Database newAbcdHandle = env.openDatabase(null, "abcd", 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.