public java.lang.Object getFieldValue(_Fields field) { switch (field) { case FUNC_ARGS: return get_func_args(); case REQUEST_ID: return get_request_id(); } throw new java.lang.IllegalStateException(); }
@Override public void read(org.apache.storm.thrift.protocol.TProtocol prot, fetchRequest_result struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol iprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new DRPCRequest(); struct.success.read(iprot); struct.set_success_isSet(true); } if (incoming.get(1)) { struct.aze = new AuthorizationException(); struct.aze.read(iprot); struct.set_aze_isSet(true); } } }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof DRPCRequest) return this.equals((DRPCRequest)that); return false; }
/** * Performs a deep copy on <i>other</i>. */ public DRPCRequest(DRPCRequest other) { if (other.is_set_func_args()) { this.func_args = other.func_args; } if (other.is_set_request_id()) { this.request_id = other.request_id; } }
public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case FUNC_ARGS: if (value == null) { unset_func_args(); } else { set_func_args((java.lang.String)value); } break; case REQUEST_ID: if (value == null) { unset_request_id(); } else { set_request_id((java.lang.String)value); } break; } }
public void validate() throws org.apache.storm.thrift.TException { // check for required fields if (!is_set_func_args()) { throw new org.apache.storm.thrift.protocol.TProtocolException("Required field 'func_args' is unset! Struct:" + toString()); } if (!is_set_request_id()) { throw new org.apache.storm.thrift.protocol.TProtocolException("Required field 'request_id' is unset! Struct:" + toString()); } // check for sub-struct validity }
if (schemeField.type == org.apache.storm.thrift.protocol.TType.STRING) { struct.func_args = iprot.readString(); struct.set_func_args_isSet(true); } else { org.apache.storm.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.storm.thrift.protocol.TType.STRING) { struct.request_id = iprot.readString(); struct.set_request_id_isSet(true); } else { org.apache.storm.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
public String executeBlocking(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException { BlockingOutstandingRequest req = execute(functionName, funcArgs, BlockingOutstandingRequest.FACTORY); try { LOG.debug("Waiting for result {} {}", functionName, funcArgs); return req.getResult(); } catch (DRPCExecutionException e) { throw e; } finally { cleanup(req.getRequest().get_request_id()); } }
public DRPCRequest deepCopy() { return new DRPCRequest(this); }
@Override public void read(org.apache.storm.thrift.protocol.TProtocol prot, DRPCRequest struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol iprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; struct.func_args = iprot.readString(); struct.set_func_args_isSet(true); struct.request_id = iprot.readString(); struct.set_request_id_isSet(true); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.storm.thrift.protocol.TCompactProtocol(new org.apache.storm.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.storm.thrift.TException te) { throw new java.io.IOException(te); } }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((is_set_func_args()) ? 131071 : 524287); if (is_set_func_args()) hashCode = hashCode * 8191 + func_args.hashCode(); hashCode = hashCode * 8191 + ((is_set_request_id()) ? 131071 : 524287); if (is_set_request_id()) hashCode = hashCode * 8191 + request_id.hashCode(); return hashCode; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case FUNC_ARGS: if (value == null) { unset_func_args(); } else { set_func_args((String)value); } break; case REQUEST_ID: if (value == null) { unset_request_id(); } else { set_request_id((String)value); } break; } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!is_set_func_args()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'func_args' is unset! Struct:" + toString()); } if (!is_set_request_id()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'request_id' is unset! Struct:" + toString()); } // check for sub-struct validity }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.func_args = iprot.readString(); struct.set_func_args_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.request_id = iprot.readString(); struct.set_request_id_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
public <T extends OutstandingRequest> T execute(String functionName, String funcArgs, RequestFactory<T> factory) throws AuthorizationException { meterExecuteCalls.mark(); checkAuthorization("execute", functionName); String id = nextId(); LOG.debug("Execute {} {}", functionName, funcArgs); T req = factory.mkRequest(functionName, new DRPCRequest(funcArgs, id)); _requests.put(id, req); ConcurrentLinkedQueue<OutstandingRequest> q = getQueue(functionName); q.add(req); return req; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, DRPCRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.func_args = iprot.readString(); struct.set_func_args_isSet(true); struct.request_id = iprot.readString(); struct.set_request_id_isSet(true); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
if (req.get_request_id().length() > 0) { Map<String, Object> returnInfo = new HashMap<>(); returnInfo.put("id", req.get_request_id()); returnInfo.put("host", client.getHost()); returnInfo.put("port", client.getPort()); _collector.emit(new Values(req.get_func_args(), JSONValue.toJSONString(returnInfo)), new DRPCMessageId(req.get_request_id(), i)); break; try { DRPCRequest req = drpc.fetchRequest(_function); if (req.get_request_id().length() > 0) { Map<String, Object> returnInfo = new HashMap<>(); returnInfo.put("id", req.get_request_id()); returnInfo.put("host", _local_drpc_id); returnInfo.put("port", 0); _collector.emit(new Values(req.get_func_args(), JSONValue.toJSONString(returnInfo)), new DRPCMessageId(req.get_request_id(), 0));
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); } switch (field) { case FUNC_ARGS: return is_set_func_args(); case REQUEST_ID: return is_set_request_id(); } throw new java.lang.IllegalStateException(); }