Esempio n. 1
0
        /// <summary>Receive OP_WRITE_BLOCK</summary>
        /// <exception cref="System.IO.IOException"/>
        private void OpWriteBlock(DataInputStream @in)
        {
            DataTransferProtos.OpWriteBlockProto proto = DataTransferProtos.OpWriteBlockProto
                                                         .ParseFrom(PBHelper.VintPrefixed(@in));
            DatanodeInfo[] targets    = PBHelper.Convert(proto.GetTargetsList());
            TraceScope     traceScope = DataTransferProtoUtil.ContinueTraceSpan(proto.GetHeader()
                                                                                , proto.GetType().Name);

            try
            {
                WriteBlock(PBHelper.Convert(proto.GetHeader().GetBaseHeader().GetBlock()), PBHelper
                           .ConvertStorageType(proto.GetStorageType()), PBHelper.Convert(proto.GetHeader().
                                                                                         GetBaseHeader().GetToken()), proto.GetHeader().GetClientName(), targets, PBHelper
                           .ConvertStorageTypes(proto.GetTargetStorageTypesList(), targets.Length), PBHelper
                           .Convert(proto.GetSource()), DataTransferProtoUtil.FromProto(proto.GetStage()),
                           proto.GetPipelineSize(), proto.GetMinBytesRcvd(), proto.GetMaxBytesRcvd(), proto
                           .GetLatestGenerationStamp(), DataTransferProtoUtil.FromProto(proto.GetRequestedChecksum
                                                                                            ()), (proto.HasCachingStrategy() ? GetCachingStrategy(proto.GetCachingStrategy()
                                                                                                                                                  ) : CachingStrategy.NewDefaultStrategy()), (proto.HasAllowLazyPersist() ? proto.
                                                                                                                                                                                              GetAllowLazyPersist() : false), (proto.HasPinning() ? proto.GetPinning() : false
                                                                                                                                                                                                                               ), (PBHelper.ConvertBooleanList(proto.GetTargetPinningsList())));
            }
            finally
            {
                if (traceScope != null)
                {
                    traceScope.Close();
                }
            }
        }