Exemple #1
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerSummary 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: // PORT
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.port = iprot.readI32();
           struct.set_port_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // UPTIME
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.uptime = iprot.readI32();
           struct.set_uptime_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // TOPOLOGY
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.topology = iprot.readString();
           struct.set_topology_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // TASKS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list98 = iprot.readListBegin();
             struct.tasks = new ArrayList<TaskComponent>(_list98.size);
             TaskComponent _elem99;
             for (int _i100 = 0; _i100 < _list98.size; ++_i100) {
               _elem99 = new TaskComponent();
               _elem99.read(iprot);
               struct.tasks.add(_elem99);
             }
             iprot.readListEnd();
           }
           struct.set_tasks_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();
 }
 @Override
 public void clear() {
   set_port_isSet(false);
   this.port = 0;
   this.topology = null;
   this.tasks = null;
 }
 public WorkerSummary(int port, String topology, List<TaskSummary> tasks) {
   this();
   this.port = port;
   set_port_isSet(true);
   this.topology = topology;
   this.tasks = tasks;
 }
Exemple #4
0
 public WorkerSummary(int port, int uptime, String topology, List<TaskComponent> tasks) {
   this();
   this.port = port;
   set_port_isSet(true);
   this.uptime = uptime;
   set_uptime_isSet(true);
   this.topology = topology;
   this.tasks = tasks;
 }
 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (field.id) {
       case 1: // PORT
         if (field.type == org.apache.thrift.protocol.TType.I32) {
           this.port = iprot.readI32();
           set_port_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2: // TOPOLOGY
         if (field.type == org.apache.thrift.protocol.TType.STRING) {
           this.topology = iprot.readString();
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 3: // TASKS
         if (field.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list193 = iprot.readListBegin();
             this.tasks = new ArrayList<TaskSummary>(_list193.size);
             for (int _i194 = 0; _i194 < _list193.size; ++_i194) {
               TaskSummary _elem195; // required
               _elem195 = new TaskSummary();
               _elem195.read(iprot);
               this.tasks.add(_elem195);
             }
             iprot.readListEnd();
           }
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
Exemple #6
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, WorkerSummary struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.port = iprot.readI32();
   struct.set_port_isSet(true);
   struct.uptime = iprot.readI32();
   struct.set_uptime_isSet(true);
   struct.topology = iprot.readString();
   struct.set_topology_isSet(true);
   {
     org.apache.thrift.protocol.TList _list103 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.tasks = new ArrayList<TaskComponent>(_list103.size);
     TaskComponent _elem104;
     for (int _i105 = 0; _i105 < _list103.size; ++_i105) {
       _elem104 = new TaskComponent();
       _elem104.read(iprot);
       struct.tasks.add(_elem104);
     }
   }
   struct.set_tasks_isSet(true);
 }
Exemple #7
0
 public void set_port(int port) {
   this.port = port;
   set_port_isSet(true);
 }