This is an automated email from the ASF dual-hosted git repository. kturner 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 aa32e15361 Remove unneeded chop compaction and split code (#3773) aa32e15361 is described below commit aa32e15361f01915a0ebd8bef3f50beccbdf115f Author: Christopher L. Shannon <christopher.l.shan...@gmail.com> AuthorDate: Tue Sep 26 12:47:08 2023 -0400 Remove unneeded chop compaction and split code (#3773) This is a follow on to #3761 to clean up code that is no longer necessary. No-chop merge removes the need for chop compactions and splits are no longer necessary to be called from the manager anymore during deletions as files are instead fenced. This closes #3769 --- .../core/client/admin/ActiveCompaction.java | 3 +- .../core/metadata/TabletLocationState.java | 6 +- .../accumulo/core/metadata/schema/Ample.java | 2 - .../core/metadata/schema/MetadataSchema.java | 10 - .../core/metadata/schema/TabletMetadata.java | 13 +- .../core/spi/compaction/CompactionKind.java | 3 +- .../spi/compaction/DefaultCompactionPlanner.java | 3 +- .../util/compaction/CompactionJobPrioritizer.java | 1 - .../core/manager/thrift/TabletLoadState.java | 5 +- .../thrift/TabletManagementClientService.java | 842 --------------------- .../core/tabletserver/thrift/TCompactionKind.java | 13 +- .../tabletserver/thrift/TCompactionReason.java | 9 +- core/src/main/thrift/manager.thrift | 1 - core/src/main/thrift/tabletmgmt.thrift | 7 - core/src/main/thrift/tabletserver.thrift | 2 - .../util/compaction/CompactionPrioritizerTest.java | 4 +- .../server/constraints/MetadataConstraints.java | 2 - .../accumulo/server/manager/LiveTServerSet.java | 10 - .../accumulo/server/manager/state/MergeState.java | 8 - .../server/manager/state/MetaDataTableScanner.java | 7 +- .../server/manager/state/ZooTabletStateStore.java | 2 +- .../server/metadata/TabletMutatorBase.java | 8 - .../accumulo/server/util/MetadataTableUtil.java | 10 - .../manager/state/RootTabletStateStoreTest.java | 5 +- .../manager/state/TabletLocationStateTest.java | 31 +- .../org/apache/accumulo/compactor/ExtCEnv.java | 2 - .../gc/GarbageCollectWriteAheadLogsTest.java | 8 +- .../java/org/apache/accumulo/manager/Manager.java | 1 - .../manager/ManagerClientServiceHandler.java | 3 - .../accumulo/manager/TabletGroupWatcher.java | 10 +- .../apache/accumulo/manager/state/MergeStats.java | 68 +- .../manager/upgrade/UpgraderConstants.java | 33 +- .../accumulo/tserver/TabletClientHandler.java | 17 - .../accumulo/tserver/UnloadTabletHandler.java | 3 +- .../accumulo/tserver/tablet/CompactableImpl.java | 206 +---- .../accumulo/tserver/tablet/CompactableUtils.java | 21 - .../apache/accumulo/tserver/tablet/MajCEnv.java | 2 - .../org/apache/accumulo/tserver/tablet/Tablet.java | 10 +- .../tablet/CompactableImplFileManagerTest.java | 86 +-- .../apache/accumulo/test/manager/MergeStateIT.java | 6 +- .../accumulo/test/performance/NullTserver.java | 3 - 41 files changed, 90 insertions(+), 1396 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java b/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java index 3c804fac41..cfcdc1def9 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java +++ b/core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java @@ -54,8 +54,9 @@ public abstract class ActiveCompaction { */ SYSTEM, /** - * Compaction initiated by merge operation + * @deprecated Chop compactions have been removed */ + @Deprecated(since = "3.1", forRemoval = true) CHOP, /** * idle compaction diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java b/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java index d0cd66300b..03c3dce59d 100644 --- a/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java +++ b/core/src/main/java/org/apache/accumulo/core/metadata/TabletLocationState.java @@ -56,7 +56,7 @@ public class TabletLocationState { } public TabletLocationState(KeyExtent extent, Location future, Location current, Location last, - SuspendingTServer suspend, Collection<Collection<String>> walogs, boolean chopped) + SuspendingTServer suspend, Collection<Collection<String>> walogs) throws BadLocationStateException { this.extent = extent; this.future = validateLocation(future, TabletMetadata.LocationType.FUTURE); @@ -67,7 +67,6 @@ public class TabletLocationState { walogs = Collections.emptyList(); } this.walogs = walogs; - this.chopped = chopped; if (hasCurrent() && hasFuture()) { throw new BadLocationStateException( extent + " is both assigned and hosted, which should never happen: " + this, @@ -81,7 +80,6 @@ public class TabletLocationState { public final Location last; public final SuspendingTServer suspend; public final Collection<Collection<String>> walogs; - public final boolean chopped; public TServerInstance getCurrentServer() { return serverInstance(current); @@ -150,7 +148,7 @@ public class TabletLocationState { @Override public String toString() { - return extent + "@(" + future + "," + current + "," + last + ")" + (chopped ? " chopped" : ""); + return extent + "@(" + future + "," + current + "," + last + ")"; } private static Location validateLocation(final Location location, diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java b/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java index 706447d37d..553f029e1f 100644 --- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java +++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java @@ -302,8 +302,6 @@ public interface Ample { TabletMutator deleteBulkFile(StoredTabletFile bulkref); - TabletMutator putChopped(); - TabletMutator putSuspension(TServerInstance tserver, long suspensionTime); TabletMutator deleteSuspension(); diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java b/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java index 38abc7e459..0cb57e586f 100644 --- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java +++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/MetadataSchema.java @@ -321,16 +321,6 @@ public class MetadataSchema { public static final Text NAME = new Text(STR_NAME); } - /** - * Column family for indicating that the files in a tablet have been trimmed to only include - * data for the current tablet, so that they are safe to merge - */ - public static class ChoppedColumnFamily { - public static final String STR_NAME = "chopped"; - public static final Text NAME = new Text(STR_NAME); - public static final ColumnFQ CHOPPED_COLUMN = new ColumnFQ(NAME, new Text(STR_NAME)); - } - public static class ExternalCompactionColumnFamily { public static final String STR_NAME = "ecomp"; public static final Text NAME = new Text(STR_NAME); diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java b/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java index 29243b92fa..bc58b2b806 100644 --- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java +++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java @@ -55,7 +55,6 @@ import org.apache.accumulo.core.metadata.TServerInstance; import org.apache.accumulo.core.metadata.TabletLocationState; import org.apache.accumulo.core.metadata.TabletState; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.BulkFileColumnFamily; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ClonedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily; @@ -105,7 +104,6 @@ public class TabletMetadata { private OptionalLong compact = OptionalLong.empty(); private Double splitRatio = null; private Map<ExternalCompactionId,ExternalCompactionMetadata> extCompactions; - private boolean chopped = false; public enum LocationType { CURRENT, FUTURE, LAST @@ -127,7 +125,6 @@ public class TabletMetadata { COMPACT_ID, SPLIT_RATIO, SUSPEND, - CHOPPED, ECOMP } @@ -348,11 +345,6 @@ public class TabletMetadata { return splitRatio; } - public boolean hasChopped() { - ensureFetched(ColumnType.CHOPPED); - return chopped; - } - public SortedMap<Key,Value> getKeyValues() { Preconditions.checkState(keyValues != null, "Requested key values when it was not saved"); return keyValues; @@ -371,7 +363,7 @@ public class TabletMetadata { future = location; } // only care about the state so don't need walogs and chopped params - var tls = new TabletLocationState(extent, future, current, last, suspend, null, false); + var tls = new TabletLocationState(extent, future, current, last, suspend, null); return tls.getState(liveTServers); } catch (TabletLocationState.BadLocationStateException blse) { throw new IllegalArgumentException("Error creating TabletLocationState", blse); @@ -487,9 +479,6 @@ public class TabletMetadata { extCompBuilder.put(ExternalCompactionId.of(qual), ExternalCompactionMetadata.fromJson(val)); break; - case ChoppedColumnFamily.STR_NAME: - te.chopped = true; - break; default: throw new IllegalStateException("Unexpected family " + fam); } diff --git a/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java b/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java index a47909612e..1e1fb35217 100644 --- a/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java +++ b/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java @@ -38,7 +38,8 @@ public enum CompactionKind { */ USER, /** - * A compaction executed prior to merging tablets. + * @deprecated Chop Compactions have been deprecated */ + @Deprecated(since = "3.1") CHOP } diff --git a/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java b/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java index 1b5b662957..ad512da818 100644 --- a/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java +++ b/core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java @@ -272,8 +272,7 @@ public class DefaultCompactionPlanner implements CompactionPlanner { } if (group.isEmpty() - && (params.getKind() == CompactionKind.USER || params.getKind() == CompactionKind.SELECTOR - || params.getKind() == CompactionKind.CHOP) + && (params.getKind() == CompactionKind.USER || params.getKind() == CompactionKind.SELECTOR) && params.getRunningCompactions().stream() .noneMatch(job -> job.getKind() == params.getKind())) { group = findMaximalRequiredSetToCompact(params.getCandidates(), maxFilesToCompact); diff --git a/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionJobPrioritizer.java b/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionJobPrioritizer.java index 1f87459f11..261349cb6f 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionJobPrioritizer.java +++ b/core/src/main/java/org/apache/accumulo/core/util/compaction/CompactionJobPrioritizer.java @@ -35,7 +35,6 @@ public class CompactionJobPrioritizer { switch (kind) { case USER: - case CHOP: // user-initiated compactions will have a positive priority // based on number of files if (prio > Short.MAX_VALUE) { diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/TabletLoadState.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/TabletLoadState.java index aa837333fc..8f06a49bff 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/TabletLoadState.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/manager/thrift/TabletLoadState.java @@ -30,8 +30,7 @@ public enum TabletLoadState implements org.apache.thrift.TEnum { LOAD_FAILURE(1), UNLOADED(2), UNLOAD_FAILURE_NOT_SERVING(3), - UNLOAD_ERROR(4), - CHOPPED(5); + UNLOAD_ERROR(4); private final int value; @@ -64,8 +63,6 @@ public enum TabletLoadState implements org.apache.thrift.TEnum { return UNLOAD_FAILURE_NOT_SERVING; case 4: return UNLOAD_ERROR; - case 5: - return CHOPPED; default: return null; } diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tablet/thrift/TabletManagementClientService.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tablet/thrift/TabletManagementClientService.java index 3b1c16c47b..6b83212e98 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tablet/thrift/TabletManagementClientService.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tablet/thrift/TabletManagementClientService.java @@ -37,8 +37,6 @@ public class TabletManagementClientService { public void flushTablet(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) throws org.apache.thrift.TException; - public void chop(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) throws org.apache.thrift.TException; - } public interface AsyncIface { @@ -51,8 +49,6 @@ public class TabletManagementClientService { public void flushTablet(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; - public void chop(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; - } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -157,22 +153,6 @@ public class TabletManagementClientService { sendBaseOneway("flushTablet", args); } - @Override - public void chop(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) throws org.apache.thrift.TException - { - send_chop(tinfo, credentials, lock, extent); - } - - public void send_chop(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) throws org.apache.thrift.TException - { - chop_args args = new chop_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.setLock(lock); - args.setExtent(extent); - sendBaseOneway("chop", args); - } - } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { @@ -375,50 +355,6 @@ public class TabletManagementClientService { } } - @Override - public void chop(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { - checkReady(); - chop_call method_call = new chop_call(tinfo, credentials, lock, extent, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class chop_call extends org.apache.thrift.async.TAsyncMethodCall<Void> { - private org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo; - private org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials; - private java.lang.String lock; - private org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent; - public chop_call(org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, java.lang.String lock, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TE [...] - super(client, protocolFactory, transport, resultHandler, true); - this.tinfo = tinfo; - this.credentials = credentials; - this.lock = lock; - this.extent = extent; - } - - @Override - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("chop", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); - chop_args args = new chop_args(); - args.setTinfo(tinfo); - args.setCredentials(credentials); - args.setLock(lock); - args.setExtent(extent); - args.write(prot); - prot.writeMessageEnd(); - } - - @Override - public Void getResult() throws 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 static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -436,7 +372,6 @@ public class TabletManagementClientService { processMap.put("unloadTablet", new unloadTablet()); processMap.put("splitTablet", new splitTablet()); processMap.put("flushTablet", new flushTablet()); - processMap.put("chop", new chop()); return processMap; } @@ -555,33 +490,6 @@ public class TabletManagementClientService { } } - public static class chop<I extends Iface> extends org.apache.thrift.ProcessFunction<I, chop_args> { - public chop() { - super("chop"); - } - - @Override - public chop_args getEmptyArgsInstance() { - return new chop_args(); - } - - @Override - protected boolean isOneway() { - return true; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - @Override - public org.apache.thrift.TBase getResult(I iface, chop_args args) throws org.apache.thrift.TException { - iface.chop(args.tinfo, args.credentials, args.lock, args.extent); - return null; - } - } - } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -599,7 +507,6 @@ public class TabletManagementClientService { processMap.put("unloadTablet", new unloadTablet()); processMap.put("splitTablet", new splitTablet()); processMap.put("flushTablet", new flushTablet()); - processMap.put("chop", new chop()); return processMap; } @@ -797,46 +704,6 @@ public class TabletManagementClientService { } } - public static class chop<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, chop_args, Void> { - public chop() { - super("chop"); - } - - @Override - public chop_args getEmptyArgsInstance() { - return new chop_args(); - } - - @Override - public org.apache.thrift.async.AsyncMethodCallback<Void> 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<Void>() { - @Override - public void onComplete(Void o) { - } - @Override - public void onError(java.lang.Exception e) { - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - } else { - _LOGGER.error("Exception inside oneway handler", e); - } - } - }; - } - - @Override - protected boolean isOneway() { - return true; - } - - @Override - public void start(I iface, chop_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { - iface.chop(args.tinfo, args.credentials, args.lock, args.extent,resultHandler); - } - } - } @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) @@ -4396,714 +4263,5 @@ public class TabletManagementClientService { } } - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) - public static class chop_args implements org.apache.thrift.TBase<chop_args, chop_args._Fields>, java.io.Serializable, Cloneable, Comparable<chop_args> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("chop_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 LOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("lock", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField EXTENT_FIELD_DESC = new org.apache.thrift.protocol.TField("extent", org.apache.thrift.protocol.TType.STRUCT, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new chop_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new chop_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 lock; // required - public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent; // 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"), - LOCK((short)3, "lock"), - EXTENT((short)4, "extent"); - - private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); - - 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: // LOCK - return LOCK; - case 4: // EXTENT - return EXTENT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - @Override - public short getThriftFieldId() { - return _thriftId; - } - - @Override - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TINFO, new org.apache.thrift.meta_data.FieldMetaData("tinfo", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.clientImpl.thrift.TInfo.class))); - tmpMap.put(_Fields.CREDENTIALS, new org.apache.thrift.meta_data.FieldMetaData("credentials", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.securityImpl.thrift.TCredentials.class))); - tmpMap.put(_Fields.LOCK, new org.apache.thrift.meta_data.FieldMetaData("lock", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.EXTENT, new org.apache.thrift.meta_data.FieldMetaData("extent", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.accumulo.core.dataImpl.thrift.TKeyExtent.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(chop_args.class, metaDataMap); - } - - public chop_args() { - } - - public chop_args( - org.apache.accumulo.core.clientImpl.thrift.TInfo tinfo, - org.apache.accumulo.core.securityImpl.thrift.TCredentials credentials, - java.lang.String lock, - org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) - { - this(); - this.tinfo = tinfo; - this.credentials = credentials; - this.lock = lock; - this.extent = extent; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public chop_args(chop_args other) { - if (other.isSetTinfo()) { - this.tinfo = new org.apache.accumulo.core.clientImpl.thrift.TInfo(other.tinfo); - } - if (other.isSetCredentials()) { - this.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials(other.credentials); - } - if (other.isSetLock()) { - this.lock = other.lock; - } - if (other.isSetExtent()) { - this.extent = new org.apache.accumulo.core.dataImpl.thrift.TKeyExtent(other.extent); - } - } - - @Override - public chop_args deepCopy() { - return new chop_args(this); - } - - @Override - public void clear() { - this.tinfo = null; - this.credentials = null; - this.lock = null; - this.extent = null; - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.clientImpl.thrift.TInfo getTinfo() { - return this.tinfo; - } - - public chop_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 chop_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 getLock() { - return this.lock; - } - - public chop_args setLock(@org.apache.thrift.annotation.Nullable java.lang.String lock) { - this.lock = lock; - return this; - } - - public void unsetLock() { - this.lock = null; - } - - /** Returns true if field lock is set (has been assigned a value) and false otherwise */ - public boolean isSetLock() { - return this.lock != null; - } - - public void setLockIsSet(boolean value) { - if (!value) { - this.lock = null; - } - } - - @org.apache.thrift.annotation.Nullable - public org.apache.accumulo.core.dataImpl.thrift.TKeyExtent getExtent() { - return this.extent; - } - - public chop_args setExtent(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) { - this.extent = extent; - return this; - } - - public void unsetExtent() { - this.extent = null; - } - - /** Returns true if field extent is set (has been assigned a value) and false otherwise */ - public boolean isSetExtent() { - return this.extent != null; - } - - public void setExtentIsSet(boolean value) { - if (!value) { - this.extent = null; - } - } - - @Override - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case TINFO: - if (value == null) { - unsetTinfo(); - } else { - setTinfo((org.apache.accumulo.core.clientImpl.thrift.TInfo)value); - } - break; - - case CREDENTIALS: - if (value == null) { - unsetCredentials(); - } else { - setCredentials((org.apache.accumulo.core.securityImpl.thrift.TCredentials)value); - } - break; - - case LOCK: - if (value == null) { - unsetLock(); - } else { - setLock((java.lang.String)value); - } - break; - - case EXTENT: - if (value == null) { - unsetExtent(); - } else { - setExtent((org.apache.accumulo.core.dataImpl.thrift.TKeyExtent)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 LOCK: - return getLock(); - - case EXTENT: - return getExtent(); - - } - 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 LOCK: - return isSetLock(); - case EXTENT: - return isSetExtent(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof chop_args) - return this.equals((chop_args)that); - return false; - } - - public boolean equals(chop_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_lock = true && this.isSetLock(); - boolean that_present_lock = true && that.isSetLock(); - if (this_present_lock || that_present_lock) { - if (!(this_present_lock && that_present_lock)) - return false; - if (!this.lock.equals(that.lock)) - return false; - } - - boolean this_present_extent = true && this.isSetExtent(); - boolean that_present_extent = true && that.isSetExtent(); - if (this_present_extent || that_present_extent) { - if (!(this_present_extent && that_present_extent)) - return false; - if (!this.extent.equals(that.extent)) - 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 + ((isSetLock()) ? 131071 : 524287); - if (isSetLock()) - hashCode = hashCode * 8191 + lock.hashCode(); - - hashCode = hashCode * 8191 + ((isSetExtent()) ? 131071 : 524287); - if (isSetExtent()) - hashCode = hashCode * 8191 + extent.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(chop_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(isSetLock(), other.isSetLock()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLock()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lock, other.lock); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetExtent(), other.isSetExtent()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetExtent()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extent, other.extent); - 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("chop_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("lock:"); - if (this.lock == null) { - sb.append("null"); - } else { - sb.append(this.lock); - } - first = false; - if (!first) sb.append(", "); - sb.append("extent:"); - if (this.extent == null) { - sb.append("null"); - } else { - sb.append(this.extent); - } - 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 (extent != null) { - extent.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 chop_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public chop_argsStandardScheme getScheme() { - return new chop_argsStandardScheme(); - } - } - - private static class chop_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<chop_args> { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, chop_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: // LOCK - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lock = iprot.readString(); - struct.setLockIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // EXTENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.extent = new org.apache.accumulo.core.dataImpl.thrift.TKeyExtent(); - struct.extent.read(iprot); - struct.setExtentIsSet(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, chop_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.lock != null) { - oprot.writeFieldBegin(LOCK_FIELD_DESC); - oprot.writeString(struct.lock); - oprot.writeFieldEnd(); - } - if (struct.extent != null) { - oprot.writeFieldBegin(EXTENT_FIELD_DESC); - struct.extent.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class chop_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public chop_argsTupleScheme getScheme() { - return new chop_argsTupleScheme(); - } - } - - private static class chop_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<chop_args> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, chop_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.isSetLock()) { - optionals.set(2); - } - if (struct.isSetExtent()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetTinfo()) { - struct.tinfo.write(oprot); - } - if (struct.isSetCredentials()) { - struct.credentials.write(oprot); - } - if (struct.isSetLock()) { - oprot.writeString(struct.lock); - } - if (struct.isSetExtent()) { - struct.extent.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, chop_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(4); - 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.lock = iprot.readString(); - struct.setLockIsSet(true); - } - if (incoming.get(3)) { - struct.extent = new org.apache.accumulo.core.dataImpl.thrift.TKeyExtent(); - struct.extent.read(iprot); - struct.setExtentIsSet(true); - } - } - } - - private static <S extends org.apache.thrift.scheme.IScheme> 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(); - } - } - private static void unusedMethod() {} } diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java index eb0aae36f6..8600b9336d 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java @@ -26,10 +26,9 @@ package org.apache.accumulo.core.tabletserver.thrift; public enum TCompactionKind implements org.apache.thrift.TEnum { - CHOP(0), - SELECTOR(1), - SYSTEM(2), - USER(3); + SELECTOR(0), + SYSTEM(1), + USER(2); private final int value; @@ -53,12 +52,10 @@ public enum TCompactionKind implements org.apache.thrift.TEnum { public static TCompactionKind findByValue(int value) { switch (value) { case 0: - return CHOP; - case 1: return SELECTOR; - case 2: + case 1: return SYSTEM; - case 3: + case 2: return USER; default: return null; diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionReason.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionReason.java index 2c640dc5b5..09c99f0688 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionReason.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionReason.java @@ -28,9 +28,8 @@ package org.apache.accumulo.core.tabletserver.thrift; public enum TCompactionReason implements org.apache.thrift.TEnum { USER(0), SYSTEM(1), - CHOP(2), - IDLE(3), - CLOSE(4); + IDLE(2), + CLOSE(3); private final int value; @@ -58,10 +57,8 @@ public enum TCompactionReason implements org.apache.thrift.TEnum { case 1: return SYSTEM; case 2: - return CHOP; - case 3: return IDLE; - case 4: + case 3: return CLOSE; default: return null; diff --git a/core/src/main/thrift/manager.thrift b/core/src/main/thrift/manager.thrift index 03af0a7223..a334e0e692 100644 --- a/core/src/main/thrift/manager.thrift +++ b/core/src/main/thrift/manager.thrift @@ -46,7 +46,6 @@ enum TabletLoadState { UNLOADED UNLOAD_FAILURE_NOT_SERVING UNLOAD_ERROR - CHOPPED } enum FateOperation { diff --git a/core/src/main/thrift/tabletmgmt.thrift b/core/src/main/thrift/tabletmgmt.thrift index f90650b1b8..4a3d3e04ca 100644 --- a/core/src/main/thrift/tabletmgmt.thrift +++ b/core/src/main/thrift/tabletmgmt.thrift @@ -66,11 +66,4 @@ service TabletManagementClientService { 4:data.TKeyExtent extent ) - oneway void chop( - 1:client.TInfo tinfo - 2:security.TCredentials credentials - 3:string lock - 4:data.TKeyExtent extent - ) - } diff --git a/core/src/main/thrift/tabletserver.thrift b/core/src/main/thrift/tabletserver.thrift index 94b8e88d64..cb7c724ede 100644 --- a/core/src/main/thrift/tabletserver.thrift +++ b/core/src/main/thrift/tabletserver.thrift @@ -65,7 +65,6 @@ enum TCompactionType { enum TCompactionReason { USER SYSTEM - CHOP IDLE CLOSE } @@ -116,7 +115,6 @@ struct TExternalCompactionJob { } enum TCompactionKind { - CHOP SELECTOR SYSTEM USER diff --git a/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java b/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java index 70f18be1cd..6d50f8ecb2 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java @@ -74,12 +74,10 @@ public class CompactionPrioritizerTest { var j3 = createJob(CompactionKind.USER, "t-011", 11, 20); var j4 = createJob(CompactionKind.SYSTEM, "t-012", 11, 30); var j5 = createJob(CompactionKind.SYSTEM, "t-013", 5, 10); - var j6 = createJob(CompactionKind.CHOP, "t-014", 5, 40); - var j7 = createJob(CompactionKind.CHOP, "t-015", 5, 7); var j8 = createJob(CompactionKind.SELECTOR, "t-014", 5, 21); var j9 = createJob(CompactionKind.SELECTOR, "t-015", 7, 20); - var expected = List.of(j6, j2, j3, j1, j7, j4, j9, j8, j5); + var expected = List.of(j2, j3, j1, j4, j9, j8, j5); var shuffled = new ArrayList<>(expected); Collections.shuffle(shuffled); diff --git a/server/base/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java b/server/base/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java index 3a56a08292..97dd31f203 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java +++ b/server/base/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java @@ -40,7 +40,6 @@ import org.apache.accumulo.core.metadata.MetadataTable; import org.apache.accumulo.core.metadata.StoredTabletFile; import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.BulkFileColumnFamily; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ClonedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily; @@ -96,7 +95,6 @@ public class MetadataConstraints implements Constraint { CurrentLocationColumnFamily.NAME, LastLocationColumnFamily.NAME, FutureLocationColumnFamily.NAME, - ChoppedColumnFamily.NAME, ClonedColumnFamily.NAME, ExternalCompactionColumnFamily.NAME); // @formatter:on diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java b/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java index e4af38f93f..04dfcef9e4 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java @@ -182,16 +182,6 @@ public class LiveTServerSet implements Watcher { } } - public void chop(ServiceLock lock, KeyExtent extent) throws TException { - TabletManagementClientService.Client client = - ThriftUtil.getClient(ThriftClientTypes.TABLET_MGMT, address, context); - try { - client.chop(TraceUtil.traceInfo(), context.rpcCreds(), lockString(lock), extent.toThrift()); - } finally { - ThriftUtil.returnClient(client, context); - } - } - public void splitTablet(KeyExtent extent, Text splitPoint) throws TException, ThriftSecurityException, NotServingTabletException { TabletManagementClientService.Client client = diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MergeState.java b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MergeState.java index 7ed178cf7e..fc15a0b39c 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MergeState.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MergeState.java @@ -27,14 +27,6 @@ public enum MergeState { * created, stored in zookeeper, other merges are prevented on the table */ STARTED, - /** - * put all matching tablets online, split tablets if we are deleting - */ - SPLITTING, - /** - * after the tablet server chops the file, it marks the metadata table with a chopped marker - */ - WAITING_FOR_CHOPPED, /** * when the number of chopped tablets in the range matches the number of online tablets in the * range, take the tablets offline diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java index 3b09e8f161..86cd0f3f25 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/state/MetaDataTableScanner.java @@ -46,7 +46,6 @@ import org.apache.accumulo.core.metadata.SuspendingTServer; import org.apache.accumulo.core.metadata.TServerInstance; import org.apache.accumulo.core.metadata.TabletLocationState; import org.apache.accumulo.core.metadata.TabletLocationState.BadLocationStateException; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.FutureLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.LastLocationColumnFamily; @@ -89,7 +88,6 @@ public class MetaDataTableScanner implements ClosableIterator<TabletLocationStat scanner.fetchColumnFamily(LastLocationColumnFamily.NAME); scanner.fetchColumnFamily(SuspendLocationColumn.SUSPEND_COLUMN.getColumnFamily()); scanner.fetchColumnFamily(LogColumnFamily.NAME); - scanner.fetchColumnFamily(ChoppedColumnFamily.NAME); scanner.addScanIterator(new IteratorSetting(1000, "wholeRows", WholeRowIterator.class)); IteratorSetting tabletChange = new IteratorSetting(1001, "tabletChange", TabletStateChangeIterator.class); @@ -155,7 +153,6 @@ public class MetaDataTableScanner implements ClosableIterator<TabletLocationStat SuspendingTServer suspend = null; long lastTimestamp = 0; List<Collection<String>> walogs = new ArrayList<>(); - boolean chopped = false; for (Entry<Key,Value> entry : decodedRow.entrySet()) { @@ -186,8 +183,6 @@ public class MetaDataTableScanner implements ClosableIterator<TabletLocationStat last = Location.last(new TServerInstance(entry.getValue(), cq)); lastTimestamp = entry.getKey().getTimestamp(); } - } else if (cf.compareTo(ChoppedColumnFamily.NAME) == 0) { - chopped = true; } else if (TabletColumnFamily.PREV_ROW_COLUMN.equals(cf, cq)) { extent = KeyExtent.fromMetaPrevRow(entry); } else if (SuspendLocationColumn.SUSPEND_COLUMN.equals(cf, cq)) { @@ -199,7 +194,7 @@ public class MetaDataTableScanner implements ClosableIterator<TabletLocationStat log.error(msg); throw new BadLocationStateException(msg, k.getRow()); } - return new TabletLocationState(extent, future, current, last, suspend, walogs, chopped); + return new TabletLocationState(extent, future, current, last, suspend, walogs); } } diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java b/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java index a2b28e1d71..af83f61225 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/state/ZooTabletStateStore.java @@ -103,7 +103,7 @@ class ZooTabletStateStore implements TabletStateStore { }); return new TabletLocationState(RootTable.EXTENT, futureSession, currentSession, - lastSession, null, logs, false); + lastSession, null, logs); } catch (BadLocationStateException ex) { throw new IllegalStateException(ex); } diff --git a/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java b/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java index 90a6217bc1..e647d34321 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java +++ b/server/base/src/main/java/org/apache/accumulo/server/metadata/TabletMutatorBase.java @@ -33,7 +33,6 @@ import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.core.metadata.schema.ExternalCompactionId; import org.apache.accumulo.core.metadata.schema.ExternalCompactionMetadata; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.BulkFileColumnFamily; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ExternalCompactionColumnFamily; @@ -209,13 +208,6 @@ public abstract class TabletMutatorBase implements Ample.TabletMutator { return this; } - @Override - public Ample.TabletMutator putChopped() { - Preconditions.checkState(updatesEnabled, "Cannot make updates after calling mutate."); - ChoppedColumnFamily.CHOPPED_COLUMN.put(mutation, new Value("chopped")); - return this; - } - @Override public Ample.TabletMutator putSuspension(TServerInstance tServer, long suspensionTime) { Preconditions.checkState(updatesEnabled, "Cannot make updates after calling mutate."); diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java index 646e63d096..1ac0012a53 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java @@ -69,7 +69,6 @@ import org.apache.accumulo.core.metadata.schema.Ample.TabletMutator; import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.core.metadata.schema.ExternalCompactionId; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ClonedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily; @@ -217,7 +216,6 @@ public class MetadataTableUtil { TabletColumnFamily.OLD_PREV_ROW_COLUMN.put(m, TabletColumnFamily.encodePrevEndRow(oldPrevEndRow)); - ChoppedColumnFamily.CHOPPED_COLUMN.putDelete(m); ecids.forEach(ecid -> m.putDelete(ExternalCompactionColumnFamily.STR_NAME, ecid.canonical())); @@ -231,7 +229,6 @@ public class MetadataTableUtil { Mutation m = new Mutation(metadataEntry); TabletColumnFamily.SPLIT_RATIO_COLUMN.putDelete(m); TabletColumnFamily.OLD_PREV_ROW_COLUMN.putDelete(m); - ChoppedColumnFamily.CHOPPED_COLUMN.putDelete(m); for (Entry<StoredTabletFile,DataFileValue> entry : datafileSizes.entrySet()) { m.put(DataFileColumnFamily.NAME, entry.getKey().getMetadataText(), @@ -617,11 +614,4 @@ public class MetadataTableUtil { } } - public static void chopped(ServerContext context, KeyExtent extent, ServiceLock zooLock) { - TabletMutator tablet = context.getAmple().mutateTablet(extent); - tablet.putChopped(); - tablet.putZooLock(zooLock); - tablet.mutate(); - } - } diff --git a/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java b/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java index 721fcd6591..3e3241ed74 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/manager/state/RootTabletStateStoreTest.java @@ -120,8 +120,7 @@ public class RootTabletStateStoreTest { assertEquals(count, 1); TabletLocationState assigned = null; try { - assigned = - new TabletLocationState(root, Location.future(server), null, null, null, null, false); + assigned = new TabletLocationState(root, Location.future(server), null, null, null, null); } catch (BadLocationStateException e) { fail("Unexpected error " + e); } @@ -143,7 +142,7 @@ public class RootTabletStateStoreTest { try { TabletLocationState broken = - new TabletLocationState(notRoot, Location.future(server), null, null, null, null, false); + new TabletLocationState(notRoot, Location.future(server), null, null, null, null); final var assignmentList1 = List.of(broken); assertThrows(IllegalArgumentException.class, () -> tstore.unassign(assignmentList1, null)); } catch (BadLocationStateException e) { diff --git a/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java b/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java index c6e21bbe97..35df34b291 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/manager/state/TabletLocationStateTest.java @@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collection; import java.util.Set; @@ -67,24 +66,22 @@ public class TabletLocationStateTest { @Test public void testConstruction_NoFuture() throws Exception { - tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, current, last, null, walogs); assertSame(keyExtent, tls.extent); assertNull(tls.future); assertSame(current, tls.current); assertSame(last, tls.last); assertSame(walogs, tls.walogs); - assertTrue(tls.chopped); } @Test public void testConstruction_NoCurrent() throws Exception { - tls = new TabletLocationState(keyExtent, future, null, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, future, null, last, null, walogs); assertSame(keyExtent, tls.extent); assertSame(future, tls.future); assertNull(tls.current); assertSame(last, tls.last); assertSame(walogs, tls.walogs); - assertTrue(tls.chopped); } @Test @@ -92,50 +89,50 @@ public class TabletLocationStateTest { expect(keyExtent.toMetaRow()).andReturn(new Text("entry")); replay(keyExtent); var e = assertThrows(TabletLocationState.BadLocationStateException.class, - () -> new TabletLocationState(keyExtent, future, current, last, null, walogs, true)); + () -> new TabletLocationState(keyExtent, future, current, last, null, walogs)); assertEquals(new Text("entry"), e.getEncodedEndRow()); } @Test public void testConstruction_NoFuture_NoWalogs() throws Exception { - tls = new TabletLocationState(keyExtent, null, current, last, null, null, true); + tls = new TabletLocationState(keyExtent, null, current, last, null, null); assertNotNull(tls.walogs); assertEquals(0, tls.walogs.size()); } @Test public void testGetServer_Current() throws Exception { - tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, current, last, null, walogs); assertSame(current, tls.getLocation()); } @Test public void testGetServer_Future() throws Exception { - tls = new TabletLocationState(keyExtent, future, null, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, future, null, last, null, walogs); assertSame(future, tls.getLocation()); } @Test public void testGetServer_Last() throws Exception { - tls = new TabletLocationState(keyExtent, null, null, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, null, last, null, walogs); assertSame(last, tls.getLocation()); } @Test public void testGetServer_None() throws Exception { - tls = new TabletLocationState(keyExtent, null, null, null, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, null, null, null, walogs); assertNull(tls.getLocation()); } @Test public void testGetState_Unassigned1() throws Exception { - tls = new TabletLocationState(keyExtent, null, null, null, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, null, null, null, walogs); assertEquals(TabletState.UNASSIGNED, tls.getState(null)); } @Test public void testGetState_Unassigned2() throws Exception { - tls = new TabletLocationState(keyExtent, null, null, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, null, last, null, walogs); assertEquals(TabletState.UNASSIGNED, tls.getState(null)); } @@ -143,7 +140,7 @@ public class TabletLocationStateTest { public void testGetState_Assigned() throws Exception { Set<TServerInstance> liveServers = new java.util.HashSet<>(); liveServers.add(future.getServerInstance()); - tls = new TabletLocationState(keyExtent, future, null, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, future, null, last, null, walogs); assertEquals(TabletState.ASSIGNED, tls.getState(liveServers)); } @@ -151,7 +148,7 @@ public class TabletLocationStateTest { public void testGetState_Hosted() throws Exception { Set<TServerInstance> liveServers = new java.util.HashSet<>(); liveServers.add(current.getServerInstance()); - tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, current, last, null, walogs); assertEquals(TabletState.HOSTED, tls.getState(liveServers)); } @@ -159,7 +156,7 @@ public class TabletLocationStateTest { public void testGetState_Dead1() throws Exception { Set<TServerInstance> liveServers = new java.util.HashSet<>(); liveServers.add(current.getServerInstance()); - tls = new TabletLocationState(keyExtent, future, null, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, future, null, last, null, walogs); assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER, tls.getState(liveServers)); } @@ -167,7 +164,7 @@ public class TabletLocationStateTest { public void testGetState_Dead2() throws Exception { Set<TServerInstance> liveServers = new java.util.HashSet<>(); liveServers.add(future.getServerInstance()); - tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true); + tls = new TabletLocationState(keyExtent, null, current, last, null, walogs); assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER, tls.getState(liveServers)); } } diff --git a/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java b/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java index a9b72ae9bc..c030230d2b 100644 --- a/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java +++ b/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java @@ -102,8 +102,6 @@ public class ExtCEnv implements CompactionEnv { switch (job.getKind()) { case USER: return TCompactionReason.USER; - case CHOP: - return TCompactionReason.CHOP; case SELECTOR: case SYSTEM: return TCompactionReason.SYSTEM; diff --git a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java index 934686a59d..a8157f881f 100644 --- a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java +++ b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogsTest.java @@ -58,10 +58,10 @@ public class GarbageCollectWriteAheadLogsTest { { try { - tabletAssignedToServer1 = new TabletLocationState(extent, null, Location.current(server1), - null, null, walogs, false); - tabletAssignedToServer2 = new TabletLocationState(extent, null, Location.current(server2), - null, null, walogs, false); + tabletAssignedToServer1 = + new TabletLocationState(extent, null, Location.current(server1), null, null, walogs); + tabletAssignedToServer2 = + new TabletLocationState(extent, null, Location.current(server2), null, null, walogs); } catch (Exception ex) { throw new RuntimeException(ex); } diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java index d214a06c91..d59ca8d552 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java @@ -647,7 +647,6 @@ public class Manager extends AbstractServer case COMPLETE: break; case STARTED: - case SPLITTING: return TabletGoalState.HOSTED; case WAITING_FOR_OFFLINE: case MERGING: diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java b/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java index 9c8ea99172..7e58542de5 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java @@ -379,9 +379,6 @@ public class ManagerClientServiceHandler implements ManagerClientService.Iface { serverName, tablet); } break; - case CHOPPED: - manager.nextEvent.event("tablet %s chopped", tablet); - break; } } diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java index 3990015bb3..21ae3ae796 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java @@ -72,7 +72,6 @@ import org.apache.accumulo.core.metadata.schema.Ample; import org.apache.accumulo.core.metadata.schema.Ample.DataLevel; import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ExternalCompactionColumnFamily; @@ -261,7 +260,7 @@ abstract class TabletGroupWatcher extends AccumuloDaemonThread { tls.getFutureServer(), tls.getCurrentServer(), tls.walogs.size()); stats.update(tableId, state); - mergeStats.update(tls.extent, state, tls.chopped, !tls.walogs.isEmpty()); + mergeStats.update(tls.extent, state); // Always follow through with assignments if (state == TabletState.ASSIGNED) { @@ -780,7 +779,6 @@ abstract class TabletGroupWatcher extends AccumuloDaemonThread { Mutation m = new Mutation(followingTablet.toMetaRow()); TabletColumnFamily.PREV_ROW_COLUMN.put(m, TabletColumnFamily.encodePrevEndRow(extent.prevEndRow())); - ChoppedColumnFamily.CHOPPED_COLUMN.putDelete(m); bw.addMutation(m); bw.flush(); } finally { @@ -958,12 +956,6 @@ abstract class TabletGroupWatcher extends AccumuloDaemonThread { deleteTablets(info, scanRange, bw, client); - // Clean-up the last chopped marker - var m2 = new Mutation(stopRow); - ChoppedColumnFamily.CHOPPED_COLUMN.putDelete(m2); - bw.addMutation(m2); - bw.flush(); - } catch (Exception ex) { throw new AccumuloException(ex); } diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/state/MergeStats.java b/server/manager/src/main/java/org/apache/accumulo/manager/state/MergeStats.java index fa9bd968cd..27409a1a9f 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/state/MergeStats.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/state/MergeStats.java @@ -60,41 +60,20 @@ public class MergeStats { private final MergeInfo info; private int hosted = 0; private int unassigned = 0; - private int chopped = 0; - private int needsToBeChopped = 0; private int total = 0; - private boolean lowerSplit = false; - private boolean upperSplit = false; public MergeStats(MergeInfo info) { this.info = info; - if (info.getState().equals(MergeState.NONE)) { - return; - } - if (info.getExtent().endRow() == null) { - upperSplit = true; - } - if (info.getExtent().prevEndRow() == null) { - lowerSplit = true; - } } public MergeInfo getMergeInfo() { return info; } - public void update(KeyExtent ke, TabletState state, boolean chopped, boolean hasWALs) { + public void update(KeyExtent ke, TabletState state) { if (info.getState().equals(MergeState.NONE)) { return; } - if (!upperSplit && info.getExtent().endRow().equals(ke.prevEndRow())) { - log.info("Upper split found: {}", ke.prevEndRow()); - upperSplit = true; - } - if (!lowerSplit && info.getExtent().prevEndRow().equals(ke.endRow())) { - log.info("Lower split found: {}", ke.endRow()); - lowerSplit = true; - } if (!info.overlaps(ke)) { return; } @@ -120,9 +99,6 @@ public class MergeStats { log.info("Computing next merge state for {} which is presently {} isDelete : {}", info.getExtent(), state, info.isDelete()); if (state == MergeState.STARTED) { - state = MergeState.SPLITTING; - } - if (state == MergeState.SPLITTING) { log.info("{} are hosted, total {}", hosted, total); if (!info.isDelete() && total == 1) { log.info("Merge range is already contained in a single tablet {}", info.getExtent()); @@ -133,34 +109,16 @@ public class MergeStats { log.info("Waiting for {} hosted tablets to be {} {}", hosted, total, info.getExtent()); } } - if (state == MergeState.WAITING_FOR_CHOPPED) { - log.info("{} tablets are chopped {}", chopped, info.getExtent()); - if (chopped == needsToBeChopped) { - state = MergeState.WAITING_FOR_OFFLINE; - } else { - log.info("Waiting for {} chopped tablets to be {} {}", chopped, needsToBeChopped, - info.getExtent()); - } - } if (state == MergeState.WAITING_FOR_OFFLINE) { - if (chopped == needsToBeChopped) { - log.info("{} tablets are chopped, {} are offline {}", chopped, unassigned, - info.getExtent()); - if (unassigned == total) { - if (verifyMergeConsistency(accumuloClient, manager)) { - state = MergeState.MERGING; - } else { - log.info("Merge consistency check failed {}", info.getExtent()); - } + if (unassigned == total) { + if (verifyMergeConsistency(accumuloClient, manager)) { + state = MergeState.MERGING; } else { - log.info("Waiting for {} unassigned tablets to be {} {}", unassigned, total, - info.getExtent()); + log.info("Merge consistency check failed {}", info.getExtent()); } } else { - log.warn("Unexpected state: chopped tablets should be {} was {} merge {}", needsToBeChopped, - chopped, info.getExtent()); - // Perhaps a split occurred after we chopped, but before we went offline: start over - state = MergeState.WAITING_FOR_CHOPPED; + log.info("Waiting for {} unassigned tablets to be {} {}", unassigned, total, + info.getExtent()); } } if (state == MergeState.MERGING) { @@ -174,7 +132,7 @@ public class MergeStats { // Shouldn't happen log.error("Unexpected state: unassigned tablets should be {} was {} merge {}", total, unassigned, info.getExtent()); - state = MergeState.WAITING_FOR_CHOPPED; + state = MergeState.WAITING_FOR_OFFLINE; } log.info("{} tablets are unassigned {}", unassigned, info.getExtent()); } @@ -233,19 +191,17 @@ public class MergeStats { prevExtent = tls.extent; - verify.update(tls.extent, tls.getState(manager.onlineTabletServers()), tls.chopped, - !tls.walogs.isEmpty()); + verify.update(tls.extent, tls.getState(manager.onlineTabletServers())); // stop when we've seen the tablet just beyond our range if (tls.extent.prevEndRow() != null && extent.endRow() != null && tls.extent.prevEndRow().compareTo(extent.endRow()) > 0) { break; } } - log.debug("chopped {} v.chopped {} unassigned {} v.unassigned {} verify.total {}", chopped, - verify.chopped, unassigned, verify.unassigned, verify.total); + log.debug("unassigned {} v.unassigned {} verify.total {}", unassigned, verify.unassigned, + verify.total); - return chopped == verify.chopped && unassigned == verify.unassigned - && unassigned == verify.total; + return unassigned == verify.unassigned && unassigned == verify.total; } public static void main(String[] args) throws Exception { diff --git a/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java b/server/manager/src/main/java/org/apache/accumulo/manager/upgrade/UpgraderConstants.java similarity index 60% copy from core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java copy to server/manager/src/main/java/org/apache/accumulo/manager/upgrade/UpgraderConstants.java index a47909612e..b9bc2d3807 100644 --- a/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/upgrade/UpgraderConstants.java @@ -16,29 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.accumulo.core.spi.compaction; +package org.apache.accumulo.manager.upgrade; -import org.apache.accumulo.core.client.admin.compaction.CompactionSelector; +import org.apache.accumulo.core.util.ColumnFQ; +import org.apache.hadoop.io.Text; + +public class UpgraderConstants { -/** - * @since 2.1.0 - * @see org.apache.accumulo.core.spi.compaction - */ -public enum CompactionKind { - /** - * A system initiated routine compaction. - */ - SYSTEM, - /** - * Set of files selected by a {@link CompactionSelector} configured for a table. - */ - SELECTOR, - /** - * A user initiated a one time compaction using an Accumulo client. - */ - USER, /** - * A compaction executed prior to merging tablets. + * ChoppedColumnFamily kept around for cleaning up old entries on upgrade. Currently not used, will be used by #3768 */ - CHOP + public static class ChoppedColumnFamily { + public static final String STR_NAME = "chopped"; + public static final Text NAME = new Text(STR_NAME); + public static final ColumnFQ CHOPPED_COLUMN = new ColumnFQ(NAME, new Text(STR_NAME)); + } + } diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java index e8ec0d5607..26e605fa95 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java @@ -1162,23 +1162,6 @@ public class TabletClientHandler implements TabletServerClientService.Iface, return server.statsKeeper.getTabletStats(); } - @Override - public void chop(TInfo tinfo, TCredentials credentials, String lock, TKeyExtent textent) { - try { - checkPermission(security, context, server, credentials, lock, "chop"); - } catch (ThriftSecurityException e) { - log.error("Caller doesn't have permission to chop extent", e); - throw new RuntimeException(e); - } - - KeyExtent ke = KeyExtent.fromThrift(textent); - - Tablet tablet = server.getOnlineTablet(ke); - if (tablet != null) { - tablet.chopFiles(); - } - } - @Override public void compact(TInfo tinfo, TCredentials credentials, String lock, String tableId, ByteBuffer startRow, ByteBuffer endRow) { diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java index 9f5a4e2afb..206f29b383 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/UnloadTabletHandler.java @@ -111,8 +111,7 @@ class UnloadTabletHandler implements Runnable { TServerInstance instance = server.getTabletSession(); TabletLocationState tls = null; try { - tls = new TabletLocationState(extent, null, Location.current(instance), null, null, null, - false); + tls = new TabletLocationState(extent, null, Location.current(instance), null, null, null); } catch (BadLocationStateException e) { log.error("Unexpected error", e); } diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java index fb510c1eff..706f55d1c5 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java @@ -20,8 +20,6 @@ package org.apache.accumulo.tserver.tablet; import static org.apache.accumulo.tserver.TabletStatsKeeper.Operation.MAJOR; -import java.io.IOException; -import java.io.UncheckedIOException; import java.time.Duration; import java.util.ArrayList; import java.util.Collection; @@ -51,7 +49,6 @@ import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.logging.TabletLogger; -import org.apache.accumulo.core.manager.thrift.TabletLoadState; import org.apache.accumulo.core.metadata.CompactableFileImpl; import org.apache.accumulo.core.metadata.ReferencedTabletFile; import org.apache.accumulo.core.metadata.StoredTabletFile; @@ -72,11 +69,9 @@ import org.apache.accumulo.core.util.ratelimit.RateLimiter; import org.apache.accumulo.server.ServiceEnvironmentImpl; import org.apache.accumulo.server.compaction.CompactionStats; import org.apache.accumulo.server.compaction.FileCompactor.CompactionCanceledException; -import org.apache.accumulo.server.util.MetadataTableUtil; import org.apache.accumulo.tserver.compactions.Compactable; import org.apache.accumulo.tserver.compactions.CompactionManager; import org.apache.accumulo.tserver.compactions.ExternalCompactionJob; -import org.apache.accumulo.tserver.managermessage.TabletStatusMessage; import org.apache.zookeeper.KeeperException.NoNodeException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -112,10 +107,6 @@ public class CompactableImpl implements Compactable { private Set<CompactionServiceId> servicesUsed = new ConcurrentSkipListSet<>(); - enum ChopSelectionStatus { - SELECTING, SELECTED, NOT_ACTIVE, MARKING - } - // status of special compactions enum FileSelectionStatus { NEW, SELECTING, SELECTED, RESERVED, NOT_ACTIVE, CANCELED @@ -166,7 +157,6 @@ public class CompactableImpl implements Compactable { * <ul> * <li>Tracks which files are reserved for compactions * <li>Determines which files are available for compactions - * <li>Tracks which files are chopped and which need to be chopped * <li>Tracks which files are selected for user and selector compactions * <li>Coordinates the file selection process * </ul> @@ -192,17 +182,12 @@ public class CompactableImpl implements Compactable { // important to track this in order to know if the last compaction is a full compaction and // should not propagate deletes. private boolean initiallySelectedAll = false; - private Set<StoredTabletFile> selectedFiles = new HashSet<>(); + private final Set<StoredTabletFile> selectedFiles = new HashSet<>(); protected Set<StoredTabletFile> allCompactingFiles = new HashSet<>(); - // track files produced by compactions of this tablet, those are considered chopped - private Set<StoredTabletFile> choppedFiles = new HashSet<>(); - private ChopSelectionStatus chopStatus = ChopSelectionStatus.NOT_ACTIVE; - private Set<StoredTabletFile> allFilesWhenChopStarted = new HashSet<>(); - private final KeyExtent extent; - private Deriver<Duration> selectionExpirationDeriver; + private final Deriver<Duration> selectionExpirationDeriver; public FileManager(KeyExtent extent, Collection<StoredTabletFile> extCompactingFiles, Optional<SelectedInfo> extSelInfo, Deriver<Duration> selectionExpirationDeriver) { @@ -291,71 +276,6 @@ public class CompactableImpl implements Compactable { || selectStatus == FileSelectionStatus.RESERVED) && kind == selectKind; } - ChopSelectionStatus getChopStatus() { - return chopStatus; - } - - ChopSelector initiateChop(Set<StoredTabletFile> allFiles) { - Preconditions.checkState(chopStatus == ChopSelectionStatus.NOT_ACTIVE); - Set<StoredTabletFile> filesToExamine = new HashSet<>(allFiles); - chopStatus = ChopSelectionStatus.SELECTING; - filesToExamine.removeAll(choppedFiles); - filesToExamine.removeAll(allCompactingFiles); - return new ChopSelector(allFiles, filesToExamine); - } - - class ChopSelector { - private Set<StoredTabletFile> allFiles; - private Set<StoredTabletFile> filesToExamine; - - private ChopSelector(Set<StoredTabletFile> allFiles, Set<StoredTabletFile> filesToExamine) { - this.allFiles = allFiles; - this.filesToExamine = filesToExamine; - } - - void selectChopFiles(Set<StoredTabletFile> unchoppedFiles) { - Preconditions.checkState(chopStatus == ChopSelectionStatus.SELECTING); - choppedFiles.addAll(Sets.difference(filesToExamine, unchoppedFiles)); - chopStatus = ChopSelectionStatus.SELECTED; - allFilesWhenChopStarted.clear(); - allFilesWhenChopStarted.addAll(allFiles); - - var filesToChop = getFilesToChop(allFiles); - if (!filesToChop.isEmpty()) { - TabletLogger.selected(getExtent(), CompactionKind.CHOP, filesToChop); - } - } - - Set<StoredTabletFile> getFilesToExamine() { - return Collections.unmodifiableSet(filesToExamine); - } - } - - boolean finishChop(Set<StoredTabletFile> allFiles) { - - boolean completed = false; - - if (chopStatus == ChopSelectionStatus.SELECTED) { - if (getFilesToChop(allFiles).isEmpty()) { - chopStatus = ChopSelectionStatus.MARKING; - completed = true; - } - } - - choppedFiles.retainAll(allFiles); - - return completed; - } - - void finishMarkingChop() { - Preconditions.checkState(chopStatus == ChopSelectionStatus.MARKING); - chopStatus = ChopSelectionStatus.NOT_ACTIVE; - } - - void addChoppedFiles(Collection<StoredTabletFile> files) { - choppedFiles.addAll(files); - } - void userCompactionCanceled() { if (isSelected(CompactionKind.USER)) { if (noneRunning(CompactionKind.USER)) { @@ -368,14 +288,6 @@ public class CompactableImpl implements Compactable { } } - private Set<StoredTabletFile> getFilesToChop(Set<StoredTabletFile> allFiles) { - Preconditions.checkState(chopStatus == ChopSelectionStatus.SELECTED); - var copy = new HashSet<>(allFilesWhenChopStarted); - copy.retainAll(allFiles); - copy.removeAll(choppedFiles); - return copy; - } - /** * @return The set of tablet files that are candidates for compaction */ @@ -397,34 +309,8 @@ public class CompactableImpl implements Compactable { // intentional fall through case USER: return handleUserSelectorCompaction(currFiles, kind); - case CHOP: { - return handleChopCompaction(currFiles); - } - default: - throw new AssertionError(); - } - } - - private Set<StoredTabletFile> handleChopCompaction(Set<StoredTabletFile> currFiles) { - switch (chopStatus) { - case NOT_ACTIVE: - case SELECTING: - case MARKING: + case CHOP: return Set.of(); - case SELECTED: { - if (selectStatus == FileSelectionStatus.NEW - || selectStatus == FileSelectionStatus.SELECTING) { - return Set.of(); - } - - var filesToChop = getFilesToChop(currFiles); - filesToChop.removeAll(allCompactingFiles); - if (selectStatus == FileSelectionStatus.SELECTED - || selectStatus == FileSelectionStatus.RESERVED) { - filesToChop.removeAll(selectedFiles); - } - return Collections.unmodifiableSet(filesToChop); - } default: throw new AssertionError(); } @@ -576,9 +462,6 @@ public class CompactableImpl implements Compactable { Optional<StoredTabletFile> newFile, boolean successful) { Preconditions.checkArgument(!jobFiles.isEmpty()); Preconditions.checkState(allCompactingFiles.removeAll(jobFiles)); - if (newFile.isPresent()) { - choppedFiles.add(newFile.orElseThrow()); - } if (successful && (job.getKind() == CompactionKind.USER || job.getKind() == CompactionKind.SELECTOR)) { @@ -686,11 +569,6 @@ public class CompactableImpl implements Compactable { } }); - if (extCompactions.values().stream().map(ecMeta -> ecMeta.getKind()) - .anyMatch(kind -> kind == CompactionKind.CHOP)) { - initiateChop(); - } - this.servicesInUse = Suppliers.memoizeWithExpiration(() -> { HashSet<CompactionServiceId> servicesIds = new HashSet<>(); for (CompactionKind kind : CompactionKind.values()) { @@ -735,82 +613,10 @@ public class CompactableImpl implements Compactable { return runningJobs.stream().noneMatch(job -> job.getKind() == kind); } - void initiateChop() { - - Set<StoredTabletFile> allFiles = tablet.getDatafiles().keySet(); - FileManager.ChopSelector chopSelector; - - synchronized (this) { - if (fileMgr.getChopStatus() == ChopSelectionStatus.NOT_ACTIVE) { - chopSelector = fileMgr.initiateChop(allFiles); - } else { - return; - } - } - - Set<StoredTabletFile> unchoppedFiles = selectChopFiles(chopSelector.getFilesToExamine()); - - synchronized (this) { - chopSelector.selectChopFiles(unchoppedFiles); - } - - checkifChopComplete(tablet.getDatafiles().keySet()); - } - - private void checkifChopComplete(Set<StoredTabletFile> allFiles) { - - boolean completed; - - synchronized (this) { - if (closed) { - // if closed, do not attempt to transition to the MARKING state - return; - } - // when this returns true it means we transitioned to the MARKING state - completed = fileMgr.finishChop(allFiles); - } - - if (completed) { - try { - markChopped(); - } finally { - synchronized (this) { - // transition the state from MARKING to NOT_ACTIVE - fileMgr.finishMarkingChop(); - this.notifyAll(); - } - } - - TabletLogger.selected(getExtent(), CompactionKind.CHOP, Set.of()); - } - } - - private void markChopped() { - MetadataTableUtil.chopped(tablet.getTabletServer().getContext(), getExtent(), - tablet.getTabletServer().getLock()); - tablet.getTabletServer() - .enqueueManagerMessage(new TabletStatusMessage(TabletLoadState.CHOPPED, getExtent())); - } - - private Set<StoredTabletFile> selectChopFiles(Set<StoredTabletFile> chopCandidates) { - try { - var firstAndLastKeys = CompactableUtils.getFirstAndLastKeys(tablet, chopCandidates); - return CompactableUtils.findChopFiles(getExtent(), firstAndLastKeys, chopCandidates); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - /** * Tablet can use this to signal files were added. */ - void filesAdded(boolean chopped, Collection<StoredTabletFile> files) { - if (chopped) { - synchronized (this) { - fileMgr.addChoppedFiles(files); - } - } - + void filesAdded() { manager.compactableChanged(this); } @@ -1255,7 +1061,6 @@ public class CompactableImpl implements Compactable { } } - checkifChopComplete(tablet.getDatafiles().keySet()); selectFiles(); } @@ -1545,12 +1350,11 @@ public class CompactableImpl implements Compactable { closed = true; // Wait while internal jobs are running or external compactions are committing. When - // chopStatus is MARKING or selectStatus is SELECTING, there may be metadata table writes so + // selectStatus is SELECTING, there may be metadata table writes so // wait on those. Do not wait on external compactions that are running. while (runningJobs.stream() .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId()) || !externalCompactionsCommitting.isEmpty() - || fileMgr.chopStatus == ChopSelectionStatus.MARKING || fileMgr.selectStatus == FileSelectionStatus.SELECTING) { try { wait(50); diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java index 13263f3bda..5a27fb28eb 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableUtils.java @@ -23,7 +23,6 @@ import java.io.UncheckedIOException; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -52,7 +51,6 @@ import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.data.TabletId; import org.apache.accumulo.core.data.Value; -import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.dataImpl.TabletIdImpl; import org.apache.accumulo.core.file.FileOperations; import org.apache.accumulo.core.file.FileSKVIterator; @@ -108,25 +106,6 @@ public class CompactableUtils { return result; } - public static Set<StoredTabletFile> findChopFiles(KeyExtent extent, - Map<StoredTabletFile,Pair<Key,Key>> firstAndLastKeys, Collection<StoredTabletFile> allFiles) { - Set<StoredTabletFile> result = new HashSet<>(); - - for (StoredTabletFile file : allFiles) { - Pair<Key,Key> pair = firstAndLastKeys.get(file); - Key first = pair.getFirst(); - Key last = pair.getSecond(); - // If first and last are null, it's an empty file. Add it to the compact set so it goes - // away. - if ((first == null && last == null) || (first != null && !extent.contains(first.getRow())) - || (last != null && !extent.contains(last.getRow()))) { - result.add(file); - } - - } - return result; - } - static Map<String,String> computeOverrides(Tablet tablet, Set<CompactableFile> files) { var tconf = tablet.getTableConfiguration(); diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MajCEnv.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MajCEnv.java index 0ea93196f2..8e2971da69 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MajCEnv.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MajCEnv.java @@ -85,8 +85,6 @@ public class MajCEnv implements FileCompactor.CompactionEnv { switch (kind) { case USER: return TCompactionReason.USER; - case CHOP: - return TCompactionReason.CHOP; case SELECTOR: case SYSTEM: return TCompactionReason.SYSTEM; diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java index 4e68a2e0f4..f3337a4e25 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java @@ -483,7 +483,7 @@ public class Tablet extends TabletBase { var storedFile = getDatafileManager().bringMinorCompactionOnline(tmpDatafile, newDatafile, new DataFileValue(stats.getFileSize(), stats.getEntriesWritten()), commitSession, flushId); - storedFile.ifPresent(stf -> compactable.filesAdded(true, List.of(stf))); + storedFile.ifPresent(stf -> compactable.filesAdded()); } catch (Exception e) { TraceUtil.setException(span2, e, true); throw e; @@ -1771,13 +1771,13 @@ public class Tablet extends TabletBase { try { tabletServer.updateBulkImportState(files, BulkImportState.LOADING); - var storedTabletFile = getDatafileManager().importDataFiles(tid, entries, setTime); + getDatafileManager().importDataFiles(tid, entries, setTime); lastDataFileImportTime = System.currentTimeMillis(); if (isSplitPossible()) { getTabletServer().executeSplit(this); } else { - compactable.filesAdded(false, storedTabletFile); + compactable.filesAdded(); } } finally { synchronized (this) { @@ -2006,10 +2006,6 @@ public class Tablet extends TabletBase { logLock.unlock(); } - public void chopFiles() { - compactable.initiateChop(); - } - public void compactAll(long compactionId, CompactionConfig compactionConfig) { synchronized (this) { diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/CompactableImplFileManagerTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/CompactableImplFileManagerTest.java index b834f6bd73..9f6f115335 100644 --- a/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/CompactableImplFileManagerTest.java +++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/CompactableImplFileManagerTest.java @@ -18,14 +18,12 @@ */ package org.apache.accumulo.tserver.tablet; -import static org.apache.accumulo.core.spi.compaction.CompactionKind.CHOP; import static org.apache.accumulo.core.spi.compaction.CompactionKind.SELECTOR; import static org.apache.accumulo.core.spi.compaction.CompactionKind.SYSTEM; import static org.apache.accumulo.core.spi.compaction.CompactionKind.USER; import static org.apache.accumulo.tserver.tablet.CompactableImplFileManagerTest.TestFileManager.SELECTION_EXPIRATION; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.Duration; @@ -44,8 +42,6 @@ import org.apache.accumulo.core.metadata.schema.DataFileValue; import org.apache.accumulo.core.spi.compaction.CompactionExecutorId; import org.apache.accumulo.core.spi.compaction.CompactionJob; import org.apache.accumulo.core.spi.compaction.CompactionKind; -import org.apache.accumulo.tserver.tablet.CompactableImpl.ChopSelectionStatus; -import org.apache.accumulo.tserver.tablet.CompactableImpl.FileManager.ChopSelector; import org.apache.accumulo.tserver.tablet.CompactableImpl.FileSelectionStatus; import org.junit.jupiter.api.Test; @@ -61,7 +57,7 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("F00000.rf", "F00001.rf", "F00002.rf", "F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, USER, SELECTOR); var job1 = newJob(CompactionKind.SYSTEM, "F00000.rf", "F00001.rf"); @@ -69,7 +65,7 @@ public class CompactableImplFileManagerTest { assertEquals(job1.getSTFiles(), fileMgr.getCompactingFiles()); assertEquals(newFiles("F00002.rf", "F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, USER, SELECTOR); var job2 = newJob(CompactionKind.SYSTEM, "F00002.rf", "F00003.rf"); @@ -80,7 +76,7 @@ public class CompactableImplFileManagerTest { assertFalse(fileMgr.reserveFiles(newJob(CompactionKind.SYSTEM, "F00001.rf", "F00002.rf"))); assertEquals(Set.of(), fileMgr.getCandidates(tabletFiles, CompactionKind.SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, SYSTEM, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SYSTEM, USER, SELECTOR); fileMgr.completed(job2, newFile("C00004.rf")); fileMgr.completed(job1, newFile("C00005.rf")); @@ -89,12 +85,12 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("C00004.rf", "C00005.rf"), fileMgr.getCandidates(tabletFiles, CompactionKind.SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, USER, SELECTOR); var job3 = newJob(CompactionKind.SYSTEM, "C00004.rf", "C00005.rf"); assertTrue(fileMgr.reserveFiles(job3)); - assertNoCandidates(fileMgr, tabletFiles, SYSTEM, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SYSTEM, USER, SELECTOR); fileMgr.completed(job3, newFile("A00006.rf")); assertEquals(Set.of(), fileMgr.getCompactingFiles()); @@ -115,19 +111,19 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("F00000.rf", "F00001.rf", "F00002.rf", "F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, USER, SELECTOR); assertTrue(fileMgr.initiateSelection(USER)); assertFalse(fileMgr.reserveFiles(staleJob)); - assertNoCandidates(fileMgr, tabletFiles, SYSTEM, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SYSTEM, USER, SELECTOR); assertTrue(fileMgr.beginSelection()); assertFalse(fileMgr.reserveFiles(staleJob)); - assertNoCandidates(fileMgr, tabletFiles, SYSTEM, CHOP, USER, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SYSTEM, USER, SELECTOR); fileMgr.finishSelection(newFiles("F00000.rf", "F00001.rf", "F00002.rf"), false); @@ -136,7 +132,7 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); assertEquals(newFiles("F00000.rf", "F00001.rf", "F00002.rf"), fileMgr.getCandidates(tabletFiles, USER)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SELECTOR); assertFalse(fileMgr.reserveFiles(newJob(SELECTOR, "F00000.rf", "F00001.rf"))); assertFalse(fileMgr.reserveFiles(newJob(SYSTEM, "F00000.rf", "F00001.rf"))); @@ -156,7 +152,7 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); assertEquals(newFiles("F00002.rf"), fileMgr.getCandidates(tabletFiles, USER)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SELECTOR); fileMgr.completed(job1, newFile("C00004.rf")); assertEquals(FileSelectionStatus.RESERVED, fileMgr.getSelectionStatus()); @@ -165,7 +161,7 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); assertEquals(newFiles("F00002.rf", "C00004.rf"), fileMgr.getCandidates(tabletFiles, USER)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SELECTOR); var job2 = newJob(USER, "F00002.rf", "C00004.rf"); @@ -180,7 +176,7 @@ public class CompactableImplFileManagerTest { tabletFiles = newFiles("C00005.rf", "F00003.rf"); assertEquals(newFiles("C00005.rf", "F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, USER, CHOP, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, USER, SELECTOR); } @Test @@ -198,7 +194,7 @@ public class CompactableImplFileManagerTest { assertEquals(newFiles("F00000.rf", "F00001.rf", "F00002.rf", "F00003.rf"), fileMgr.getCandidates(tabletFiles, USER)); - assertNoCandidates(fileMgr, tabletFiles, SYSTEM, CHOP, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SYSTEM, SELECTOR); // advance time to a point where the selection is eligible to expire fileMgr.setNanoTime(2 * SELECTION_EXPIRATION.toNanos()); @@ -209,7 +205,7 @@ public class CompactableImplFileManagerTest { fileMgr.getCandidates(tabletFiles, USER)); assertEquals(newFiles("F00000.rf", "F00001.rf", "F00002.rf", "F00003.rf"), fileMgr.getCandidates(tabletFiles, SYSTEM)); - assertNoCandidates(fileMgr, tabletFiles, CHOP, SELECTOR); + assertNoCandidates(fileMgr, tabletFiles, SELECTOR); // a system compaction should be able to reserve selected files after expiration which should // deactivate the selection @@ -341,60 +337,6 @@ public class CompactableImplFileManagerTest { } - @Test - public void testChop() { - TestFileManager fileMgr = new TestFileManager(); - - // simulate a compaction because files that were created by compaction are remembered as not - // needing a chop - var job1 = newJob(SYSTEM, "F00000.rf", "F00001.rf"); - assertTrue(fileMgr.reserveFiles(job1)); - fileMgr.completed(job1, newFile("C00005.rf")); - - var tabletFiles = newFiles("C00005.rf", "F00002.rf", "F00003.rf", "F00004.rf"); - - ChopSelector chopSel = fileMgr.initiateChop(tabletFiles); - assertEquals(ChopSelectionStatus.SELECTING, fileMgr.getChopStatus()); - - assertEquals(Set.of(), fileMgr.getCandidates(tabletFiles, CHOP)); - - // this should not include C00005.rf because it was created by a compaction observed by the file - // manager - assertEquals(newFiles("F00002.rf", "F00003.rf", "F00004.rf"), chopSel.getFilesToExamine()); - - chopSel.selectChopFiles(newFiles("F00002.rf", "F00004.rf")); - assertEquals(ChopSelectionStatus.SELECTED, fileMgr.getChopStatus()); - - assertEquals(newFiles("F00002.rf", "F00004.rf"), fileMgr.getCandidates(tabletFiles, CHOP)); - - // simulate compacting one of the files that needs to be chopped, but this should not finish the - // chop because more files need to be chopped - var job2 = newJob(CHOP, "F00002.rf"); - assertTrue(fileMgr.reserveFiles(job2)); - fileMgr.completed(job2, newFile("C00006.rf")); - tabletFiles = newFiles("C00004.rf", "C00006.rf", "F00003.rf", "F00004.rf"); - assertFalse(fileMgr.finishChop(tabletFiles)); - assertEquals(ChopSelectionStatus.SELECTED, fileMgr.getChopStatus()); - assertThrows(IllegalStateException.class, fileMgr::finishMarkingChop); - - assertEquals(newFiles("F00004.rf"), fileMgr.getCandidates(tabletFiles, CHOP)); - - // simulate compacting the last file to chop. should cause the chop finish - var job3 = newJob(CHOP, "F00004.rf"); - assertTrue(fileMgr.reserveFiles(job3)); - fileMgr.completed(job3, newFile("C00007.rf")); - tabletFiles = newFiles("C00004.rf", "C00006.rf", "F00003.rf", "C00007.rf"); - assertTrue(fileMgr.finishChop(tabletFiles)); - - assertEquals(Set.of(), fileMgr.getCandidates(tabletFiles, CHOP)); - assertEquals(ChopSelectionStatus.MARKING, fileMgr.getChopStatus()); - assertEquals(Set.of(), fileMgr.getCompactingFiles()); - - fileMgr.finishMarkingChop(); - assertEquals(ChopSelectionStatus.NOT_ACTIVE, fileMgr.getChopStatus()); - - } - private void assertNoCandidates(TestFileManager fileMgr, Set<StoredTabletFile> tabletFiles, CompactionKind... kinds) { for (CompactionKind kind : kinds) { diff --git a/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java b/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java index 9867454ac9..003b387f1b 100644 --- a/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java +++ b/test/src/main/java/org/apache/accumulo/test/manager/MergeStateIT.java @@ -40,7 +40,6 @@ import org.apache.accumulo.core.metadata.MetadataTable; import org.apache.accumulo.core.metadata.TServerInstance; import org.apache.accumulo.core.metadata.TabletLocationState; import org.apache.accumulo.core.metadata.schema.Ample.DataLevel; -import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.ChoppedColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.CurrentLocationColumnFamily; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily; import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location; @@ -128,7 +127,6 @@ public class MergeStateIT extends ConfigurableMacBase { TabletColumnFamily.createPrevRowMutation(new KeyExtent(tableId, split, pr)); prevRow.put(CurrentLocationColumnFamily.NAME, new Text("123456"), new Value("127.0.0.1:1234")); - ChoppedColumnFamily.CHOPPED_COLUMN.put(prevRow, new Value("junk")); bw.addMutation(prevRow); pr = split; } @@ -197,7 +195,7 @@ public class MergeStateIT extends ConfigurableMacBase { m = TabletColumnFamily.createPrevRowMutation(tablet); Collection<Collection<String>> walogs = Collections.emptyList(); metaDataStateStore.unassign(Collections.singletonList(new TabletLocationState(tablet, null, - Location.current(state.someTServer), null, null, walogs, false)), null); + Location.current(state.someTServer), null, null, walogs)), null); // now we can split stats = scan(state, metaDataStateStore); @@ -209,7 +207,7 @@ public class MergeStateIT extends ConfigurableMacBase { MergeStats stats = new MergeStats(state.mergeInfo); stats.getMergeInfo().setState(MergeState.WAITING_FOR_OFFLINE); for (TabletLocationState tss : metaDataStateStore) { - stats.update(tss.extent, tss.getState(state.onlineTabletServers()), tss.chopped, false); + stats.update(tss.extent, tss.getState(state.onlineTabletServers())); } return stats; } diff --git a/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java b/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java index 463ae94425..bd5897c1ac 100644 --- a/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java +++ b/test/src/main/java/org/apache/accumulo/test/performance/NullTserver.java @@ -198,9 +198,6 @@ public class NullTserver { return new ArrayList<>(); } - @Override - public void chop(TInfo tinfo, TCredentials credentials, String lock, TKeyExtent extent) {} - @Override public void flushTablet(TInfo tinfo, TCredentials credentials, String lock, TKeyExtent extent) {