Exemplo n.º 1
0
  @Override
  public List<Block> getBlocksInTheSameRegion(Block block) {

    int bufferId =
        assignor.assign(block.getBlockId(), block.getPrimaryDiskId(), block.getReplicaLevel());

    BufferRegion region = getBufferRegion(bufferId, block.getReplicaLevel());

    return region.getBufferedBlocks();
  }
Exemplo n.º 2
0
  @Override
  public Block write(Block block) {

    int bufferId =
        assignor.assign(block.getBlockId(), block.getPrimaryDiskId(), block.getReplicaLevel());

    BufferRegion region = getBufferRegion(bufferId, block.getReplicaLevel());

    return region.write(block);
  }
Exemplo n.º 3
0
  @Override
  public Block remove(Block block) {

    if (block == null) return null;

    int bufferId =
        assignor.assign(block.getBlockId(), block.getPrimaryDiskId(), block.getReplicaLevel());

    BufferRegion region = getBufferRegion(bufferId, block.getReplicaLevel());

    return region.remove(block.getBlockId());
  }
Exemplo n.º 4
0
 @Override
 public int getCorrespondingBufferId(Block block) {
   return assignor.assign(block.getBlockId(), block.getPrimaryDiskId(), block.getReplicaLevel());
 }