private int loadTable(long uuid) throws IOException {
  int bufferIndex=-1;
  Set<Long> uuids=null;
  int blockIndex=_blocks.size() - 1;
  TableBlock lastBlock=_blocks.get(blockIndex);
  while (bufferIndex == -1) {
    Pair<Integer,Set<Long>> bufferIndexAndUuuids=lastBlock.writeTable(uuid);
    bufferIndex=bufferIndexAndUuuids.left;
    if (bufferIndex == -1) {
      blockIndex++;
      lastBlock=new TableBlock(blockIndex * _blockSize);
      _blocks.add(lastBlock);
    }
 else {
      uuids=bufferIndexAndUuuids.right;
    }
  }
  int index=toIndex(blockIndex,bufferIndex);
  for (  Long tableUuid : uuids) {
    _fileIndexByUuid.put(tableUuid,index);
  }
  return index;
}

private int loadTable ( long uuid ) throws IOException { int bufferIndex = - 1 ; Set < Long > uuids = null ; int blockIndex = _blocks . size ( ) - 1 ; TableBlock lastBlock = _blocks . get ( blockIndex ) ; while ( bufferIndex == - 1 ) { Pair < Integer , Set < Long > > bufferIndexAndUuuids = lastBlock . writeTable ( uuid ) ; bufferIndex = bufferIndexAndUuuids . left ; if ( bufferIndex == - 1 ) { blockIndex ++ ; lastBlock = new TableBlock ( blockIndex * _blockSize ) ; _blocks . add ( lastBlock ) ; } else { uuids = bufferIndexAndUuuids . right ; } } int index = toIndex ( blockIndex , bufferIndex ) ; for ( Long tableUuid : uuids ) { _fileIndexByUuid . put ( tableUuid , index ) ; } return index ; }
loads a table from the source and places it into the next available space in the table blocks . once the table is written it returns the index where the table is located for future reads .
