public static HankException no_replica(boolean value) { HankException x = new HankException(); x.set_no_replica(value); return x; }
public boolean equals(Object other) { if (other instanceof HankException) { return equals((HankException)other); } else { return false; } }
/** * There was no replica for a given partition */ public boolean get_no_replica() { if (getSetField() == _Fields.NO_REPLICA) { return (Boolean)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'no_replica' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public static HankException failed_retries(int value) { HankException x = new HankException(); x.set_failed_retries(value); return x; }
public static HankException no_such_domain(boolean value) { HankException x = new HankException(); x.set_no_such_domain(value); return x; }
@Override public HankResponse get(String domainName, ByteBuffer key) { Map<ByteBuffer, HankResponse> domain; domain = storage.get(domainName); if (domain == null) { return HankResponse.xception(HankException.internal_error("Could not find domain '" + domainName + "'")); } HankResponse result = domain.get(key); if (result == null) { return HankResponse.not_found(true); } else { return result; } }
if (field.type == XCEPTION_FIELD_DESC.type) { HankException xception; xception = new HankException(); xception.read(iprot); return xception; } else {
@Override public int compareTo(HankException other) { int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); if (lastComparison == 0) { return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); } return lastComparison; }
public static HankException wrong_host(boolean value) { HankException x = new HankException(); x.set_wrong_host(value); return x; }
public static HankException internal_error(String value) { HankException x = new HankException(); x.set_internal_error(value); return x; }
public static HankException no_connection_available(boolean value) { HankException x = new HankException(); x.set_no_connection_available(value); return x; }
public HankException deepCopy() { return new HankException(this); }
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); } }
+ ", Domain = " + domain.getName() + ", Key = " + BytesUtils.bytesToHexString(key), e); return HankResponse.xception(HankException.failed_retries(maxNumTries));
public HankResponse getResponse() { try { this.get(); } catch (Throwable t) { String errMsg = "Throwable while executing future GET: " + t.toString(); LOG.error(errMsg, t); return HankResponse.xception(HankException.internal_error(errMsg)); } return runnable.getResponse(); } }
@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 NOT_FOUND: Boolean not_found; not_found = iprot.readBool(); return not_found; case VALUE: ByteBuffer value; value = iprot.readBinary(); return value; case XCEPTION: HankException xception; xception = new HankException(); xception.read(iprot); return xception; 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); } }
public boolean equals(HankException other) { return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); }
/** * There were no available connections for a given partition */ public boolean get_no_connection_available() { if (getSetField() == _Fields.NO_CONNECTION_AVAILABLE) { return (Boolean)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'no_connection_available' because union is currently set to " + getFieldDesc(getSetField()).name); } }
private HankResponse _get(PartitionServerHandler partitionServerHandler, int domainId, ByteBuffer key, ReaderResult result) { DomainAccessor domainAccessor = partitionServerHandler.getDomainAccessor(domainId); if (domainAccessor == null) { return NO_SUCH_DOMAIN; } try { return domainAccessor.get(key, result); } catch (IOException e) { String errMsg = String.format( "Exception during GET. Domain: %s (domain #%d) Key: %s", domainAccessor.getName(), domainId, BytesUtils.bytesToHexString(key)); LOG.error(errMsg, e); return HankResponse.xception( HankException.internal_error(errMsg + " " + (e.getMessage() != null ? e.getMessage() : ""))); } catch (Throwable t) { String errMsg = "Throwable during GET"; LOG.error(errMsg, t); return HankResponse.xception( HankException.internal_error(errMsg + " " + (t.getMessage() != null ? t.getMessage() : ""))); } }
if (field.type == XCEPTION_FIELD_DESC.type) { HankException xception; xception = new HankException(); xception.read(iprot); return xception; } else {