Exemple #1
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_serverName = false;
                bool   isset_regionInfo = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            ServerName = new TServerName();
                            ServerName.Read(iprot);
                            isset_serverName = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            RegionInfo = new THRegionInfo();
                            RegionInfo.Read(iprot);
                            isset_regionInfo = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_serverName)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ServerName not set");
                }
                if (!isset_regionInfo)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "required field RegionInfo not set");
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Exemple #2
0
 public THRegionLocation(TServerName serverName, THRegionInfo regionInfo) : this()
 {
     this.ServerName = serverName;
     this.RegionInfo = regionInfo;
 }