Exemplo n.º 1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ClusterWorkerHeartbeat struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.storm_id = iprot.readString();
   struct.set_storm_id_isSet(true);
   {
     org.apache.thrift.protocol.TMap _map614 =
         new org.apache.thrift.protocol.TMap(
             org.apache.thrift.protocol.TType.STRUCT,
             org.apache.thrift.protocol.TType.STRUCT,
             iprot.readI32());
     struct.executor_stats = new HashMap<ExecutorInfo, ExecutorStats>(2 * _map614.size);
     ExecutorInfo _key615;
     ExecutorStats _val616;
     for (int _i617 = 0; _i617 < _map614.size; ++_i617) {
       _key615 = new ExecutorInfo();
       _key615.read(iprot);
       _val616 = new ExecutorStats();
       _val616.read(iprot);
       struct.executor_stats.put(_key615, _val616);
     }
   }
   struct.set_executor_stats_isSet(true);
   struct.time_secs = iprot.readI32();
   struct.set_time_secs_isSet(true);
   struct.uptime_secs = iprot.readI32();
   struct.set_uptime_secs_isSet(true);
 }
Exemplo n.º 2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, ClusterWorkerHeartbeat struct)
     throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField schemeField;
   iprot.readStructBegin();
   while (true) {
     schemeField = iprot.readFieldBegin();
     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (schemeField.id) {
       case 1: // STORM_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.storm_id = iprot.readString();
           struct.set_storm_id_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // EXECUTOR_STATS
         if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
           {
             org.apache.thrift.protocol.TMap _map608 = iprot.readMapBegin();
             struct.executor_stats = new HashMap<ExecutorInfo, ExecutorStats>(2 * _map608.size);
             ExecutorInfo _key609;
             ExecutorStats _val610;
             for (int _i611 = 0; _i611 < _map608.size; ++_i611) {
               _key609 = new ExecutorInfo();
               _key609.read(iprot);
               _val610 = new ExecutorStats();
               _val610.read(iprot);
               struct.executor_stats.put(_key609, _val610);
             }
             iprot.readMapEnd();
           }
           struct.set_executor_stats_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // TIME_SECS
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.time_secs = iprot.readI32();
           struct.set_time_secs_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // UPTIME_SECS
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.uptime_secs = iprot.readI32();
           struct.set_uptime_secs_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   struct.validate();
 }