/// <exception cref="System.IO.IOException"/> private void TestWrite(ExtendedBlock block, BlockConstructionStage stage, long newGS , string description, bool eofExcepted) { sendBuf.Reset(); recvBuf.Reset(); WriteBlock(block, stage, newGS, DefaultChecksum); if (eofExcepted) { SendResponse(DataTransferProtos.Status.Error, null, null, recvOut); SendRecvData(description, true); } else { if (stage == BlockConstructionStage.PipelineCloseRecovery) { //ok finally write a block with 0 len SendResponse(DataTransferProtos.Status.Success, string.Empty, null, recvOut); SendRecvData(description, false); } else { WriteZeroLengthPacket(block, description); } } }
/// <exception cref="System.IO.IOException"/> internal virtual void WriteBlock(ExtendedBlock block, BlockConstructionStage stage , long newGS, DataChecksum checksum) { sender.WriteBlock(block, StorageType.Default, BlockTokenSecretManager.DummyToken, "cl", new DatanodeInfo[1], new StorageType[1], null, stage, 0, block.GetNumBytes (), block.GetNumBytes(), newGS, checksum, CachingStrategy.NewDefaultStrategy(), false, false, null); }