예제 #1
0
        public Form1()
        {
            InitializeComponent();
            FM = new FormMgr(this);

            WindowMessages = Sender.AllWMMessages();
            SendMessageMessage.Items.AddRange(WindowMessages.ToArray());
            SendMessageResult.Text = "";

            Longs = Sender.AllGWLs();
            SetWindowLongIndex.Items.AddRange(Longs.ToArray());
            SetWindowLongLong_SingleSelect.Visible = true;
            SetWindowLongLong_MultiSelect.Visible  = false;
        }
예제 #2
0
        /// <exception cref="Com.Google.Protobuf.ServiceException"/>
        public virtual ClientDatanodeProtocolProtos.GetHdfsBlockLocationsResponseProto GetHdfsBlockLocations
            (RpcController controller, ClientDatanodeProtocolProtos.GetHdfsBlockLocationsRequestProto
            request)
        {
            HdfsBlocksMetadata resp;

            try
            {
                string poolId = request.GetBlockPoolId();
                IList <Org.Apache.Hadoop.Security.Token.Token <BlockTokenIdentifier> > tokens = new
                                                                                                AList <Org.Apache.Hadoop.Security.Token.Token <BlockTokenIdentifier> >(request.GetTokensCount
                                                                                                                                                                           ());
                foreach (SecurityProtos.TokenProto b in request.GetTokensList())
                {
                    tokens.AddItem(PBHelper.Convert(b));
                }
                long[] blockIds = Longs.ToArray(request.GetBlockIdsList());
                // Call the real implementation
                resp = impl.GetHdfsBlocksMetadata(poolId, blockIds, tokens);
            }
            catch (IOException e)
            {
                throw new ServiceException(e);
            }
            IList <ByteString> volumeIdsByteStrings = new AList <ByteString>(resp.GetVolumeIds(
                                                                                 ).Count);

            foreach (byte[] b_1 in resp.GetVolumeIds())
            {
                volumeIdsByteStrings.AddItem(ByteString.CopyFrom(b_1));
            }
            // Build and return the response
            ClientDatanodeProtocolProtos.GetHdfsBlockLocationsResponseProto.Builder builder =
                ClientDatanodeProtocolProtos.GetHdfsBlockLocationsResponseProto.NewBuilder();
            builder.AddAllVolumeIds(volumeIdsByteStrings);
            builder.AddAllVolumeIndexes(resp.GetVolumeIndexes());
            return((ClientDatanodeProtocolProtos.GetHdfsBlockLocationsResponseProto)builder.
                   Build());
        }