Package com.caucho.db.block

Examples of com.caucho.db.block.Block.free()


      try {
        if (! removeRead(rootBlock, keyBuffer, keyOffset, keyLength)) {
          removeWrite(rootBlock, keyBuffer, keyOffset, keyLength);
        }
      } finally {
  rootBlock.free();
      }
    } catch (IOException e) {
      throw new SQLExceptionWrapper(e.toString(), e);
    }
  }
View Full Code Here


      Block ptr = _store.readBlock(_store.addressToBlockId(ptrAddr));

      addr = readLong(ptr.getBuffer(), 8 * (blockCount - INODE_DIRECT_BLOCKS));

      ptr.free();
    }

    _block = _store.readBlock(_store.addressToBlockId(addr));
    _buffer = _block.getBuffer();

View Full Code Here

        if (removeRead(childBlock, keyBuffer, keyOffset, keyLength))
          return true;
        else
          return removeWrite(childBlock, keyBuffer, keyOffset, keyLength);
      } finally {
        childBlock.free();
      }
    } finally {
      blockLock.unlockRead();
    }
  }
View Full Code Here

            childBlock.deallocate();
          }

          validate(block);
        } finally {
          childBlock.free();
        }
      }
     
      return _minN <= getLength(buffer);
    } finally {
View Full Code Here

          }
        } finally {
          leftLock.unlockReadAndWrite();
        }
      } finally {
        leftBlock.free();
      }
    }

    // If the right block has extra data, shift the first right item
    // to the block
View Full Code Here

          }
        } finally {
          blockLock.unlockReadAndWrite();
        }
      } finally {
        rightBlock.free();
      }
    }

    if (parentLength < 2)
      return false;
View Full Code Here

          }
        } finally {
          leftLock.unlockReadAndWrite();
        }
      } finally {
        leftBlock.free();
      }
    }
   
    // If the right block has space, merge with it
    if (rightBlockId > 0) {
View Full Code Here

          }
        } finally {
          blockLock.unlockReadAndWrite();
        }
      } finally {
        rightBlock.free();
      }
    }

    // XXX: error
View Full Code Here

      keys.add(_keyCompare.toString(buffer,
            offset + i * tupleSize + PTR_SIZE,
            tupleSize - PTR_SIZE));
    }

    block.free();
   
    return keys;
  }
 
  /**
 
View Full Code Here

        Block block = store.allocateBlock();

        long blockAddr = BlockStore.blockIdToAddress(block.getBlockId());

        block.free();

        if (blockAddr == 0) {
          store.setCorrupted(true);

          throw new IllegalStateException(L.l("{0}: illegal block",
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.