Package tokyocabinet

Examples of tokyocabinet.BDBCUR.jump()


        throw new RuntimeException("Can't jump to last record");
    }else{
   
      //jump to key ahead of our input key
      if(nextKey.size() == 1){   
        if(!cursor.jump(nextKey.get(0)))
          throw new RuntimeException("Key should exist but failed to jump to it's location");       
      } else {
        if(!cursor.jump(nextKey.get(1)))
          throw new RuntimeException("Key should exist but failed to jump to it's location");
      }   
View Full Code Here


      //jump to key ahead of our input key
      if(nextKey.size() == 1){   
        if(!cursor.jump(nextKey.get(0)))
          throw new RuntimeException("Key should exist but failed to jump to it's location");       
      } else {
        if(!cursor.jump(nextKey.get(1)))
          throw new RuntimeException("Key should exist but failed to jump to it's location");
      }   
    }
   
    //back one should be the input key, if it's not then the key
View Full Code Here

      if(!cursor.last())
        throw new RuntimeException("Unable to jump to last key");
     
    } else {
     
      if(!cursor.jump(nextKey.get(1)))
        throw new RuntimeException("Key should exist but failed to jump to it's location");
     
    }
   
     
View Full Code Here

 
  public void push_front(String key, byte[] value) throws TException {

    BDBCUR cursor = new BDBCUR(bdb);
   
    if(!cursor.jump(key)){
      this.put(key, value);
      return;
    }
   
    //not matching key so add new
View Full Code Here

 
  public byte[] pop_front(String key) throws TException{
   
    BDBCUR cursor = new BDBCUR(bdb);
   
    if(!cursor.jump(key))
      return new byte[]{};
   
    if(!Arrays.equals(cursor.key(),key.getBytes()))
      return new byte[]{};
 
View Full Code Here

    if(position < 0)
      return null;
   
    BDBCUR cursor = new BDBCUR(bdb);
   
    if(!cursor.jump(key))
      return null;
   
    int currentPos = 0;
    int checkMod = 10; //verify key every few records
    while(currentPos < position){
View Full Code Here

  }
 
  public int length(String key) {
    BDBCUR cursor = new BDBCUR(bdb);
   
    if(!cursor.jump(key))
      return 0;
   
    if(!Arrays.equals(cursor.key(),key.getBytes()))
      return 0;
   
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.