Package tokyocabinet

Examples of tokyocabinet.BDBCUR.key()


      }   
    }
   
    //back one should be the input key, if it's not then the key
    //does not exist yet, so we add it
    if(!Arrays.equals(cursor.key(),key.getBytes())){
      if(!cursor.prev()){
        this.put(key, value);
        return;
      }
    }
View Full Code Here


      }
    }
   
    // the key under this cursor should match, if not we add a new key
    //based on input
    if(!Arrays.equals(cursor.key(),key.getBytes())){
      this.put(key, value);
      return;
    }
   
    //we are at the right spot, now append the value
View Full Code Here

     
    //move back one, to tail of the input key
    if(!cursor.prev())
      throw new RuntimeException("Key should exist but failed to jump to it's location");
   
    if(!Arrays.equals(cursor.key(),key.getBytes()))
      throw new TException("key mismatch "+key+" vs "+cursor.key2());
 
    byte[] value = cursor.val();
   
    //delete
View Full Code Here

      this.put(key, value);
      return;
    }
   
    //not matching key so add new
    if(!Arrays.equals(cursor.key(),key.getBytes())){
      this.put(key, value);
      return;
    }
   
    if(!cursor.put(value, BDBCUR.CPBEFORE))
View Full Code Here

    BDBCUR cursor = new BDBCUR(bdb);
   
    if(!cursor.jump(key))
      return new byte[]{};
   
    if(!Arrays.equals(cursor.key(),key.getBytes()))
      return new byte[]{};
 
   
    //save value
    byte[] value = cursor.val();
View Full Code Here

    while(currentPos < position){
      cursor.next();
     
      if(currentPos % checkMod == 0){
       
        if(!Arrays.equals(cursor.key(), key.getBytes()))
          return null;
       
      }
     
      currentPos++;
View Full Code Here

     
      currentPos++;
    }
   
    //at position
    if(!Arrays.equals(cursor.key(), key.getBytes()))
      return null;
   
   
    return cursor;
  }
View Full Code Here

    BDBCUR cursor = new BDBCUR(bdb);
   
    if(!cursor.jump(key))
      return 0;
   
    if(!Arrays.equals(cursor.key(),key.getBytes()))
      return 0;
   
    int length = 0;
    while(Arrays.equals(cursor.key(),key.getBytes())){
      length++;
View Full Code Here

   
    if(!Arrays.equals(cursor.key(),key.getBytes()))
      return 0;
   
    int length = 0;
    while(Arrays.equals(cursor.key(),key.getBytes())){
      length++;
     
      if(!cursor.next())
        return length;
    }
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.