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 4f446373ac9..a61ba2e5c90 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 @@ -33,8 +33,6 @@ public interface Iface { public TNextCompactionJob getCompactionJob(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String groupName, java.lang.String compactor, 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 updateCompactionStatus(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, TCompactionStatusUpdate status, long timestamp) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; - public void compactionFailed(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, java.lang.String exceptionClassName, TCompactionState failureState, java.lang.String groupName, java.lang.String compactor) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException; } @@ -45,8 +43,6 @@ public interface AsyncIface { public void getCompactionJob(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String groupName, java.lang.String compactor, java.lang.String externalCompactionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void updateCompactionStatus(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, TCompactionStatusUpdate status, long timestamp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void compactionFailed(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, java.lang.String exceptionClassName, TCompactionState failureState, java.lang.String groupName, java.lang.String compactor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } @@ -140,37 +136,6 @@ public TNextCompactionJob recv_getCompactionJob() throws org.apache.accumulo.cor throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCompactionJob failed: unknown result"); } - @Override - public void updateCompactionStatus(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, TCompactionStatusUpdate status, long timestamp) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException - { - send_updateCompactionStatus(tinfo, credentials, externalCompactionId, status, timestamp); - recv_updateCompactionStatus(); - } - - public void send_updateCompactionStatus(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, TCompactionStatusUpdate status, long timestamp) throws org.apache.thrift.TException - { - updateCompactionStatus_args args = new updateCompactionStatus_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.setExternalCompactionId(externalCompactionId); - args.setStatus(status); - args.setTimestamp(timestamp); - sendBase("updateCompactionStatus", args); - } - - public void recv_updateCompactionStatus() throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException - { - updateCompactionStatus_result result = new updateCompactionStatus_result(); - receiveBase(result, "updateCompactionStatus"); - if (result.sec != null) { - throw result.sec; - } - if (result.tnase != null) { - throw result.tnase; - } - return; - } - @Override public void compactionFailed(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, java.lang.String exceptionClassName, TCompactionState failureState, java.lang.String groupName, java.lang.String compactor) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException, org.apache.thrift.TException { @@ -325,54 +290,6 @@ public TNextCompactionJob getResult() throws org.apache.accumulo.core.clientImpl } } - @Override - public void updateCompactionStatus(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, TCompactionStatusUpdate status, long timestamp, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - updateCompactionStatus_call method_call = new updateCompactionStatus_call(tinfo, credentials, externalCompactionId, status, timestamp, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class updateCompactionStatus_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; - private java.lang.String externalCompactionId; - private TCompactionStatusUpdate status; - private long timestamp; - public updateCompactionStatus_call(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, TCompactionStatusUpdate status, long timestamp, 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; - this.externalCompactionId = externalCompactionId; - this.status = status; - this.timestamp = timestamp; - } - - @Override - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateCompactionStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); - updateCompactionStatus_args args = new updateCompactionStatus_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.setExternalCompactionId(externalCompactionId); - args.setStatus(status); - args.setTimestamp(timestamp); - args.write(prot); - prot.writeMessageEnd(); - } - - @Override - public Void 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); - (new Client(prot)).recv_updateCompactionStatus(); - return null; - } - } - @Override public void compactionFailed(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, java.lang.String exceptionClassName, TCompactionState failureState, java.lang.String groupName, java.lang.String compactor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); @@ -445,7 +362,6 @@ protected Processor(I iface, java.util.Map java.util.Map> getProcessMap(java.util.Map> processMap) { processMap.put("compactionCompleted", new compactionCompleted()); processMap.put("getCompactionJob", new getCompactionJob()); - processMap.put("updateCompactionStatus", new updateCompactionStatus()); processMap.put("compactionFailed", new compactionFailed()); return processMap; } @@ -518,40 +434,6 @@ public getCompactionJob_result getResult(I iface, getCompactionJob_args args) th } } - public static class updateCompactionStatus extends org.apache.thrift.ProcessFunction { - public updateCompactionStatus() { - super("updateCompactionStatus"); - } - - @Override - public updateCompactionStatus_args getEmptyArgsInstance() { - return new updateCompactionStatus_args(); - } - - @Override - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - @Override - public updateCompactionStatus_result getResult(I iface, updateCompactionStatus_args args) throws org.apache.thrift.TException { - updateCompactionStatus_result result = new updateCompactionStatus_result(); - try { - iface.updateCompactionStatus(args.tinfo, args.credentials, args.externalCompactionId, args.status, args.timestamp); - } 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 compactionFailed extends org.apache.thrift.ProcessFunction { public compactionFailed() { super("compactionFailed"); @@ -601,7 +483,6 @@ protected AsyncProcessor(I iface, java.util.Map java.util.Map> getProcessMap(java.util.Map> processMap) { processMap.put("compactionCompleted", new compactionCompleted()); processMap.put("getCompactionJob", new getCompactionJob()); - processMap.put("updateCompactionStatus", new updateCompactionStatus()); processMap.put("compactionFailed", new compactionFailed()); return processMap; } @@ -755,80 +636,6 @@ public void start(I iface, getCompactionJob_args args, org.apache.thrift.async.A } } - public static class updateCompactionStatus extends org.apache.thrift.AsyncProcessFunction { - public updateCompactionStatus() { - super("updateCompactionStatus"); - } - - @Override - public updateCompactionStatus_args getEmptyArgsInstance() { - return new updateCompactionStatus_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(Void o) { - updateCompactionStatus_result result = new updateCompactionStatus_result(); - 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; - updateCompactionStatus_result result = new updateCompactionStatus_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, updateCompactionStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.updateCompactionStatus(args.tinfo, args.credentials, args.externalCompactionId, args.status, args.timestamp,resultHandler); - } - } - public static class compactionFailed extends org.apache.thrift.AsyncProcessFunction { public compactionFailed() { super("compactionFailed"); @@ -3827,1302 +3634,6 @@ private static S scheme(org.apache. } } - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) - public static class updateCompactionStatus_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("updateCompactionStatus_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.protocol.TField EXTERNAL_COMPACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("externalCompactionId", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new updateCompactionStatus_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new updateCompactionStatus_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 - public @org.apache.thrift.annotation.Nullable java.lang.String externalCompactionId; // required - public @org.apache.thrift.annotation.Nullable TCompactionStatusUpdate status; // required - public long timestamp; // 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"), - EXTERNAL_COMPACTION_ID((short)3, "externalCompactionId"), - STATUS((short)4, "status"), - TIMESTAMP((short)5, "timestamp"); - - 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; - case 3: // EXTERNAL_COMPACTION_ID - return EXTERNAL_COMPACTION_ID; - case 4: // STATUS - return STATUS; - case 5: // TIMESTAMP - return TIMESTAMP; - 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 - private static final int __TIMESTAMP_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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))); - tmpMap.put(_Fields.EXTERNAL_COMPACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("externalCompactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCompactionStatusUpdate.class))); - tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateCompactionStatus_args.class, metaDataMap); - } - - public updateCompactionStatus_args() { - } - - public updateCompactionStatus_args( - org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, - org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, - java.lang.String externalCompactionId, - TCompactionStatusUpdate status, - long timestamp) - { - this(); - this.tinfo = tinfo; - this.credentials = credentials; - this.externalCompactionId = externalCompactionId; - this.status = status; - this.timestamp = timestamp; - setTimestampIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public updateCompactionStatus_args(updateCompactionStatus_args other) { - __isset_bitfield = other.__isset_bitfield; - 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); - } - if (other.isSetExternalCompactionId()) { - this.externalCompactionId = other.externalCompactionId; - } - if (other.isSetStatus()) { - this.status = new TCompactionStatusUpdate(other.status); - } - this.timestamp = other.timestamp; - } - - @Override - public updateCompactionStatus_args deepCopy() { - return new updateCompactionStatus_args(this); - } - - @Override - public void clear() { - this.tinfo = null; - this.credentials = null; - this.externalCompactionId = null; - this.status = null; - setTimestampIsSet(false); - this.timestamp = 0; - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.clientImpl.thrift.TInfo getTinfo() { - return this.tinfo; - } - - public updateCompactionStatus_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 updateCompactionStatus_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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getExternalCompactionId() { - return this.externalCompactionId; - } - - public updateCompactionStatus_args setExternalCompactionId(@org.apache.thrift.annotation.Nullable java.lang.String externalCompactionId) { - this.externalCompactionId = externalCompactionId; - return this; - } - - public void unsetExternalCompactionId() { - this.externalCompactionId = null; - } - - /** Returns true if field externalCompactionId is set (has been assigned a value) and false otherwise */ - public boolean isSetExternalCompactionId() { - return this.externalCompactionId != null; - } - - public void setExternalCompactionIdIsSet(boolean value) { - if (!value) { - this.externalCompactionId = null; - } - } - - @org.apache.thrift.annotation.Nullable - public TCompactionStatusUpdate getStatus() { - return this.status; - } - - public updateCompactionStatus_args setStatus(@org.apache.thrift.annotation.Nullable TCompactionStatusUpdate status) { - this.status = status; - return this; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public long getTimestamp() { - return this.timestamp; - } - - public updateCompactionStatus_args setTimestamp(long timestamp) { - this.timestamp = timestamp; - setTimestampIsSet(true); - return this; - } - - public void unsetTimestamp() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ - public boolean isSetTimestamp() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); - } - - public void setTimestampIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); - } - - @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; - - case EXTERNAL_COMPACTION_ID: - if (value == null) { - unsetExternalCompactionId(); - } else { - setExternalCompactionId((java.lang.String)value); - } - break; - - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TCompactionStatusUpdate)value); - } - break; - - case TIMESTAMP: - if (value == null) { - unsetTimestamp(); - } else { - setTimestamp((java.lang.Long)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(); - - case EXTERNAL_COMPACTION_ID: - return getExternalCompactionId(); - - case STATUS: - return getStatus(); - - case TIMESTAMP: - return getTimestamp(); - - } - 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(); - case EXTERNAL_COMPACTION_ID: - return isSetExternalCompactionId(); - case STATUS: - return isSetStatus(); - case TIMESTAMP: - return isSetTimestamp(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof updateCompactionStatus_args) - return this.equals((updateCompactionStatus_args)that); - return false; - } - - public boolean equals(updateCompactionStatus_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; - } - - boolean this_present_externalCompactionId = true && this.isSetExternalCompactionId(); - boolean that_present_externalCompactionId = true && that.isSetExternalCompactionId(); - if (this_present_externalCompactionId || that_present_externalCompactionId) { - if (!(this_present_externalCompactionId && that_present_externalCompactionId)) - return false; - if (!this.externalCompactionId.equals(that.externalCompactionId)) - return false; - } - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_timestamp = true; - boolean that_present_timestamp = true; - if (this_present_timestamp || that_present_timestamp) { - if (!(this_present_timestamp && that_present_timestamp)) - return false; - if (this.timestamp != that.timestamp) - 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(); - - hashCode = hashCode * 8191 + ((isSetExternalCompactionId()) ? 131071 : 524287); - if (isSetExternalCompactionId()) - hashCode = hashCode * 8191 + externalCompactionId.hashCode(); - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); - - return hashCode; - } - - @Override - public int compareTo(updateCompactionStatus_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; - } - } - lastComparison = java.lang.Boolean.compare(isSetExternalCompactionId(), other.isSetExternalCompactionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExternalCompactionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.externalCompactionId, other.externalCompactionId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTimestamp(), other.isSetTimestamp()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTimestamp()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp); - 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("updateCompactionStatus_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; - if (!first) sb.append(", "); - sb.append("externalCompactionId:"); - if (this.externalCompactionId == null) { - sb.append("null"); - } else { - sb.append(this.externalCompactionId); - } - first = false; - if (!first) sb.append(", "); - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("timestamp:"); - sb.append(this.timestamp); - 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(); - } - if (status != null) { - status.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 { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 updateCompactionStatus_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public updateCompactionStatus_argsStandardScheme getScheme() { - return new updateCompactionStatus_argsStandardScheme(); - } - } - - private static class updateCompactionStatus_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, updateCompactionStatus_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; - case 3: // EXTERNAL_COMPACTION_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.externalCompactionId = iprot.readString(); - struct.setExternalCompactionIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TCompactionStatusUpdate(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // TIMESTAMP - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(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, updateCompactionStatus_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(); - } - if (struct.externalCompactionId != null) { - oprot.writeFieldBegin(EXTERNAL_COMPACTION_ID_FIELD_DESC); - oprot.writeString(struct.externalCompactionId); - oprot.writeFieldEnd(); - } - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(struct.timestamp); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class updateCompactionStatus_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public updateCompactionStatus_argsTupleScheme getScheme() { - return new updateCompactionStatus_argsTupleScheme(); - } - } - - private static class updateCompactionStatus_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateCompactionStatus_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); - } - if (struct.isSetExternalCompactionId()) { - optionals.set(2); - } - if (struct.isSetStatus()) { - optionals.set(3); - } - if (struct.isSetTimestamp()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetTinfo()) { - struct.tinfo.write(oprot); - } - if (struct.isSetCredentials()) { - struct.credentials.write(oprot); - } - if (struct.isSetExternalCompactionId()) { - oprot.writeString(struct.externalCompactionId); - } - if (struct.isSetStatus()) { - struct.status.write(oprot); - } - if (struct.isSetTimestamp()) { - oprot.writeI64(struct.timestamp); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateCompactionStatus_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(5); - 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); - } - if (incoming.get(2)) { - struct.externalCompactionId = iprot.readString(); - struct.setExternalCompactionIdIsSet(true); - } - if (incoming.get(3)) { - struct.status = new TCompactionStatusUpdate(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - if (incoming.get(4)) { - struct.timestamp = iprot.readI64(); - struct.setTimestampIsSet(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 updateCompactionStatus_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("updateCompactionStatus_result"); - - 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 updateCompactionStatus_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new updateCompactionStatus_resultTupleSchemeFactory(); - - 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 { - 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 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.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(updateCompactionStatus_result.class, metaDataMap); - } - - public updateCompactionStatus_result() { - } - - public updateCompactionStatus_result( - org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException sec, - org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException tnase) - { - this(); - this.sec = sec; - this.tnase = tnase; - } - - /** - * Performs a deep copy on other. - */ - public updateCompactionStatus_result(updateCompactionStatus_result other) { - 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 updateCompactionStatus_result deepCopy() { - return new updateCompactionStatus_result(this); - } - - @Override - public void clear() { - this.sec = null; - this.tnase = null; - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException getSec() { - return this.sec; - } - - public updateCompactionStatus_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 updateCompactionStatus_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 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 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 SEC: - return isSetSec(); - case TNASE: - return isSetTnase(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof updateCompactionStatus_result) - return this.equals((updateCompactionStatus_result)that); - return false; - } - - public boolean equals(updateCompactionStatus_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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 + ((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(updateCompactionStatus_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - 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("updateCompactionStatus_result("); - boolean first = true; - - 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 - } - - 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 updateCompactionStatus_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public updateCompactionStatus_resultStandardScheme getScheme() { - return new updateCompactionStatus_resultStandardScheme(); - } - } - - private static class updateCompactionStatus_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, updateCompactionStatus_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: // 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, updateCompactionStatus_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - 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 updateCompactionStatus_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public updateCompactionStatus_resultTupleScheme getScheme() { - return new updateCompactionStatus_resultTupleScheme(); - } - } - - private static class updateCompactionStatus_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, updateCompactionStatus_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.isSetSec()) { - optionals.set(0); - } - if (struct.isSetTnase()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetSec()) { - struct.sec.write(oprot); - } - if (struct.isSetTnase()) { - struct.tnase.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, updateCompactionStatus_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(2); - if (incoming.get(0)) { - struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); - struct.sec.read(iprot); - struct.setSecIsSet(true); - } - if (incoming.get(1)) { - 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 compactionFailed_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("compactionFailed_args"); diff --git a/core/src/main/thrift/compaction-coordinator.thrift b/core/src/main/thrift/compaction-coordinator.thrift index 8effd88aff5..fcae3a3ab57 100644 --- a/core/src/main/thrift/compaction-coordinator.thrift +++ b/core/src/main/thrift/compaction-coordinator.thrift @@ -101,19 +101,6 @@ service CompactionCoordinatorService { 2:client.ThriftNotActiveServiceException tnase ) - /* - * Called by Compactor to update the Coordinator with the state of the compaction - */ - void updateCompactionStatus( - 1:client.TInfo tinfo - 2:security.TCredentials credentials - 3:string externalCompactionId - 4:TCompactionStatusUpdate status - 5:i64 timestamp - )throws( - 1:client.ThriftSecurityException sec - 2:client.ThriftNotActiveServiceException tnase - ) /* * Called by Compactor on unsuccessful completion of compaction job diff --git a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java index 16b04092ef3..5a1ff0e1155 100644 --- a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java +++ b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java @@ -66,7 +66,6 @@ import org.apache.accumulo.core.compaction.thrift.CompactionCoordinatorService.Client; import org.apache.accumulo.core.compaction.thrift.CompactorService; import org.apache.accumulo.core.compaction.thrift.TCompactionState; -import org.apache.accumulo.core.compaction.thrift.TCompactionStatusUpdate; import org.apache.accumulo.core.compaction.thrift.TExternalCompaction; import org.apache.accumulo.core.compaction.thrift.TNextCompactionJob; import org.apache.accumulo.core.compaction.thrift.UnknownCompactionIdException; @@ -464,37 +463,6 @@ public void cancel(TInfo tinfo, TCredentials credentials, String externalCompact cancel(externalCompactionId); } - /** - * Send an update to the CompactionCoordinator for this job - * - * @param job compactionJob - * @param update status update - * @throws RetriesExceededException thrown when retries have been exceeded - */ - protected void updateCompactionState(TExternalCompactionJob job, TCompactionStatusUpdate update) - throws RetriesExceededException { - long updateTime = System.currentTimeMillis(); - TExternalCompaction tec = JOB_HOLDER.getCurrentCompaction(); - if (update.getState() == TCompactionState.STARTED) { - tec.setStartTime(updateTime); - } - tec.putToUpdates(updateTime, update); - RetryableThriftCall thriftCall = - new RetryableThriftCall<>(1000, RetryableThriftCall.MAX_WAIT_TIME, 25, () -> { - Client coordinatorClient = getCoordinatorClient(); - try { - LOG.trace("Attempting to update compaction state in coordinator {}", - job.getExternalCompactionId()); - coordinatorClient.updateCompactionStatus(TraceUtil.traceInfo(), getContext().rpcCreds(), - job.getExternalCompactionId(), update, updateTime); - return ""; - } finally { - ThriftUtil.returnClient(coordinatorClient, getContext()); - } - }); - thriftCall.run(); - } - /** * Notify the CompactionCoordinator the job failed * @@ -616,9 +584,6 @@ protected FileCompactorRunnable createCompactionJob(final TExternalCompactionJob public void initialize() throws RetriesExceededException { LOG.info("Starting up compaction runnable for job: {}", job); this.compactionStartTime = Timer.startNew(); - TCompactionStatusUpdate update = new TCompactionStatusUpdate(TCompactionState.STARTED, - "Compaction started", -1, -1, -1, getCompactionAge().toNanos()); - updateCompactionState(job, update); final var extent = KeyExtent.fromThrift(job.getExtent()); final AccumuloConfiguration aConfig; final TableConfiguration tConfig = getContext().getTableConfiguration(extent.tableId()); @@ -685,10 +650,6 @@ public void run() { JOB_HOLDER.setStats(cs); LOG.info("Compaction completed successfully {} ", job.getExternalCompactionId()); - // Update state when completed - TCompactionStatusUpdate update2 = new TCompactionStatusUpdate(TCompactionState.SUCCEEDED, - "Compaction completed successfully", -1, -1, -1, this.getCompactionAge().toNanos()); - updateCompactionState(job, update2); } catch (FileCompactor.CompactionCanceledException cce) { LOG.debug("Compaction canceled {}", job.getExternalCompactionId()); err.set(cce); @@ -957,16 +918,7 @@ public void run() { "Compaction in progress, read %d of %d input entries ( %s %s ), written %d entries", entriesRead, inputEntries, percentComplete, "%", entriesWritten); watcher.run(); - try { - LOG.debug("Updating coordinator with compaction progress: {}.", message); - TCompactionStatusUpdate update = new TCompactionStatusUpdate( - TCompactionState.IN_PROGRESS, message, inputEntries, entriesRead, - entriesWritten, fcr.getCompactionAge().toNanos()); - updateCompactionState(job, update); - } catch (RetriesExceededException e) { - LOG.warn("Error updating coordinator with compaction progress, error: {}", - e.getMessage()); - } + LOG.debug("Compaction progress: {}.", message); } } else { LOG.debug("Waiting on compaction thread to finish, but no RUNNING compaction"); @@ -986,12 +938,8 @@ public void run() { if (compactionThread.isInterrupted() || JOB_HOLDER.isCancelled() || (err.get() != null && err.get().getClass().equals(InterruptedException.class))) { - LOG.warn("Compaction thread was interrupted, sending CANCELLED state"); + LOG.warn("Compaction thread was interrupted"); try { - TCompactionStatusUpdate update = - new TCompactionStatusUpdate(TCompactionState.CANCELLED, "Compaction cancelled", - -1, -1, -1, fcr.getCompactionAge().toNanos()); - updateCompactionState(job, update); updateCompactionFailed(job, TCompactionState.CANCELLED, "Compaction cancelled"); cancelled.incrementAndGet(); } catch (RetriesExceededException e) { @@ -1002,12 +950,8 @@ public void run() { } else if (err.get() != null) { final KeyExtent fromThriftExtent = KeyExtent.fromThrift(job.getExtent()); try { - LOG.info("Updating coordinator with compaction failure: id: {}, extent: {}", - job.getExternalCompactionId(), fromThriftExtent); - TCompactionStatusUpdate update = new TCompactionStatusUpdate(TCompactionState.FAILED, - "Compaction failed due to: " + err.get().getMessage(), -1, -1, -1, - fcr.getCompactionAge().toNanos()); - updateCompactionState(job, update); + LOG.info("Compaction failed: id: {}, extent: {}", job.getExternalCompactionId(), + fromThriftExtent); updateCompactionFailed(job, TCompactionState.FAILED, "Compaction failed due to: " + err.get().getMessage()); failed.incrementAndGet(); 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 4da7b76fa51..51685c166cd 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 @@ -66,7 +66,6 @@ import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException; import org.apache.accumulo.core.compaction.thrift.CompactionCoordinatorService; import org.apache.accumulo.core.compaction.thrift.TCompactionState; -import org.apache.accumulo.core.compaction.thrift.TCompactionStatusUpdate; import org.apache.accumulo.core.compaction.thrift.TNextCompactionJob; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.data.ResourceGroupId; @@ -855,29 +854,6 @@ public boolean test(TabletMetadata tabletMetadata) { } } - /** - * Compactor calls to update the status of the assigned compaction - * - * @param tinfo trace info - * @param credentials tcredentials object - * @param externalCompactionId compaction id - * @param update compaction status update - * @param timestamp timestamp of the message - * @throws ThriftSecurityException when permission error - */ - @Override - public void updateCompactionStatus(TInfo tinfo, TCredentials credentials, - String externalCompactionId, TCompactionStatusUpdate update, long timestamp) - 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(); - } - LOG.debug("Compaction status update, id: {}, timestamp: {}, update: {}", externalCompactionId, - timestamp, update); - } - protected Set readExternalCompactionIds() { try (TabletsMetadata tabletsMetadata = this.ctx.getAmple().readTablets().forLevel(Ample.DataLevel.USER) diff --git a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalDoNothingCompactor.java b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalDoNothingCompactor.java index 7a7a6849b16..afa424d5c30 100644 --- a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalDoNothingCompactor.java +++ b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalDoNothingCompactor.java @@ -28,8 +28,6 @@ import org.apache.accumulo.compactor.Compactor; import org.apache.accumulo.core.cli.ServerOpts; -import org.apache.accumulo.core.compaction.thrift.TCompactionState; -import org.apache.accumulo.core.compaction.thrift.TCompactionStatusUpdate; import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.metadata.ReferencedTabletFile; import org.apache.accumulo.core.metadata.schema.ExternalCompactionId; @@ -84,10 +82,6 @@ public Duration getCompactionAge() { public void run() { try { LOG.info("Starting up compaction runnable for job: {}", job); - TCompactionStatusUpdate update = new TCompactionStatusUpdate(); - update.setState(TCompactionState.STARTED); - update.setMessage("Compaction started"); - updateCompactionState(job, update); // Create tmp output file final TabletMetadata tm = getContext().getAmple()