コード例 #1
0
 @Override
 protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
     throws org.apache.thrift.TException {
   switch (setField_) {
     case BOLT:
       BoltStats bolt = (BoltStats) value_;
       bolt.write(oprot);
       return;
     case SPOUT:
       SpoutStats spout = (SpoutStats) value_;
       spout.write(oprot);
       return;
     default:
       throw new IllegalStateException("Cannot write union with unknown field " + setField_);
   }
 }
コード例 #2
0
 @Override
 protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(fieldID);
   if (setField != null) {
     switch (setField) {
       case BOLT:
         BoltStats bolt;
         bolt = new BoltStats();
         bolt.read(iprot);
         return bolt;
       case SPOUT:
         SpoutStats spout;
         spout = new SpoutStats();
         spout.read(iprot);
         return spout;
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     throw new TProtocolException("Couldn't find a field with field id " + fieldID);
   }
 }
コード例 #3
0
 @Override
 protected Object standardSchemeReadValue(
     org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(field.id);
   if (setField != null) {
     switch (setField) {
       case BOLT:
         if (field.type == BOLT_FIELD_DESC.type) {
           BoltStats bolt;
           bolt = new BoltStats();
           bolt.read(iprot);
           return bolt;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case SPOUT:
         if (field.type == SPOUT_FIELD_DESC.type) {
           SpoutStats spout;
           spout = new SpoutStats();
           spout.read(iprot);
           return spout;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     return null;
   }
 }