コード例 #1
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
    public boolean equals(execute_result that) {
      if (that == null) return false;

      boolean this_present_success = true && this.is_set_success();
      boolean that_present_success = true && that.is_set_success();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success)) return false;
        if (!this.success.equals(that.success)) return false;
      }

      boolean this_present_e = true && this.is_set_e();
      boolean that_present_e = true && that.is_set_e();
      if (this_present_e || that_present_e) {
        if (!(this_present_e && that_present_e)) return false;
        if (!this.e.equals(that.e)) return false;
      }

      boolean this_present_aze = true && this.is_set_aze();
      boolean that_present_aze = true && that.is_set_aze();
      if (this_present_aze || that_present_aze) {
        if (!(this_present_aze && that_present_aze)) return false;
        if (!this.aze.equals(that.aze)) return false;
      }

      return true;
    }
コード例 #2
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
 /** Performs a deep copy on <i>other</i>. */
 public execute_result(execute_result other) {
   if (other.is_set_success()) {
     this.success = other.success;
   }
   if (other.is_set_e()) {
     this.e = new DRPCExecutionException(other.e);
   }
   if (other.is_set_aze()) {
     this.aze = new AuthorizationException(other.aze);
   }
 }
コード例 #3
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;
 }
コード例 #4
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
 public String recv_execute()
     throws DRPCExecutionException, AuthorizationException, org.apache.thrift.TException {
   execute_result result = new execute_result();
   receiveBase(result, "execute");
   if (result.is_set_success()) {
     return result.success;
   }
   if (result.e != null) {
     throw result.e;
   }
   if (result.aze != null) {
     throw result.aze;
   }
   throw new org.apache.thrift.TApplicationException(
       org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result");
 }
コード例 #5
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, execute_result struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.is_set_success()) {
     optionals.set(0);
   }
   if (struct.is_set_e()) {
     optionals.set(1);
   }
   if (struct.is_set_aze()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.is_set_success()) {
     oprot.writeString(struct.success);
   }
   if (struct.is_set_e()) {
     struct.e.write(oprot);
   }
   if (struct.is_set_aze()) {
     struct.aze.write(oprot);
   }
 }
コード例 #6
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
    @Override
    public int compareTo(execute_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_success()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_e()).compareTo(other.is_set_e());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_e()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_aze()).compareTo(other.is_set_aze());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_aze()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aze, other.aze);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }
コード例 #7
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();
 }
コード例 #8
0
ファイル: DistributedRPC.java プロジェクト: wangli1426/storm
      public void write(org.apache.thrift.protocol.TProtocol oprot, execute_result struct)
          throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeString(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.e != null) {
          oprot.writeFieldBegin(E_FIELD_DESC);
          struct.e.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.aze != null) {
          oprot.writeFieldBegin(AZE_FIELD_DESC);
          struct.aze.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }
コード例 #9
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);
   }
 }