@Override public RpcFuture<RpcGetBlock> getBlock(long fd, long token, long position, long capacity) throws IOException { int index = computeIndex(fd); // LOG.info("issuing get block for fd [" + fd + "], on index " + index); return connections[index].getBlock(fd, token, position, capacity); }
@Override public RpcFuture<RpcRenameFile> renameFile(FileName srcHash, FileName dstHash) throws IOException { int srcIndex = computeIndex(srcHash.getComponent(0)); int dstIndex = computeIndex(srcHash.getComponent(0)); // LOG.info("issuing remove file for src [" + srcHash.toString() + "," + dstHash.toString() + "], on index " + srcIndex); if (srcIndex != dstIndex){ throw new IOException("Rename not supported across namenode domains"); } else { return connections[srcIndex].renameFile(srcHash, dstHash); } }
@Override public RpcFuture<RpcGetFile> getFile(FileName filename, boolean writeable) throws IOException { int index = computeIndex(filename.getComponent(0)); // LOG.info("issuing get file for filename [" + filename.toString() + "], on index " + index); return connections[index].getFile(filename, writeable); }
@Override public RpcFuture<RpcGetLocation> getLocation(FileName fileName, long position) throws IOException { int index = computeIndex(fileName.getComponent(0)); // LOG.info("issuing get location for filename [" + fileName.toString() + "], on index " + index); return connections[index].getLocation(fileName, position); }
@Override public RpcFuture<RpcDeleteFile> removeFile(FileName filename, boolean recursive) throws IOException { int index = computeIndex(filename.getComponent(0)); // LOG.info("issuing remove file for filename [" + filename.toString() + "], on index " + index); return connections[index].removeFile(filename, recursive); }
@Override public RpcFuture<RpcCreateFile> createFile(FileName filename, CrailNodeType type, int storageClass, int locationClass) throws IOException { int index = computeIndex(filename.getComponent(0)); // LOG.info("issuing create file for filename [" + filename.toString() + "], on index " + index); return connections[index].createFile(filename, type, storageClass, locationClass); }
@Override public RpcFuture<RpcVoid> setFile(FileInfo fileInfo, boolean close) throws IOException { int index = computeIndex(fileInfo.getFd()); // LOG.info("issuing set file for fd [" + fileInfo.getFd() + "], on index " + index); return connections[index].setFile(fileInfo, close); }