Package com.sleepycat.je

Examples of com.sleepycat.je.DatabaseConfig


    public void testDupInitialized()
        throws DatabaseException {

        /* Open db. */
        initEnv(false);
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        Database myDb = exampleEnv.openDatabase(null, "fooDb", dbConfig);

        /* Open uninitialized cursor. */
        Cursor c1 = myDb.openCursor(null, null);
        try {
View Full Code Here


       * comes before ckptStart.
       */
            Transaction txn1 = env.beginTransaction(null, null);
      DatabaseEntry key = new DatabaseEntry(new byte[] { 1, 2, 3, 4 });
      DatabaseEntry data = new DatabaseEntry(new byte[] { 4, 3, 2, 1 });
      DatabaseConfig dbConfig = new DatabaseConfig();
      dbConfig.setAllowCreate(true);
      dbConfig.setSortedDuplicates(false);
      dbConfig.setTransactional(true);
            Database otherDb = env.openDatabase(txn1, "extradb", dbConfig);
      otherDb.put(txn1, key, data);

            /* Delete all and abort. */
            txn = env.beginTransaction(null, null);
View Full Code Here

       * comes before ckptStart.
       */
            Transaction txn1 = env.beginTransaction(null, null);
      DatabaseEntry key = new DatabaseEntry(new byte[] { 1, 2, 3, 4 });
      DatabaseEntry data = new DatabaseEntry(new byte[] { 4, 3, 2, 1 });
      DatabaseConfig dbConfig = new DatabaseConfig();
      dbConfig.setAllowCreate(true);
      dbConfig.setSortedDuplicates(false);
      dbConfig.setTransactional(true);
            Database otherDb = env.openDatabase(txn1, "extradb", dbConfig);
      otherDb.put(txn1, key, data);

            /* Delete all and abort. */
            txn = env.beginTransaction(null, null);
View Full Code Here

        try {
            /* Make Dbs, abort */
            Transaction txn = env.beginTransaction(null, null);

            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setTransactional(true);
            dbConfig.setAllowCreate(true);
            for (int i = 0; i < N2; i++) {
                Database db = env.openDatabase(txn, dbName1 + i, dbConfig);
            }
            txn.abort();
           
View Full Code Here

        /*
         * Create a log file full of LNs, DeletedDupLNs, MapLNs and Debug
         * Records
         */
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        db = env.openDatabase(null, "foo", dbConfig);
        LogManager logManager = envImpl.getLogManager();

        long lsn;
        Txn userTxn = new Txn(envImpl, new TransactionConfig());
View Full Code Here

        }
        String dbName = (String)params[2];

        Database db = null;
        try {
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setReadOnly(true);
            DbInternal.setUseExistingConfig(dbConfig, true);
            db = targetEnv.openDatabase(null, dbName, dbConfig);
            return db.getStats(getStatsConfig(params));
        } finally {
            if (db != null) {
View Full Code Here

        openEnv();

        /* Write db0 and db1. */
        for (int i = 0; i < 2; i += 1) {
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setAllowCreate(true);
            dbConfig.setSortedDuplicates(true);
            Database db = env.openDatabase(null, "db" + i, dbConfig);

            /* Write: {0, 0}, {0, 1}, {1, 0}, {2, 0}, {3, 0} */
            for (int j = 0; j < N_ENTRIES; j += 1) {
                db.put(null, entry(j), entry(0));
View Full Code Here

     * First and only record in db1 should be {3,0}.
     */
    private void checkFirstRecord()
        throws DatabaseException {

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(false);
        dbConfig.setReadOnly(true);
        dbConfig.setSortedDuplicates(true);
        Database db = env.openDatabase(null, "db1", dbConfig);
        Cursor cursor = db.openCursor(null, null);
        DatabaseEntry key = new DatabaseEntry();
        DatabaseEntry data = new DatabaseEntry();
        OperationStatus status = cursor.getFirst(key, data, null);
View Full Code Here

      envConfig.setCacheSize(100000);
      envConfig.setConfigParam("java.util.logging.level", "OFF");
      env = new Environment(envHome, envConfig);

      String databaseName = "ioexceptiondb";
      DatabaseConfig dbConfig = new DatabaseConfig();
      dbConfig.setAllowCreate(true);
      dbConfig.setSortedDuplicates(true);
      dbConfig.setTransactional(true);
      db = env.openDatabase(null, databaseName, dbConfig);
 
      Transaction txn = env.beginTransaction(null, null);
      DatabaseEntry oneKey =
    (dupes ?
View Full Code Here

      envConfig.setConfigParam("java.util.logging.level", "OFF");
  }
  env = new Environment(envHome, envConfig);

        String databaseName = "ioexceptiondb";
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(true);
        dbConfig.setSortedDuplicates(true);
  dbConfig.setTransactional(true);
        db = env.openDatabase(null, databaseName, dbConfig);
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.DatabaseConfig

Copyright © 2018 www.massapicom. 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.