コード例 #1
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
 public execute_result getResult(I iface, execute_args args)
     throws org.apache.thrift.TException {
   execute_result result = new execute_result();
   try {
     result.success = iface.execute(args.functionName, args.funcArgs);
   } catch (DRPCExecutionException e) {
     result.e = e;
   } catch (AuthorizationException aze) {
     result.aze = aze;
   }
   return result;
 }
コード例 #2
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
 public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result 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 0: // SUCCESS
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.success = iprot.readString();
           struct.set_success_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 1: // E
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.e = new DRPCExecutionException();
           struct.e.read(iprot);
           struct.set_e_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // AZE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.aze = new AuthorizationException();
           struct.aze.read(iprot);
           struct.set_aze_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();
 }
コード例 #3
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, execute_result struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.success = iprot.readString();
     struct.set_success_isSet(true);
   }
   if (incoming.get(1)) {
     struct.e = new DRPCExecutionException();
     struct.e.read(iprot);
     struct.set_e_isSet(true);
   }
   if (incoming.get(2)) {
     struct.aze = new AuthorizationException();
     struct.aze.read(iprot);
     struct.set_aze_isSet(true);
   }
 }