From commits-return-25048-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Wed Jun 16 20:30:32 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 9CD6318063B for ; Wed, 16 Jun 2021 22:30:32 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id CFEA13EC58 for ; Wed, 16 Jun 2021 20:30:31 +0000 (UTC) Received: (qmail 92643 invoked by uid 500); 16 Jun 2021 20:30:31 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 92634 invoked by uid 99); 16 Jun 2021 20:30:31 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jun 2021 20:30:31 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 63E1281AA4; Wed, 16 Jun 2021 20:30:31 +0000 (UTC) Date: Wed, 16 Jun 2021 20:30:31 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] branch main updated: Removed unused methods from Compactor and CompactionCoordinator (#2168) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <162387543110.18935.12115801744618788378@gitbox.apache.org> From: dlmarion@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Oldrev: 9d42e3bf4cb3650b72b680f91855eeda6ff6ee53 X-Git-Newrev: 4251c283a41c300ea485ed23e7eebb09ba5fdea4 X-Git-Rev: 4251c283a41c300ea485ed23e7eebb09ba5fdea4 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. dlmarion pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git The following commit(s) were added to refs/heads/main by this push: new 4251c28 Removed unused methods from Compactor and CompactionCoordinator (#2168) 4251c28 is described below commit 4251c283a41c300ea485ed23e7eebb09ba5fdea4 Author: Dave Marion AuthorDate: Wed Jun 16 16:30:23 2021 -0400 Removed unused methods from Compactor and CompactionCoordinator (#2168) Removed: Compactor.cancel from the Thrift API and class CompactionCoordinator.getMetadataEntryForExtent() CompactionCoodinator.getCompactorConnection() Closes #2159 --- .../core/compaction/thrift/CompactorService.java | 1118 -------------------- core/src/main/thrift/compaction-coordinator.thrift | 11 - .../coordinator/CompactionCoordinator.java | 24 - .../coordinator/CompactionCoordinatorTest.java | 17 - .../org/apache/accumulo/compactor/Compactor.java | 23 - 5 files changed, 1193 deletions(-) diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java index d049564..4530c5f 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/compaction/thrift/CompactorService.java @@ -29,8 +29,6 @@ public class CompactorService { public interface Iface { - public void cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId) throws UnknownCompactionIdException, org.apache.thrift.TException; - public org.apache.accumulo.core.tabletserver.thrift.TExternalCompactionJob getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.thrift.TException; public java.lang.String getRunningCompactionId(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.thrift.TException; @@ -41,8 +39,6 @@ public class CompactorService { public interface AsyncIface { - public void cancel(org.apache.accumulo.core.trace.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 getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getRunningCompactionId(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -71,31 +67,6 @@ public class CompactorService { super(iprot, oprot); } - public void cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId) throws UnknownCompactionIdException, org.apache.thrift.TException - { - send_cancel(tinfo, credentials, externalCompactionId); - recv_cancel(); - } - - public void send_cancel(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId) throws org.apache.thrift.TException - { - cancel_args args = new cancel_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.setExternalCompactionId(externalCompactionId); - sendBase("cancel", args); - } - - public void recv_cancel() throws UnknownCompactionIdException, org.apache.thrift.TException - { - cancel_result result = new cancel_result(); - receiveBase(result, "cancel"); - if (result.e != null) { - throw result.e; - } - return; - } - public org.apache.accumulo.core.tabletserver.thrift.TExternalCompactionJob getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials) throws org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException, org.apache.thrift.TException { send_getRunningCompaction(tinfo, credentials); @@ -195,44 +166,6 @@ public class CompactorService { super(protocolFactory, clientManager, transport); } - public void cancel(org.apache.accumulo.core.trace.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(); - cancel_call method_call = new cancel_call(tinfo, credentials, externalCompactionId, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class cancel_call extends org.apache.thrift.async.TAsyncMethodCall { - private org.apache.accumulo.core.trace.thrift.TInfo tinfo; - private org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials; - private java.lang.String externalCompactionId; - public cancel_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String externalCompactionId, 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; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("cancel", org.apache.thrift.protocol.TMessageType.CALL, 0)); - cancel_args args = new cancel_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.setExternalCompactionId(externalCompactionId); - args.write(prot); - prot.writeMessageEnd(); - } - - public Void getResult() throws UnknownCompactionIdException, 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 null; - } - } - public void getRunningCompaction(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getRunningCompaction_call method_call = new getRunningCompaction_call(tinfo, credentials, resultHandler, this, ___protocolFactory, ___transport); @@ -351,42 +284,12 @@ public class CompactorService { } private static java.util.Map> getProcessMap(java.util.Map> processMap) { - processMap.put("cancel", new cancel()); processMap.put("getRunningCompaction", new getRunningCompaction()); processMap.put("getRunningCompactionId", new getRunningCompactionId()); processMap.put("getActiveCompactions", new getActiveCompactions()); return processMap; } - public static class cancel extends org.apache.thrift.ProcessFunction { - public cancel() { - super("cancel"); - } - - public cancel_args getEmptyArgsInstance() { - return new cancel_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public cancel_result getResult(I iface, cancel_args args) throws org.apache.thrift.TException { - cancel_result result = new cancel_result(); - try { - iface.cancel(args.tinfo, args.credentials, args.externalCompactionId); - } catch (UnknownCompactionIdException e) { - result.e = e; - } - return result; - } - } - public static class getRunningCompaction extends org.apache.thrift.ProcessFunction { public getRunningCompaction() { super("getRunningCompaction"); @@ -487,77 +390,12 @@ public class CompactorService { } private static java.util.Map> getProcessMap(java.util.Map> processMap) { - processMap.put("cancel", new cancel()); processMap.put("getRunningCompaction", new getRunningCompaction()); processMap.put("getRunningCompactionId", new getRunningCompactionId()); processMap.put("getActiveCompactions", new getActiveCompactions()); return processMap; } - public static class cancel extends org.apache.thrift.AsyncProcessFunction { - public cancel() { - super("cancel"); - } - - public cancel_args getEmptyArgsInstance() { - return new cancel_args(); - } - - 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() { - public void onComplete(Void o) { - cancel_result result = new cancel_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); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - cancel_result result = new cancel_result(); - if (e instanceof UnknownCompactionIdException) { - result.e = (UnknownCompactionIdException) e; - result.setEIsSet(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(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, cancel_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.cancel(args.tinfo, args.credentials, args.externalCompactionId,resultHandler); - } - } - public static class getRunningCompaction extends org.apache.thrift.AsyncProcessFunction { public getRunningCompaction() { super("getRunningCompaction"); @@ -755,962 +593,6 @@ public class CompactorService { } - 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"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new cancel_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new cancel_argsTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.trace.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 - - /** 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"); - - 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; - 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; - } - - public short getThriftFieldId() { - return _thriftId; - } - - 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.trace.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancel_args.class, metaDataMap); - } - - public cancel_args() { - } - - public cancel_args( - org.apache.accumulo.core.trace.thrift.TInfo tinfo, - org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, - java.lang.String externalCompactionId) - { - this(); - this.tinfo = tinfo; - this.credentials = credentials; - this.externalCompactionId = externalCompactionId; - } - - /** - * Performs a deep copy on other. - */ - public cancel_args(cancel_args other) { - if (other.isSetTinfo()) { - this.tinfo = new org.apache.accumulo.core.trace.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; - } - } - - public cancel_args deepCopy() { - return new cancel_args(this); - } - - @Override - public void clear() { - this.tinfo = null; - this.credentials = null; - this.externalCompactionId = null; - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.trace.thrift.TInfo getTinfo() { - return this.tinfo; - } - - public cancel_args setTinfo(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.trace.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 cancel_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 cancel_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; - } - } - - 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.trace.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case TINFO: - return getTinfo(); - - case CREDENTIALS: - return getCredentials(); - - case EXTERNAL_COMPACTION_ID: - return getExternalCompactionId(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case TINFO: - return isSetTinfo(); - case CREDENTIALS: - return isSetCredentials(); - case EXTERNAL_COMPACTION_ID: - return isSetExternalCompactionId(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof cancel_args) - return this.equals((cancel_args)that); - return false; - } - - public boolean equals(cancel_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; - } - - 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(); - - return hashCode; - } - - @Override - public int compareTo(cancel_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetTinfo()).compareTo(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.valueOf(isSetCredentials()).compareTo(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.valueOf(isSetExternalCompactionId()).compareTo(other.isSetExternalCompactionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExternalCompactionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.externalCompactionId, other.externalCompactionId); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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("cancel_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; - 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 cancel_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public cancel_argsStandardScheme getScheme() { - return new cancel_argsStandardScheme(); - } - } - - private static class cancel_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, cancel_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.trace.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; - 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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, cancel_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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class cancel_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public cancel_argsTupleScheme getScheme() { - return new cancel_argsTupleScheme(); - } - } - - private static class cancel_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, cancel_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); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetTinfo()) { - struct.tinfo.write(oprot); - } - if (struct.isSetCredentials()) { - struct.credentials.write(oprot); - } - if (struct.isSetExternalCompactionId()) { - oprot.writeString(struct.externalCompactionId); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, cancel_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(3); - if (incoming.get(0)) { - struct.tinfo = new org.apache.accumulo.core.trace.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); - } - } - } - - 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(); - } - } - - public static class cancel_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("cancel_result"); - - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new cancel_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new cancel_resultTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable UnknownCompactionIdException e; // 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 { - E((short)1, "e"); - - 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: // E - return E; - 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; - } - - public short getThriftFieldId() { - return _thriftId; - } - - 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.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UnknownCompactionIdException.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancel_result.class, metaDataMap); - } - - public cancel_result() { - } - - public cancel_result( - UnknownCompactionIdException e) - { - this(); - this.e = e; - } - - /** - * Performs a deep copy on other. - */ - public cancel_result(cancel_result other) { - if (other.isSetE()) { - this.e = new UnknownCompactionIdException(other.e); - } - } - - public cancel_result deepCopy() { - return new cancel_result(this); - } - - @Override - public void clear() { - this.e = null; - } - - @org.apache.thrift.annotation.Nullable - public UnknownCompactionIdException getE() { - return this.e; - } - - public cancel_result setE(@org.apache.thrift.annotation.Nullable UnknownCompactionIdException e) { - this.e = e; - return this; - } - - public void unsetE() { - this.e = null; - } - - /** Returns true if field e is set (has been assigned a value) and false otherwise */ - public boolean isSetE() { - return this.e != null; - } - - public void setEIsSet(boolean value) { - if (!value) { - this.e = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case E: - if (value == null) { - unsetE(); - } else { - setE((UnknownCompactionIdException)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case E: - return getE(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case E: - return isSetE(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof cancel_result) - return this.equals((cancel_result)that); - return false; - } - - public boolean equals(cancel_result that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_e = true && this.isSetE(); - boolean that_present_e = true && that.isSetE(); - if (this_present_e || that_present_e) { - if (!(this_present_e && that_present_e)) - return false; - if (!this.e.equals(that.e)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetE()) ? 131071 : 524287); - if (isSetE()) - hashCode = hashCode * 8191 + e.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(cancel_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetE()).compareTo(other.isSetE()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetE()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, other.e); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - 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("cancel_result("); - boolean first = true; - - sb.append("e:"); - if (this.e == null) { - sb.append("null"); - } else { - sb.append(this.e); - } - 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 cancel_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public cancel_resultStandardScheme getScheme() { - return new cancel_resultStandardScheme(); - } - } - - private static class cancel_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, cancel_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: // E - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.e = new UnknownCompactionIdException(); - struct.e.read(iprot); - struct.setEIsSet(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(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, cancel_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.e != null) { - oprot.writeFieldBegin(E_FIELD_DESC); - struct.e.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class cancel_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public cancel_resultTupleScheme getScheme() { - return new cancel_resultTupleScheme(); - } - } - - private static class cancel_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, cancel_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.isSetE()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetE()) { - struct.e.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, cancel_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.e = new UnknownCompactionIdException(); - struct.e.read(iprot); - struct.setEIsSet(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(); - } - } - public static class getRunningCompaction_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("getRunningCompaction_args"); diff --git a/core/src/main/thrift/compaction-coordinator.thrift b/core/src/main/thrift/compaction-coordinator.thrift index c599527..4e9d6b5 100644 --- a/core/src/main/thrift/compaction-coordinator.thrift +++ b/core/src/main/thrift/compaction-coordinator.thrift @@ -100,17 +100,6 @@ service CompactionCoordinatorService { service CompactorService { - /* - * Called by Coordinator to instruct the Compactor to stop working on the compaction. - */ - void cancel( - 1:trace.TInfo tinfo - 2:security.TCredentials credentials - 3:string externalCompactionId - ) throws ( - 1:UnknownCompactionIdException e - ) - tabletserver.TExternalCompactionJob getRunningCompaction( 1:trace.TInfo tinfo 2:security.TCredentials credentials diff --git a/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java b/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java index 3143a84..b6c15c7 100644 --- a/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java +++ b/server/compaction-coordinator/src/main/java/org/apache/accumulo/coordinator/CompactionCoordinator.java @@ -40,7 +40,6 @@ import org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode; import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException; import org.apache.accumulo.core.compaction.thrift.CompactionCoordinatorService; import org.apache.accumulo.core.compaction.thrift.CompactionCoordinatorService.Iface; -import org.apache.accumulo.core.compaction.thrift.CompactorService; import org.apache.accumulo.core.compaction.thrift.TCompactionState; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; @@ -48,8 +47,6 @@ import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.dataImpl.thrift.TKeyExtent; import org.apache.accumulo.core.metadata.TServerInstance; import org.apache.accumulo.core.metadata.schema.ExternalCompactionId; -import org.apache.accumulo.core.metadata.schema.TabletMetadata; -import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType; import org.apache.accumulo.core.rpc.ThriftUtil; import org.apache.accumulo.core.securityImpl.thrift.TCredentials; import org.apache.accumulo.core.tabletserver.thrift.TCompactionQueueSummary; @@ -360,11 +357,6 @@ public class CompactionCoordinator extends AbstractServer .getTimeInMillis(Property.COMPACTION_COORDINATOR_TSERVER_COMPACTION_CHECK_INTERVAL); } - protected TabletMetadata getMetadataEntryForExtent(KeyExtent extent) { - return getContext().getAmple().readTablets().forTablet(extent) - .fetch(ColumnType.LOCATION, ColumnType.PREV_ROW).build().stream().findFirst().orElse(null); - } - /** * Callback for the LiveTServerSet object to update current set of tablet servers, including ones * that were deleted and added @@ -477,22 +469,6 @@ public class CompactionCoordinator extends AbstractServer } /** - * Return the Thrift client for the Compactor - * - * @param compactorAddress - * compactor address - * @return thrift client - * @throws TTransportException - * thrift error - */ - protected CompactorService.Client getCompactorConnection(HostAndPort compactorAddress) - throws TTransportException { - TTransport transport = - ThriftTransportPool.getInstance().getTransport(compactorAddress, 0, getContext()); - return ThriftUtil.createClient(new CompactorService.Client.Factory(), transport); - } - - /** * Compactor calls compactionCompleted passing in the CompactionStats * * @param tinfo diff --git a/server/compaction-coordinator/src/test/java/org/apache/accumulo/coordinator/CompactionCoordinatorTest.java b/server/compaction-coordinator/src/test/java/org/apache/accumulo/coordinator/CompactionCoordinatorTest.java index 62269ad..ab4b111 100644 --- a/server/compaction-coordinator/src/test/java/org/apache/accumulo/coordinator/CompactionCoordinatorTest.java +++ b/server/compaction-coordinator/src/test/java/org/apache/accumulo/coordinator/CompactionCoordinatorTest.java @@ -36,11 +36,9 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException; import org.apache.accumulo.core.conf.AccumuloConfiguration; -import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.dataImpl.thrift.TKeyExtent; import org.apache.accumulo.core.metadata.TServerInstance; import org.apache.accumulo.core.metadata.schema.ExternalCompactionId; -import org.apache.accumulo.core.metadata.schema.TabletMetadata; import org.apache.accumulo.core.rpc.ThriftUtil; import org.apache.accumulo.core.securityImpl.thrift.TCredentials; import org.apache.accumulo.core.tabletserver.thrift.TCompactionQueueSummary; @@ -177,21 +175,6 @@ public class CompactionCoordinatorTest { getRunning().clear(); } - @Override - protected TabletMetadata getMetadataEntryForExtent(KeyExtent extent) { - return new TabletMetadata() { - @Override - public Location getLocation() { - return new Location("localhost:9997", "", LocationType.CURRENT); - } - - @Override - public KeyExtent getExtent() { - return extent; - } - }; - } - } @Test 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 0261f1a..41865f0 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 @@ -327,29 +327,6 @@ public class Compactor extends AbstractServer implements CompactorService.Iface } /** - * Called by a CompactionCoordinator to cancel the currently running compaction - * - * @param tinfo - * trace info - * @param credentials - * caller credentials - * @param externalCompactionId - * compaction id - * @throws UnknownCompactionIdException - * if the externalCompactionId does not match the currently executing compaction - */ - @Override - public void cancel(TInfo tinfo, TCredentials credentials, String externalCompactionId) - throws TException { - // 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(); - } - cancel(externalCompactionId); - } - - /** * Cancel the compaction with this id. * * @param externalCompactionId