예제 #1
0
 /// <exception cref="System.IO.IOException"/>
 public override void WriteBlock(ExtendedBlock blk, StorageType storageType, Org.Apache.Hadoop.Security.Token.Token
                                 <BlockTokenIdentifier> blockToken, string clientName, DatanodeInfo[] targets, StorageType
                                 [] targetStorageTypes, DatanodeInfo source, BlockConstructionStage stage, int pipelineSize
                                 , long minBytesRcvd, long maxBytesRcvd, long latestGenerationStamp, DataChecksum
                                 requestedChecksum, CachingStrategy cachingStrategy, bool allowLazyPersist, bool
                                 pinning, bool[] targetPinnings)
 {
     DataTransferProtos.ClientOperationHeaderProto header = DataTransferProtoUtil.BuildClientHeader
                                                                (blk, clientName, blockToken);
     DataTransferProtos.ChecksumProto checksumProto = DataTransferProtoUtil.ToProto(requestedChecksum
                                                                                    );
     DataTransferProtos.OpWriteBlockProto.Builder proto = DataTransferProtos.OpWriteBlockProto
                                                          .NewBuilder().SetHeader(header).SetStorageType(PBHelper.ConvertStorageType(storageType
                                                                                                                                     )).AddAllTargets(PBHelper.Convert(targets, 1)).AddAllTargetStorageTypes(PBHelper
                                                                                                                                                                                                             .ConvertStorageTypes(targetStorageTypes, 1)).SetStage(DataTransferProtoUtil.ToProto
                                                                                                                                                                                                                                                                       (stage)).SetPipelineSize(pipelineSize).SetMinBytesRcvd(minBytesRcvd).SetMaxBytesRcvd
                                                              (maxBytesRcvd).SetLatestGenerationStamp(latestGenerationStamp).SetRequestedChecksum
                                                              (checksumProto).SetCachingStrategy(GetCachingStrategy(cachingStrategy)).SetAllowLazyPersist
                                                              (allowLazyPersist).SetPinning(pinning).AddAllTargetPinnings(PBHelper.Convert(targetPinnings
                                                                                                                                           , 1));
     if (source != null)
     {
         proto.SetSource(PBHelper.ConvertDatanodeInfo(source));
     }
     Send(@out, OP.WriteBlock, ((DataTransferProtos.OpWriteBlockProto)proto.Build()));
 }
예제 #2
0
 /// <exception cref="System.IO.IOException"/>
 public override void ReplaceBlock(ExtendedBlock blk, StorageType storageType, Org.Apache.Hadoop.Security.Token.Token
                                   <BlockTokenIdentifier> blockToken, string delHint, DatanodeInfo source)
 {
     DataTransferProtos.OpReplaceBlockProto proto = ((DataTransferProtos.OpReplaceBlockProto
                                                      )DataTransferProtos.OpReplaceBlockProto.NewBuilder().SetHeader(DataTransferProtoUtil
                                                                                                                     .BuildBaseHeader(blk, blockToken)).SetStorageType(PBHelper.ConvertStorageType(storageType
                                                                                                                                                                                                   )).SetDelHint(delHint).SetSource(PBHelper.ConvertDatanodeInfo(source)).Build());
     Send(@out, OP.ReplaceBlock, proto);
 }