diff --git a/core/src/main/java/org/apache/accumulo/core/util/cache/Caches.java b/core/src/main/java/org/apache/accumulo/core/util/cache/Caches.java index 7eb0b5929c6..05e23215ad2 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/cache/Caches.java +++ b/core/src/main/java/org/apache/accumulo/core/util/cache/Caches.java @@ -37,7 +37,6 @@ public enum CacheName { BULK_IMPORT_FILE_LENGTHS, CLASSLOADERS, COMBINER_LOGGED_MSGS, - COMPACTIONS_COMPLETED, COMPACTION_CONFIGS, COMPACTOR_COUNTS, COMPACTION_DIR_CACHE, diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactionCoordinatorService.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactionCoordinatorService.java index 734d7f9027c..008869646ce 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactionCoordinatorService.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactionCoordinatorService.java @@ -39,8 +39,6 @@ public interface Iface { public TExternalCompactionMap getRunningCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; - public TExternalCompactionMap getCompletedCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; - public void cancel(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; public void recordCompletion(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId) throws org.apache.thrift.TException; @@ -59,8 +57,6 @@ public interface AsyncIface { public void getRunningCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void getCompletedCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void cancel(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void recordCompletion(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -248,37 +244,6 @@ public TExternalCompactionMap recv_getRunningCompactions() throws org.apache.acc throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRunningCompactions failed: unknown result"); } - @Override - public TExternalCompactionMap getCompletedCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException - { - send_getCompletedCompactions(tinfo, credentials); - return recv_getCompletedCompactions(); - } - - public void send_getCompletedCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.thrift.TException - { - getCompletedCompactions_args args = new getCompletedCompactions_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - sendBase("getCompletedCompactions", args); - } - - public TExternalCompactionMap recv_getCompletedCompactions() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException - { - getCompletedCompactions_result result = new getCompletedCompactions_result(); - receiveBase(result, "getCompletedCompactions"); - if (result.isSetSuccess()) { - return result.success; - } - if (result.sec != null) { - throw result.sec; - } - if (result.tnase != null) { - throw result.tnase; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCompletedCompactions failed: unknown result"); - } - @Override public void cancel(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { @@ -574,44 +539,6 @@ public TExternalCompactionMap getResult() throws org.apache.accumulo.core.client } } - @Override - public void getCompletedCompactions(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getCompletedCompactions_call method_call = new getCompletedCompactions_call(tinfo, credentials, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getCompletedCompactions_call extends org.apache.thrift.async.TAsyncMethodCall { - private org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo; - private org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials; - public getCompletedCompactions_call(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.tinfo = tinfo; - this.credentials = credentials; - } - - @Override - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCompletedCompactions", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getCompletedCompactions_args args = new getCompletedCompactions_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.write(prot); - prot.writeMessageEnd(); - } - - @Override - public TExternalCompactionMap getResult() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getCompletedCompactions(); - } - } - @Override public void cancel(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -713,7 +640,6 @@ protected Processor(I iface, java.util.Map extends org.apache.thrift.ProcessFunction { - public getCompletedCompactions() { - super("getCompletedCompactions"); - } - - @Override - public getCompletedCompactions_args getEmptyArgsInstance() { - return new getCompletedCompactions_args(); - } - - @Override - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - @Override - public getCompletedCompactions_result getResult(I iface, getCompletedCompactions_args args) throws org.apache.thrift.TException { - getCompletedCompactions_result result = new getCompletedCompactions_result(); - try { - result.success = iface.getCompletedCompactions(args.tinfo, args.credentials); - } catch (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec) { - result.sec = sec; - } catch (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) { - result.tnase = tnase; - } - return result; - } - } - public static class cancel extends org.apache.thrift.ProcessFunction { public cancel() { super("cancel"); @@ -1002,7 +894,6 @@ protected AsyncProcessor(I iface, java.util.Map extends org.apache.thrift.AsyncProcessFunction { - public getCompletedCompactions() { - super("getCompletedCompactions"); - } - - @Override - public getCompletedCompactions_args getEmptyArgsInstance() { - return new getCompletedCompactions_args(); - } - - @Override - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - @Override - public void onComplete(TExternalCompactionMap o) { - getCompletedCompactions_result result = new getCompletedCompactions_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - @Override - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - getCompletedCompactions_result result = new getCompletedCompactions_result(); - if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) { - result.sec = (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) e; - result.setSecIsSet(true); - msg = result; - } else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) { - result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e; - result.setTnaseIsSet(true); - msg = result; - } else if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - @Override - protected boolean isOneway() { - return false; - } - - @Override - public void start(I iface, getCompletedCompactions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.getCompletedCompactions(args.tinfo, args.credentials,resultHandler); - } - } - public static class cancel extends org.apache.thrift.AsyncProcessFunction { public cancel() { super("cancel"); @@ -8092,1097 +7908,6 @@ private static S scheme(org.apache. } } - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) - public static class getCompletedCompactions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompletedCompactions_args"); - - private static final org.apache.thrift.protocol.TField TINFO_FIELD_DESC = new org.apache.thrift.protocol.TField("tinfo", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CREDENTIALS_FIELD_DESC = new org.apache.thrift.protocol.TField("credentials", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getCompletedCompactions_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getCompletedCompactions_argsTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo; // required - public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - TINFO((short)1, "tinfo"), - CREDENTIALS((short)2, "credentials"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TINFO - return TINFO; - case 2: // CREDENTIALS - return CREDENTIALS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - @Override - public short getThriftFieldId() { - return _thriftId; - } - - @Override - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TINFO, new org.apache.thrift.meta_data.FieldMetaData("tinfo", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.TInfo.class))); - tmpMap.put(_Fields.CREDENTIALS, new org.apache.thrift.meta_data.FieldMetaData("credentials", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.securityImpl.thrift.TCredentials.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompletedCompactions_args.class, metaDataMap); - } - - public getCompletedCompactions_args() { - } - - public getCompletedCompactions_args( - org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, - org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) - { - this(); - this.tinfo = tinfo; - this.credentials = credentials; - } - - /** - * Performs a deep copy on other. - */ - public getCompletedCompactions_args(getCompletedCompactions_args other) { - if (other.isSetTinfo()) { - this.tinfo = new org.apache.accumulo.core.clientImpl.thrift.TInfo(other.tinfo); - } - if (other.isSetCredentials()) { - this.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials(other.credentials); - } - } - - @Override - public getCompletedCompactions_args deepCopy() { - return new getCompletedCompactions_args(this); - } - - @Override - public void clear() { - this.tinfo = null; - this.credentials = null; - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.clientImpl.thrift.TInfo getTinfo() { - return this.tinfo; - } - - public getCompletedCompactions_args setTinfo(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo) { - this.tinfo = tinfo; - return this; - } - - public void unsetTinfo() { - this.tinfo = null; - } - - /** Returns true if field tinfo is set (has been assigned a value) and false otherwise */ - public boolean isSetTinfo() { - return this.tinfo != null; - } - - public void setTinfoIsSet(boolean value) { - if (!value) { - this.tinfo = null; - } - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.securityImpl.thrift.TCredentials getCredentials() { - return this.credentials; - } - - public getCompletedCompactions_args setCredentials(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) { - this.credentials = credentials; - return this; - } - - public void unsetCredentials() { - this.credentials = null; - } - - /** Returns true if field credentials is set (has been assigned a value) and false otherwise */ - public boolean isSetCredentials() { - return this.credentials != null; - } - - public void setCredentialsIsSet(boolean value) { - if (!value) { - this.credentials = null; - } - } - - @Override - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case TINFO: - if (value == null) { - unsetTinfo(); - } else { - setTinfo((org.apache.accumulo.core.clientImpl.thrift.TInfo)value); - } - break; - - case CREDENTIALS: - if (value == null) { - unsetCredentials(); - } else { - setCredentials((org.apache.accumulo.core.securityImpl.thrift.TCredentials)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - @Override - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case TINFO: - return getTinfo(); - - case CREDENTIALS: - return getCredentials(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - @Override - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case TINFO: - return isSetTinfo(); - case CREDENTIALS: - return isSetCredentials(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof getCompletedCompactions_args) - return this.equals((getCompletedCompactions_args)that); - return false; - } - - public boolean equals(getCompletedCompactions_args that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_tinfo = true && this.isSetTinfo(); - boolean that_present_tinfo = true && that.isSetTinfo(); - if (this_present_tinfo || that_present_tinfo) { - if (!(this_present_tinfo && that_present_tinfo)) - return false; - if (!this.tinfo.equals(that.tinfo)) - return false; - } - - boolean this_present_credentials = true && this.isSetCredentials(); - boolean that_present_credentials = true && that.isSetCredentials(); - if (this_present_credentials || that_present_credentials) { - if (!(this_present_credentials && that_present_credentials)) - return false; - if (!this.credentials.equals(that.credentials)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetTinfo()) ? 131071 : 524287); - if (isSetTinfo()) - hashCode = hashCode * 8191 + tinfo.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCredentials()) ? 131071 : 524287); - if (isSetCredentials()) - hashCode = hashCode * 8191 + credentials.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(getCompletedCompactions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.compare(isSetTinfo(), other.isSetTinfo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTinfo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, other.tinfo); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCredentials()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - @Override - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - @Override - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getCompletedCompactions_args("); - boolean first = true; - - sb.append("tinfo:"); - if (this.tinfo == null) { - sb.append("null"); - } else { - sb.append(this.tinfo); - } - first = false; - if (!first) sb.append(", "); - sb.append("credentials:"); - if (this.credentials == null) { - sb.append("null"); - } else { - sb.append(this.credentials); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (tinfo != null) { - tinfo.validate(); - } - if (credentials != null) { - credentials.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - } - } - - private static class getCompletedCompactions_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public getCompletedCompactions_argsStandardScheme getScheme() { - return new getCompletedCompactions_argsStandardScheme(); - } - } - - private static class getCompletedCompactions_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getCompletedCompactions_args 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: // TINFO - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.tinfo = new org.apache.accumulo.core.clientImpl.thrift.TInfo(); - struct.tinfo.read(iprot); - struct.setTinfoIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CREDENTIALS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials(); - struct.credentials.read(iprot); - struct.setCredentialsIsSet(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 void write(org.apache.thrift.protocol.TProtocol oprot, getCompletedCompactions_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.tinfo != null) { - oprot.writeFieldBegin(TINFO_FIELD_DESC); - struct.tinfo.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.credentials != null) { - oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC); - struct.credentials.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getCompletedCompactions_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public getCompletedCompactions_argsTupleScheme getScheme() { - return new getCompletedCompactions_argsTupleScheme(); - } - } - - private static class getCompletedCompactions_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getCompletedCompactions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetTinfo()) { - optionals.set(0); - } - if (struct.isSetCredentials()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetTinfo()) { - struct.tinfo.write(oprot); - } - if (struct.isSetCredentials()) { - struct.credentials.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getCompletedCompactions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.tinfo = new org.apache.accumulo.core.clientImpl.thrift.TInfo(); - struct.tinfo.read(iprot); - struct.setTinfoIsSet(true); - } - if (incoming.get(1)) { - struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials(); - struct.credentials.read(iprot); - struct.setCredentialsIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) - public static class getCompletedCompactions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCompletedCompactions_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField SEC_FIELD_DESC = new org.apache.thrift.protocol.TField("sec", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField TNASE_FIELD_DESC = new org.apache.thrift.protocol.TField("tnase", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getCompletedCompactions_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getCompletedCompactions_resultTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable TExternalCompactionMap success; // required - public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec; // required - public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - SEC((short)1, "sec"), - TNASE((short)2, "tnase"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // SEC - return SEC; - case 2: // TNASE - return TNASE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - @Override - public short getThriftFieldId() { - return _thriftId; - } - - @Override - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExternalCompactionMap.class))); - tmpMap.put(_Fields.SEC, new org.apache.thrift.meta_data.FieldMetaData("sec", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException.class))); - tmpMap.put(_Fields.TNASE, new org.apache.thrift.meta_data.FieldMetaData("tnase", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCompletedCompactions_result.class, metaDataMap); - } - - public getCompletedCompactions_result() { - } - - public getCompletedCompactions_result( - TExternalCompactionMap success, - org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec, - org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) - { - this(); - this.success = success; - this.sec = sec; - this.tnase = tnase; - } - - /** - * Performs a deep copy on other. - */ - public getCompletedCompactions_result(getCompletedCompactions_result other) { - if (other.isSetSuccess()) { - this.success = new TExternalCompactionMap(other.success); - } - if (other.isSetSec()) { - this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); - } - if (other.isSetTnase()) { - this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); - } - } - - @Override - public getCompletedCompactions_result deepCopy() { - return new getCompletedCompactions_result(this); - } - - @Override - public void clear() { - this.success = null; - this.sec = null; - this.tnase = null; - } - - @org.apache.thrift.annotation.Nullable - public TExternalCompactionMap getSuccess() { - return this.success; - } - - public getCompletedCompactions_result setSuccess(@org.apache.thrift.annotation.Nullable TExternalCompactionMap success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException getSec() { - return this.sec; - } - - public getCompletedCompactions_result setSec(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec) { - this.sec = sec; - return this; - } - - public void unsetSec() { - this.sec = null; - } - - /** Returns true if field sec is set (has been assigned a value) and false otherwise */ - public boolean isSetSec() { - return this.sec != null; - } - - public void setSecIsSet(boolean value) { - if (!value) { - this.sec = null; - } - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException getTnase() { - return this.tnase; - } - - public getCompletedCompactions_result setTnase(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) { - this.tnase = tnase; - return this; - } - - public void unsetTnase() { - this.tnase = null; - } - - /** Returns true if field tnase is set (has been assigned a value) and false otherwise */ - public boolean isSetTnase() { - return this.tnase != null; - } - - public void setTnaseIsSet(boolean value) { - if (!value) { - this.tnase = null; - } - } - - @Override - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TExternalCompactionMap)value); - } - break; - - case SEC: - if (value == null) { - unsetSec(); - } else { - setSec((org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException)value); - } - break; - - case TNASE: - if (value == null) { - unsetTnase(); - } else { - setTnase((org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - @Override - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - case SEC: - return getSec(); - - case TNASE: - return getTnase(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - @Override - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - case SEC: - return isSetSec(); - case TNASE: - return isSetTnase(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof getCompletedCompactions_result) - return this.equals((getCompletedCompactions_result)that); - return false; - } - - public boolean equals(getCompletedCompactions_result that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - 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_sec = true && this.isSetSec(); - boolean that_present_sec = true && that.isSetSec(); - if (this_present_sec || that_present_sec) { - if (!(this_present_sec && that_present_sec)) - return false; - if (!this.sec.equals(that.sec)) - return false; - } - - boolean this_present_tnase = true && this.isSetTnase(); - boolean that_present_tnase = true && that.isSetTnase(); - if (this_present_tnase || that_present_tnase) { - if (!(this_present_tnase && that_present_tnase)) - return false; - if (!this.tnase.equals(that.tnase)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSec()) ? 131071 : 524287); - if (isSetSec()) - hashCode = hashCode * 8191 + sec.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTnase()) ? 131071 : 524287); - if (isSetTnase()) - hashCode = hashCode * 8191 + tnase.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(getCompletedCompactions_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetSec(), other.isSetSec()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSec()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sec, other.sec); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTnase(), other.isSetTnase()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTnase()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tnase, other.tnase); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - @Override - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("getCompletedCompactions_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("sec:"); - if (this.sec == null) { - sb.append("null"); - } else { - sb.append(this.sec); - } - first = false; - if (!first) sb.append(", "); - sb.append("tnase:"); - if (this.tnase == null) { - sb.append("null"); - } else { - sb.append(this.tnase); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - 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); - } - } - - private static class getCompletedCompactions_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public getCompletedCompactions_resultStandardScheme getScheme() { - return new getCompletedCompactions_resultStandardScheme(); - } - } - - private static class getCompletedCompactions_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, getCompletedCompactions_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.STRUCT) { - struct.success = new TExternalCompactionMap(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 1: // SEC - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); - struct.sec.read(iprot); - struct.setSecIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TNASE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(); - struct.tnase.read(iprot); - struct.setTnaseIsSet(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 void write(org.apache.thrift.protocol.TProtocol oprot, getCompletedCompactions_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.sec != null) { - oprot.writeFieldBegin(SEC_FIELD_DESC); - struct.sec.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.tnase != null) { - oprot.writeFieldBegin(TNASE_FIELD_DESC); - struct.tnase.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getCompletedCompactions_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public getCompletedCompactions_resultTupleScheme getScheme() { - return new getCompletedCompactions_resultTupleScheme(); - } - } - - private static class getCompletedCompactions_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getCompletedCompactions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - if (struct.isSetSec()) { - optionals.set(1); - } - if (struct.isSetTnase()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - if (struct.isSetSec()) { - struct.sec.write(oprot); - } - if (struct.isSetTnase()) { - struct.tnase.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getCompletedCompactions_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(3); - if (incoming.get(0)) { - struct.success = new TExternalCompactionMap(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - if (incoming.get(1)) { - struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); - struct.sec.read(iprot); - struct.setSecIsSet(true); - } - if (incoming.get(2)) { - struct.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(); - struct.tnase.read(iprot); - struct.setTnaseIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) public static class cancel_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancel_args"); diff --git a/core/src/main/thrift/compaction-coordinator.thrift b/core/src/main/thrift/compaction-coordinator.thrift index d583978d20f..bd50382dab2 100644 --- a/core/src/main/thrift/compaction-coordinator.thrift +++ b/core/src/main/thrift/compaction-coordinator.thrift @@ -143,17 +143,6 @@ service CompactionCoordinatorService { 2:client.ThriftNotActiveServiceException tnase ) - /* - * Called by the Monitor to get progress information - */ - TExternalCompactionMap getCompletedCompactions( - 1:client.TInfo tinfo - 2:security.TCredentials credentials - )throws( - 1:client.ThriftSecurityException sec - 2:client.ThriftNotActiveServiceException tnase - ) - void cancel( 1:client.TInfo tinfo 2:security.TCredentials credentials diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java b/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java index aee9679cc01..80f80d4002b 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java @@ -217,7 +217,6 @@ static FailureCounts incrementSuccess(Object key, FailureCounts counts) { // Exposed for tests protected final CountDownLatch shutdown = new CountDownLatch(1); - private final Cache completed; private final LoadingCache compactionConfigCache; private final Cache tabletDirCache; private final DeadCompactionDetector deadCompactionDetector; @@ -247,9 +246,6 @@ public CompactionCoordinator(Manager manager, this.fateClients = fateClients; - completed = ctx.getCaches().createNewBuilder(CacheName.COMPACTIONS_COMPLETED, true) - .maximumSize(200).expireAfterWrite(10, TimeUnit.MINUTES).build(); - CacheLoader loader = fateId -> CompactionConfigStorage.getConfig(ctx, fateId); @@ -1014,9 +1010,6 @@ public void recordCompletion(TInfo tinfo, TCredentials credentials, String exter public void recordCompletion(ExternalCompactionId ecid) { var tec = RUNNING_CACHE.remove(ecid); - if (tec != null) { - completed.put(ecid, tec); - } } protected Set readExternalCompactionIds() { @@ -1052,29 +1045,6 @@ public TExternalCompactionMap getRunningCompactions(TInfo tinfo, TCredentials cr return result; } - /** - * Return information about recently completed compactions - * - * @param tinfo trace info - * @param credentials tcredentials object - * @return map of ECID to TExternalCompaction objects - * @throws ThriftSecurityException permission error - */ - @Override - public TExternalCompactionMap getCompletedCompactions(TInfo tinfo, TCredentials credentials) - throws ThriftSecurityException { - // do not expect users to call this directly, expect other tservers to call this method - if (!security.canPerformSystemActions(credentials)) { - throw new AccumuloSecurityException(credentials.getPrincipal(), - SecurityErrorCode.PERMISSION_DENIED).asThriftException(); - } - final TExternalCompactionMap result = new TExternalCompactionMap(); - completed.asMap().forEach((ecid, tec) -> { - result.putToCompactions(ecid.canonical(), tec); - }); - return result; - } - @Override public void cancel(TInfo tinfo, TCredentials credentials, String externalCompactionId) throws TException { diff --git a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction2ITBase.java b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction2ITBase.java index 9622cf05668..ad7b19325bb 100644 --- a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction2ITBase.java +++ b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction2ITBase.java @@ -23,8 +23,8 @@ import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.GROUP4; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.MAX_DATA; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.compact; -import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionCompleted; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionRunning; +import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionsNoLongerRunning; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.countTablets; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.createTable; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.row; @@ -50,7 +50,6 @@ import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.clientImpl.TableOperationsImpl; -import org.apache.accumulo.core.compaction.thrift.TCompactionState; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.metadata.SystemTables; @@ -122,8 +121,7 @@ public void testSplitCancelsExternalCompaction() throws Exception { client.tableOperations().addSplits(table1, splits); - confirmCompactionCompleted(getCluster().getServerContext(), ecids, - TCompactionState.CANCELLED); + confirmCompactionsNoLongerRunning(getCluster().getServerContext(), ecids); // ensure compaction ids were deleted by split operation from metadata table try (TabletsMetadata tm = getCluster().getServerContext().getAmple().readTablets() @@ -192,8 +190,7 @@ public void testUserCompactionCancellation() throws Exception { assertNotNull(e); assertEquals(TableOperationsImpl.COMPACTION_CANCELED_MSG, e.getMessage()); - confirmCompactionCompleted(getCluster().getServerContext(), ecids, - TCompactionState.CANCELLED); + confirmCompactionsNoLongerRunning(getCluster().getServerContext(), ecids); // ensure the canceled compaction deletes any tablet metadata related to the compaction while (countTablets(getCluster().getServerContext(), table1, @@ -236,8 +233,7 @@ public void testDeleteTableCancelsUserExternalCompaction() throws Exception { client.tableOperations().delete(table1); - confirmCompactionCompleted(getCluster().getServerContext(), ecids, - TCompactionState.CANCELLED); + confirmCompactionsNoLongerRunning(getCluster().getServerContext(), ecids); // Ensure compaction did not write anything to metadata table after delete table try (var scanner = client.createScanner(SystemTables.METADATA.tableName())) { @@ -281,6 +277,7 @@ public void testDeleteTableCancelsExternalCompaction() throws Exception { Thread t = new Thread(r); t.start(); latch.await(); + assertNull(error.get()); // Wait for the compaction to start by waiting for 1 external compaction column Set ecids = ExternalCompactionTestUtils.waitForCompactionStartAndReturnEcids(ctx, tid); @@ -293,7 +290,7 @@ public void testDeleteTableCancelsExternalCompaction() throws Exception { LoggerFactory.getLogger(getClass()).debug("Table deleted."); - confirmCompactionCompleted(ctx, ecids, TCompactionState.CANCELLED); + confirmCompactionsNoLongerRunning(ctx, ecids); LoggerFactory.getLogger(getClass()).debug("Confirmed compaction cancelled."); diff --git a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction4_IT.java b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction4_IT.java index cce42c26f41..2d57c94e607 100644 --- a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction4_IT.java +++ b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction4_IT.java @@ -20,8 +20,8 @@ import static org.apache.accumulo.core.conf.Property.TABLE_FILE_MAX; import static org.apache.accumulo.core.conf.Property.TABLE_MAJC_RATIO; -import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionCompleted; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionRunning; +import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionsNoLongerRunning; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.createTable; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.waitForCompactionStartAndReturnEcids; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.writeData; @@ -39,7 +39,6 @@ import org.apache.accumulo.core.client.IteratorSetting; import org.apache.accumulo.core.client.admin.CompactionConfig; import org.apache.accumulo.core.clientImpl.ClientContext; -import org.apache.accumulo.core.compaction.thrift.TCompactionState; import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope; import org.apache.accumulo.core.iterators.user.AgeOffFilter; @@ -173,9 +172,7 @@ public void testDeleteTableCancelsSleepingExternalCompaction() throws Exception client.tableOperations().delete(table1); - confirmCompactionCompleted(getCluster().getServerContext(), ecids, - TCompactionState.CANCELLED); - + confirmCompactionsNoLongerRunning(getCluster().getServerContext(), ecids); } } diff --git a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java index 457abf588f6..fab985bced0 100644 --- a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java +++ b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java @@ -18,8 +18,8 @@ */ package org.apache.accumulo.test.compaction; +import static java.util.concurrent.TimeUnit.MINUTES; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -162,7 +162,7 @@ public static void writeData(AccumuloClient client, String table1, int rows) } } - client.tableOperations().flush(table1); + client.tableOperations().flush(table1, null, null, true); } public static void writeData(AccumuloClient client, String table1) @@ -265,19 +265,6 @@ public static TExternalCompactionMap getRunningCompactions(ClientContext context } } - private static TExternalCompactionMap getCompletedCompactions(ClientContext context, - Optional coordinatorHost) throws Exception { - CompactionCoordinatorService.Client client = - ThriftUtil.getClient(ThriftClientTypes.COORDINATOR, coordinatorHost.orElseThrow(), context); - try { - TExternalCompactionMap completed = - client.getCompletedCompactions(TraceUtil.traceInfo(), context.rpcCreds()); - return completed; - } finally { - ThriftUtil.returnClient(client, context); - } - } - public static TCompactionState getLastState(TExternalCompaction status) { ArrayList timestamps = new ArrayList<>(status.getUpdates().size()); status.getUpdates().keySet().forEach(k -> timestamps.add(k)); @@ -349,33 +336,18 @@ public static int confirmCompactionRunning(ServerContext ctx, Set ecids, - TCompactionState expectedState) throws Exception { - Optional coordinatorHost = ExternalCompactionUtil.findCompactionCoordinator(ctx); - if (coordinatorHost.isEmpty()) { - throw new TTransportException("Unable to get CompactionCoordinator address from ZooKeeper"); - } - - // The running compaction should be removed - TExternalCompactionMap running = - ExternalCompactionTestUtils.getRunningCompactions(ctx, coordinatorHost); - while (running.getCompactions() != null && running.getCompactions().keySet().stream() - .anyMatch((e) -> ecids.contains(ExternalCompactionId.of(e)))) { - running = ExternalCompactionTestUtils.getRunningCompactions(ctx, coordinatorHost); - } - // The compaction should be in the completed list with the expected state - TExternalCompactionMap completed = - ExternalCompactionTestUtils.getCompletedCompactions(ctx, coordinatorHost); - while (completed.getCompactions() == null) { - UtilWaitThread.sleep(50); - completed = ExternalCompactionTestUtils.getCompletedCompactions(ctx, coordinatorHost); - } - for (ExternalCompactionId e : ecids) { - TExternalCompaction tec = completed.getCompactions().get(e.canonical()); - assertNotNull(tec); - assertEquals(expectedState, ExternalCompactionTestUtils.getLastState(tec)); - } + /** + * Waits for compactions to no longer be running on compactors + */ + public static void confirmCompactionsNoLongerRunning(ServerContext ctx, + Set ecids) { + Wait.waitFor(() -> { + Set running = new HashSet<>(); + ExternalCompactionUtil.getCompactionsRunningOnCompactors(ctx, + tec -> running.add(ExternalCompactionId.of(tec.getJob().getExternalCompactionId()))); + return Collections.disjoint(running, ecids); + }, MINUTES.toMillis(5)); } public static void assertNoCompactionMetadata(ServerContext ctx, String tableName) { diff --git a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_3_IT.java b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_3_IT.java index 9c855ba390d..840fab3148c 100644 --- a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_3_IT.java +++ b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompaction_3_IT.java @@ -20,7 +20,7 @@ import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.GROUP2; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.compact; -import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionCompleted; +import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionsNoLongerRunning; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.createTable; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.getRunningCompactions; import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.waitForCompactionStartAndReturnEcids; @@ -137,8 +137,7 @@ public void testMergeCancelsExternalCompaction() throws Exception { Text end = md.get(1).getEndRow(); client.tableOperations().merge(table1, start, end); - confirmCompactionCompleted(getCluster().getServerContext(), ecids, - TCompactionState.CANCELLED); + confirmCompactionsNoLongerRunning(getCluster().getServerContext(), ecids); // ensure compaction ids were deleted by merge operation from metadata table try (TabletsMetadata tm = getCluster().getServerContext().getAmple().readTablets() diff --git a/test/src/main/java/org/apache/accumulo/test/compaction/SplitCancelsMajCIT.java b/test/src/main/java/org/apache/accumulo/test/compaction/SplitCancelsMajCIT.java index e7ee6a19bbe..b3e7b2553fc 100644 --- a/test/src/main/java/org/apache/accumulo/test/compaction/SplitCancelsMajCIT.java +++ b/test/src/main/java/org/apache/accumulo/test/compaction/SplitCancelsMajCIT.java @@ -19,6 +19,7 @@ package org.apache.accumulo.test.compaction; import static java.util.concurrent.TimeUnit.SECONDS; +import static org.apache.accumulo.test.compaction.ExternalCompactionTestUtils.confirmCompactionsNoLongerRunning; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -34,7 +35,6 @@ import org.apache.accumulo.core.client.AccumuloClient; import org.apache.accumulo.core.client.BatchWriter; import org.apache.accumulo.core.client.IteratorSetting; -import org.apache.accumulo.core.compaction.thrift.TCompactionState; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.TableId; @@ -119,8 +119,7 @@ public void test() throws Exception { partitionKeys.add(new Text("10")); c.tableOperations().addSplits(tableName, partitionKeys); - ExternalCompactionTestUtils.confirmCompactionCompleted(getCluster().getServerContext(), - compactionIds, TCompactionState.CANCELLED); + confirmCompactionsNoLongerRunning(getCluster().getServerContext(), compactionIds); thread.join(); // wait for the restarted compaction