* @throws IOException
*/
private void replaceBlock(DataInputStream in,
VersionAndOpcode versionAndOpcode) throws IOException {
long startTime = System.currentTimeMillis();
ReplaceBlockHeader replaceBlockHeader =
new ReplaceBlockHeader(versionAndOpcode);
/* read header */
replaceBlockHeader.readFields(in);
int namespaceId = replaceBlockHeader.getNamespaceId();
long blockId = replaceBlockHeader.getBlockId();
long genStamp = replaceBlockHeader.getGenStamp();
Block block = new Block(blockId, dataXceiverServer.estimateBlockSize,
genStamp);
String sourceID = replaceBlockHeader.getSourceID();
DatanodeInfo proxySource = replaceBlockHeader.getProxySource();
if (!dataXceiverServer.balanceThrottler.acquire()) { // not able to start
LOG.warn("Not able to receive block " + blockId + " from "
+ s.getRemoteSocketAddress() + " because threads quota is exceeded.");
sendResponse(s, (short)DataTransferProtocol.OP_STATUS_ERROR,