Package com.sleepycat.je

Examples of com.sleepycat.je.OperationStatus


            if (moveForward) {
                cursor.setIndex(bin.getNEntries() - 1);
            } else {
                cursor.setIndex(0);
            }
            final OperationStatus status = cursor.getNext
                (null /*foundKey*/, null /*foundData*/, LockType.NONE,
                 moveForward, true /*alreadyLatched*/,
                 null /*rangeConstraint*/);
            if (status == OperationStatus.SUCCESS && cursor.getBIN() != bin) {
                final List<TrackingInfo> stack = getParentStack(cursor);
View Full Code Here


        throws DatabaseException {

        assert assertCursorState(true) : dumpToString(true);
        assert checkAlreadyLatched(alreadyLatched) : dumpToString(true);

        OperationStatus result = OperationStatus.NOTFOUND;

        try {
            while (bin != null) {

                assert checkAlreadyLatched(alreadyLatched) :
                    dumpToString(true);
                if (!alreadyLatched) {
                    latchBIN();
                } else {
                    alreadyLatched = false;
                }

                if (DEBUG) {
                    verifyCursor(bin);
                }

                /* Is there anything left on this BIN? */
                if ((forward && ++index < bin.getNEntries()) ||
                    (!forward && --index > -1)) {

                    if (rangeConstraint != null &&
                        !rangeConstraint.inBounds(bin.getKey(index))) {
                        result = OperationStatus.NOTFOUND;
                        releaseBIN();
                        break;
                    }

                    OperationStatus ret = getCurrentAlreadyLatched
                        (foundKey, foundData, lockType);
                    if (ret == OperationStatus.SUCCESS) {
                        incrementLNCount();
                        result = OperationStatus.SUCCESS;
                        break;
View Full Code Here

                 * 2- found an exact match, or
                 * 3- found the record prior to the given key/data.
                 */
                DatabaseEntry tempData = new DatabaseEntry();
                tempData.setPartial(0, 0, true);
                OperationStatus status = getNext
                    (tempKey, tempData, LockType.RANGE_INSERT, true, true,
                     null /*rangeConstraint*/);
                if (status == OperationStatus.SUCCESS) {
                    lockedNextKey = true;
                }
View Full Code Here

            EnvironmentImpl envImpl = db.getDbEnvironment();
            locker = LockerFactory.getInternalReadOperationLocker(envImpl);
            cursor = new CursorImpl(db, locker);
            cursor.setAllowEviction(allowEviction);
            if (cursor.positionFirstOrLast(true /*first*/)) {
                OperationStatus status =
                    cursor.getCurrentAlreadyLatched(key, data, lockType);
                boolean done = false;
                while (!done) {

                    /*
 
View Full Code Here

                keyBytes[0] = (byte) (i >> 8);
                keyBytes[1] = (byte) i;
            }
            setKeyData(keyBytes, keyPrefix, keyEntry, dataEntry);

            final OperationStatus status;
            if (duplicates) {
                status = db.putNoDupData(null, keyEntry, dataEntry);
            } else {
                status = db.putNoOverwrite(null, keyEntry, dataEntry);
            }
            if (status != OperationStatus.SUCCESS) {
                throw new IllegalStateException(status.toString());
            }
        }

        /* Position a cursor to the first record. */
        final Cursor cursor = db.openCursor(null, null);
        OperationStatus status = cursor.getFirst(keyEntry, dataEntry, null);
        assert status == OperationStatus.SUCCESS;

        /*
         * Calculate BIN size including LNs/data. The recalcKeyPrefix and
         * compactMemory methods are called to simulate normal operation.
View Full Code Here

                final int keyVal = orderedInsertion ? i : rndKeys.get(i);
                byte[] keyBytes = padLeft
                    (BigInteger.valueOf(keyVal).toByteArray(), maxKeyBytes);
                setKeyData(keyBytes, keyOffset, keyEntry, dataEntry);

                final OperationStatus status;
                if (duplicates) {
                    status = cursor.putNoDupData(keyEntry, dataEntry);
                } else {
                    status = cursor.putNoOverwrite(keyEntry, dataEntry);
                }
View Full Code Here

      try
      {
         while (true)
         {
            DatabaseEntry keyEntry = makeKeyEntry(prefixEntry, namePart);
            OperationStatus status =
                  cursor.getSearchKeyRange(keyEntry, dataEntry, null);
            if (status != OperationStatus.SUCCESS ||
                  !startsWith(keyEntry, prefixEntry))
            {
               break;
View Full Code Here

      checkOpen();
      checkNonNull(name, "name");

      DatabaseEntry keyEntry = makeKeyEntry(name);
      DatabaseEntry foundData = new DatabaseEntry();
      OperationStatus status = cacheDb.get(null, keyEntry, foundData, null);
      if (status == OperationStatus.SUCCESS)
      {
         //  changed createIfNull param to true
         // See http://jira.jboss.com/jira/browse/JBCACHE-118
         return makeDataObject(foundData);
View Full Code Here

      checkNonNull(name, "name");

      DatabaseEntry keyEntry = makeKeyEntry(name);
      DatabaseEntry foundData = new DatabaseEntry();
      foundData.setPartial(0, 0, true);
      OperationStatus status = cacheDb.get(null, keyEntry, foundData, null);
      return (status == OperationStatus.SUCCESS);
   }
View Full Code Here

      DatabaseEntry dataEntry = makeDataEntry(map);
      DatabaseEntry keyEntry = makeKeyEntry(name);
      Cursor cursor = cacheDb.openCursor(txn, null);
      try
      {
         OperationStatus status = cursor.putNoOverwrite(keyEntry, dataEntry);
         if (status == OperationStatus.SUCCESS)
         {
            createParentNodes(cursor, name);
         }
         else
View Full Code Here

TOP

Related Classes of com.sleepycat.je.OperationStatus

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.