Package com.sleepycat.je

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


        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

    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

                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

        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

        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

    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

                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();

                    while (cursor.getNextDup(cursorKey, cursorData, null) != OperationStatus.NOTFOUND) {
View Full Code Here

     * using this method.
     */
    db = dc.openDatabase("db", dbConfig);
    secDb = dc.openSecondaryDatabase("secDb", db, secDbConfig);
    System.out.println("blort");
    cursor = db.openCursor(null, null);
    cursor.put(new DatabaseEntry(key.getBytes()),
         new DatabaseEntry(data.getBytes()));
      } finally {
    if (cursor != null) {
        cursor.close();
View Full Code Here

     * Use JEConnection.openDatabase() to obtain a cached Database
     * handle.  Do not call close() on Database handles obtained
     * using this method.
     */
    db = dc.openDatabase("db", dbConfig);
    cursor = db.openCursor(null, null);
    DatabaseEntry data = new DatabaseEntry();
    cursor.getSearchKey(new DatabaseEntry(key.getBytes()),
            data,
            null);
    return new String(data.getData());
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.