Examples of openCursor()


Examples of com.sleepycat.je.Database.openCursor()

                    i++;
                }
    cursor.close();
            } else if (searchKeyRange) {
                /* Range Search for the key. */
    Cursor cursor = db.openCursor(null, null);
    OperationStatus status = cursor.getSearchKeyRange(searchKey,
                  foundData,
                  LockMode.DEFAULT);
    cursor.close();
                System.out.println("Range Search for key " + keyVal +
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(false);
        dbConfig.setReadOnly(true);
        dbConfig.setSortedDuplicates(true);
        Database db = env.openDatabase(null, Utils.DB2_NAME, dbConfig);
        Cursor cursor = db.openCursor(null, null);
        try {
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry data = new DatabaseEntry();
            OperationStatus status = cursor.getFirst(key, data, null);
            if (status != OperationStatus.SUCCESS) {
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

      loader.setDbName("foobar");
            loader.load();

            /* Make sure we retrieve the expected data. */
            Database checkDb = env.openDatabase(null, "foobar", null);
            Cursor cursor = checkDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry data = new DatabaseEntry();
            assertEquals(OperationStatus.SUCCESS,
                         cursor.getNext(key, data, LockMode.DEFAULT));
            assertEquals("abc", new String(key.getData()));
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

        for (int i = 0; i < nDumps; i += 1) {
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setAllowCreate(true);
            dbConfig.setSortedDuplicates(true);
            Database myDb = env.openDatabase(null, dbName + i, dbConfig);
            Cursor cursor = myDb.openCursor(null, null);
            doLargePut(dataMaps[i], cursor, N_KEYS);
            cursor.close();
            myDb.close();
        }
    }
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

        DatabaseConfig config = new DatabaseConfig();
        config.setReadOnly(true);
        DbInternal.setUseExistingConfig(config, true);
  Database myDb = env.openDatabase(null, dbName + dumpIndex, config);
  Cursor cursor = myDb.openCursor(null, null);
  StringDbt foundKey = new StringDbt();
  StringDbt foundData = new StringDbt();
  OperationStatus status =
      cursor.getFirst(foundKey, foundData, LockMode.DEFAULT);
  while (status == OperationStatus.SUCCESS) {
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

    new CascadingAbortTestJUnitThread(txn2, db) {
        public void testBody()
      throws Throwable {

      System.out.println("about to yield in thread");
      Cursor c = db.openCursor(txn, null);
      DatabaseEntry data = new DatabaseEntry();
      try {
          Thread.yield();
          DatabaseEntry key = new DatabaseEntry();
          System.out.println("about to gSKR in thread");
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

                System.arraycopy(bytes, 0, cursorBytes, 0, bytes.length);

                cursorData.setPartial(true);

                cursor = blocks.openCursor(txn, null);

                if (cursor.getSearchKey(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
                    cursor.delete();
                    advance: while (cursor.getNext(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
                        byte[] temp = cursorKey.getData();
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

        Database versionDb = null;
        Cursor cursor = null;
        try
        {
            versionDb = _environment.openDatabase(null, Upgrader.VERSION_DB_NAME, dbConfig);
            cursor = versionDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();
            while (cursor.getNext(key, value, null) == OperationStatus.SUCCESS)
            {
                int version = IntegerBinding.entryToInt(key);
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

        Database db = env.openDatabase(null, dbName, dbConfig);
  dupSort = db.getConfig().getSortedDuplicates();

  printHeader(outputFile, dupSort, formatUsingPrintable);

  Cursor cursor = db.openCursor(null, null);
  while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) ==
               OperationStatus.SUCCESS) {
      dumpOne(outputFile, foundKey.getData(), formatUsingPrintable);
      dumpOne(outputFile, foundData.getData(), formatUsingPrintable);
  }
View Full Code Here

Examples of com.sleepycat.je.Database.openCursor()

    private static void preload(Environment env, String dbName)
        throws DatabaseException {
        System.out.println("Preload starting");
        Database db = env.openDatabase(null, dbName, null);
        Cursor cursor = db.openCursor(null, null);
        try {
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry data = new DatabaseEntry();
            int count = 0;
            while (cursor.getNext(key, data, LockMode.DEFAULT) ==
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.