Package com.sleepycat.je

Examples of com.sleepycat.je.OperationStatus


         * @return true if some new data was fetched, false if end of data
         */
        private boolean makeMore() {
            DatabaseEntry keyEntry = new DatabaseEntry();
            DatabaseEntry valueEntry = new DatabaseEntry();
            OperationStatus status;
            try {
                if(!positioned) {
                    positioned = true;
                    keyEntry.setData(StoreBinaryFormat.makePartitionKey(partition));
                    status = cursor.getSearchKeyRange(keyEntry,
View Full Code Here


         *         keys
         */
        private boolean fetchNextKey() {
            DatabaseEntry keyEntry = new DatabaseEntry();
            DatabaseEntry valueEntry = new DatabaseEntry();
            OperationStatus status;
            valueEntry.setPartial(true);
            try {
                if(!positioned) {
                    positioned = true;
                    keyEntry.setData(StoreBinaryFormat.makePartitionKey(partition));
View Full Code Here

   
    /* Use a binding to convert the int into a DatabaseEntry. */   
    objectToEntry(key, keyEntry);
    StringBinding.stringToEntry(value, dataEntry);

    final OperationStatus status = _db.put(null, keyEntry, dataEntry);

    /*
     * However, the status return conveys a variety of information. For
     * example, the put might succeed, or it might not succeed if the record
     * already exists and the database was not configured for duplicate
View Full Code Here

    final DatabaseEntry dataEntry = new DatabaseEntry();
    objectToEntry(key, keyEntry);

    // initialize cursor
    final Cursor cursor = _db.openCursor(null, null);
    final OperationStatus status = cursor.getSearchKey(keyEntry, dataEntry, LockMode.DEFAULT);
    cursor.close();
    if (status != OperationStatus.SUCCESS)
      return null;
    else
      return StringBinding.entryToString(dataEntry);
View Full Code Here

    final DatabaseEntry dataEntry = new DatabaseEntry();
    objectToEntry(leftBoundary, keyEntry);

    // initialize cursor
    final Cursor cursor = _db.openCursor(null, null);
    OperationStatus status = cursor.getSearchKeyRange(keyEntry, dataEntry, LockMode.DEFAULT);
    if(status == OperationStatus.SUCCESS && !includeLeft){
      //omit the first element
      status = cursor.getNextNoDup(keyEntry, dataEntry, LockMode.DEFAULT);
    }
    while (status == OperationStatus.SUCCESS) {
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean findFirst() {
  try {
      OperationStatus status =
    cursor.getFirst(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean findNext() {
  try {
      OperationStatus status =
    cursor.getNext(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

    /** {@inheritDoc} */
    public boolean findNext(byte[] key) {
  DatabaseEntry searchEntry = new DatabaseEntry(key);
  try {
      OperationStatus status =
    cursor.getSearchKeyRange(searchEntry, valueEntry, null);
      if (status == SUCCESS) {
    keyEntry = searchEntry;
    isCurrent = true;
    return true;
View Full Code Here

    }

    /** {@inheritDoc} */
    public boolean findLast() {
  try {
      OperationStatus status =
    cursor.getLast(keyEntry, valueEntry, null);
      if (status == SUCCESS) {
    isCurrent = true;
    return true;
      } else if (status == NOTFOUND) {
View Full Code Here

    /** {@inheritDoc} */
    public boolean putNoOverwrite(byte[] key, byte[] value) {
  try {
      DatabaseEntry putKeyEntry = new DatabaseEntry(key);
      DatabaseEntry putValueEntry = new DatabaseEntry(value);
      OperationStatus status = cursor.putNoOverwrite(
    putKeyEntry, putValueEntry);
      if (status == SUCCESS) {
    isCurrent = true;
    keyEntry = putKeyEntry;
    valueEntry = putValueEntry;
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.