@Override public void read(org.apache.thrift.protocol.TProtocol prot, jobDone_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.ex = new WorkerNameNotFoundException(); struct.ex.read(iprot); struct.setExIsSet(true); } } }
public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case WORKER_NAME: if (value == null) { unsetWorkerName(); } else { setWorkerName((java.lang.String)value); } break; } }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof WorkerNameNotFoundException) return this.equals((WorkerNameNotFoundException)that); return false; }
public void write(org.apache.thrift.protocol.TProtocol oprot, WorkerNameNotFoundException struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.workerName != null) { if (struct.isSetWorkerName()) { oprot.writeFieldBegin(WORKER_NAME_FIELD_DESC); oprot.writeString(struct.workerName); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public Job submitJob(Job job, String worker, int retryLimit) throws TException { LOGGER.info("submitJob {}", worker); Job[] result = new Job[1]; if (!service.getSessionMap().containsWorker(worker)) { throw new WorkerNameNotFoundException().setWorkerName(worker); } service.getSessionMap().lockSessionAndExecute(worker, session -> { session.jobQueue.add(new SingleJob(job, job1 -> { synchronized (result) { result[0] = job1; result.notifyAll(); } }, jobIdCounter, retryLimit)); return null; }); synchronized (result) { while (result[0] == null) { try { result.wait(); } catch (InterruptedException exception) { throw new TException(exception); } } } return result[0]; }
public WorkerNameNotFoundException deepCopy() { return new WorkerNameNotFoundException(this); }
/** * Performs a deep copy on <i>other</i>. */ public WorkerNameNotFoundException(WorkerNameNotFoundException other) { if (other.isSetWorkerName()) { this.workerName = other.workerName; } }
public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerNameNotFoundException 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: // WORKER_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.workerName = iprot.readString(); struct.setWorkerNameIsSet(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(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) hashCode = hashCode * 8191 + ex.hashCode(); return hashCode; }
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case WORKER_NAME: return getWorkerName(); } throw new java.lang.IllegalStateException(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.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); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, WorkerNameNotFoundException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.workerName = iprot.readString(); struct.setWorkerNameIsSet(true); } } }
throw new WorkerNameNotFoundException().setWorkerName(worker);
/** * Performs a deep copy on <i>other</i>. */ public jobDone_result(jobDone_result other) { if (other.isSetEx()) { this.ex = new WorkerNameNotFoundException(other.ex); } }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetWorkerName()) ? 131071 : 524287); if (isSetWorkerName()) hashCode = hashCode * 8191 + workerName.hashCode(); return hashCode; }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); if (isSetSuccess()) hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) hashCode = hashCode * 8191 + ex.hashCode(); return hashCode; }
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); }
throw new WorkerNameNotFoundException().setWorkerName(worker);
public void read(org.apache.thrift.protocol.TProtocol iprot, jobDone_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 1: // EX if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ex = new WorkerNameNotFoundException(); struct.ex.read(iprot); struct.setExIsSet(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(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); }