This is an automated email from the ASF dual-hosted git repository. dlmarion pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new dd98f5f315 Mark TSERV_LAST_LOCATION_MODE as deprecated (#3973) dd98f5f315 is described below commit dd98f5f315f07b9590045c382895353819968d78 Author: Dave Marion <dlmar...@apache.org> AuthorDate: Mon Nov 27 07:42:13 2023 -0500 Mark TSERV_LAST_LOCATION_MODE as deprecated (#3973) Fixes #3971 --- .../java/org/apache/accumulo/core/conf/Property.java | 18 +++++++++++++----- .../accumulo/server/util/ManagerMetadataUtil.java | 9 +++++++-- .../accumulo/server/util/ManagerMetadataUtilTest.java | 4 +++- .../accumulo/test/functional/AssignLocationModeIT.java | 8 ++++++-- .../test/functional/CompactLocationModeIT.java | 8 ++++++-- 5 files changed, 35 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index 3ab9924d8f..d9c633472b 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -597,7 +597,9 @@ public enum Property { TSERV_COMPACTION_SERVICE_ROOT_RATE_LIMIT("tserver.compaction.major.service.root.rate.limit", "0B", PropertyType.BYTES, "Maximum number of bytes to read or write per second over all major" - + " compactions in this compaction service, or 0B for unlimited.", + + " compactions in this compaction service, or 0B for unlimited. This property has" + + " been deprecated in anticipation of it being removed in a future release that" + + " removes the rate limiting feature.", "2.1.0"), @Deprecated(since = "3.1", forRemoval = true) TSERV_COMPACTION_SERVICE_ROOT_MAX_OPEN( @@ -619,7 +621,9 @@ public enum Property { TSERV_COMPACTION_SERVICE_META_RATE_LIMIT("tserver.compaction.major.service.meta.rate.limit", "0B", PropertyType.BYTES, "Maximum number of bytes to read or write per second over all major" - + " compactions in this compaction service, or 0B for unlimited.", + + " compactions in this compaction service, or 0B for unlimited. This property has" + + " been deprecated in anticipation of it being removed in a future release that" + + " removes the rate limiting feature.", "2.1.0"), @Deprecated(since = "3.1", forRemoval = true) TSERV_COMPACTION_SERVICE_META_MAX_OPEN( @@ -641,7 +645,9 @@ public enum Property { TSERV_COMPACTION_SERVICE_DEFAULT_RATE_LIMIT("tserver.compaction.major.service.default.rate.limit", "0B", PropertyType.BYTES, "Maximum number of bytes to read or write per second over all major" - + " compactions in this compaction service, or 0B for unlimited.", + + " compactions in this compaction service, or 0B for unlimited. This property has" + + " been deprecated in anticipation of it being removed in a future release that" + + " removes the rate limiting feature.", "2.1.0"), @Deprecated(since = "3.1", forRemoval = true) TSERV_COMPACTION_SERVICE_DEFAULT_MAX_OPEN( @@ -756,6 +762,7 @@ public enum Property { "The number of threads on each tablet server available to retrieve" + " summary data, that is not currently in cache, from RFiles.", "2.0.0"), + @Deprecated(since = "3.1", forRemoval = true) TSERV_LAST_LOCATION_MODE("tserver.last.location.mode", "compaction", PropertyType.LAST_LOCATION_MODE, "Describes how the system will record the 'last' location for tablets, which can be used for" @@ -764,9 +771,10 @@ public enum Property { + " 'assignment' is the mode, then the most recently assigned location will be recorded." + " The manager.startup.tserver properties might also need to be set to ensure the" + " tserver is available before tablets are initially assigned if the 'last' location is" - + " to be used.", + + " to be used. This property has been deprecated in anticipation of it being removed in" + + " a future release that removes major compactions from the TabletServer, rendering this" + + " feature moot.", "2.1.1"), - // accumulo garbage collector properties GC_PREFIX("gc.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of the accumulo garbage collector.", diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java index 01a12e3736..487055a567 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/ManagerMetadataUtil.java @@ -65,6 +65,9 @@ import com.google.common.base.Preconditions; public class ManagerMetadataUtil { private static final Logger log = LoggerFactory.getLogger(ManagerMetadataUtil.class); + @SuppressWarnings("removal") + private static final Property DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY = + Property.TSERV_LAST_LOCATION_MODE; public static void addNewTablet(ServerContext context, KeyExtent extent, String dirName, TServerInstance tServerInstance, Map<StoredTabletFile,DataFileValue> datafileSizes, @@ -257,7 +260,8 @@ public class ManagerMetadataUtil { // if the location mode is assignment, then preserve the current location in the last // location value - if ("assignment".equals(context.getConfiguration().get(Property.TSERV_LAST_LOCATION_MODE))) { + if ("assignment" + .equals(context.getConfiguration().get(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY))) { ManagerMetadataUtil.updateLocation(tabletMutator, lastLocation, Location.last(location)); } } @@ -275,7 +279,8 @@ public class ManagerMetadataUtil { Location lastLocation, TServerInstance tServerInstance) { // if the location mode is 'compaction', then preserve the current compaction location in the // last location value - if ("compaction".equals(context.getConfiguration().get(Property.TSERV_LAST_LOCATION_MODE))) { + if ("compaction" + .equals(context.getConfiguration().get(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY))) { Location newLocation = Location.last(tServerInstance); updateLocation(tabletMutator, lastLocation, newLocation); } diff --git a/server/base/src/test/java/org/apache/accumulo/server/util/ManagerMetadataUtilTest.java b/server/base/src/test/java/org/apache/accumulo/server/util/ManagerMetadataUtilTest.java index 748dffaa65..6be2554548 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/util/ManagerMetadataUtilTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/util/ManagerMetadataUtilTest.java @@ -43,7 +43,9 @@ public class ManagerMetadataUtilTest { @BeforeEach public void before() { conf = EasyMock.createMock(AccumuloConfiguration.class); - EasyMock.expect(conf.get(Property.TSERV_LAST_LOCATION_MODE)).andReturn("assignment"); + @SuppressWarnings("removal") + Property DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY = Property.TSERV_LAST_LOCATION_MODE; + EasyMock.expect(conf.get(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY)).andReturn("assignment"); context = EasyMock.createMock(ClientContext.class); EasyMock.expect(context.getConfiguration()).andReturn(conf).once(); tabletMutator = EasyMock.createMock(Ample.TabletMutator.class); diff --git a/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java index a80717cf84..c82d1fe3c5 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/AssignLocationModeIT.java @@ -43,6 +43,10 @@ import org.junit.jupiter.api.Test; public class AssignLocationModeIT extends ConfigurableMacBase { + @SuppressWarnings("removal") + private static final Property DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY = + Property.TSERV_LAST_LOCATION_MODE; + @Override protected Duration defaultTimeout() { return Duration.ofMinutes(2); @@ -50,7 +54,7 @@ public class AssignLocationModeIT extends ConfigurableMacBase { @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration fsConf) { - cfg.setProperty(Property.TSERV_LAST_LOCATION_MODE, "assignment"); + cfg.setProperty(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY, "assignment"); } @Test @@ -78,7 +82,7 @@ public class AssignLocationModeIT extends ConfigurableMacBase { } // assert that the default mode is "assign" assertEquals("assignment", c.instanceOperations().getSystemConfiguration() - .get(Property.TSERV_LAST_LOCATION_MODE.getKey())); + .get(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY.getKey())); // last location should not be set yet TabletLocationState unflushed = getTabletLocationState(c, tableId); diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java index 146fbeecb0..df953006d4 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/CompactLocationModeIT.java @@ -43,6 +43,10 @@ import org.junit.jupiter.api.Test; public class CompactLocationModeIT extends ConfigurableMacBase { + @SuppressWarnings("removal") + private static final Property DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY = + Property.TSERV_LAST_LOCATION_MODE; + @Override protected Duration defaultTimeout() { return Duration.ofMinutes(2); @@ -50,7 +54,7 @@ public class CompactLocationModeIT extends ConfigurableMacBase { @Override public void configure(MiniAccumuloConfigImpl cfg, Configuration fsConf) { - cfg.setProperty(Property.TSERV_LAST_LOCATION_MODE, "compaction"); + cfg.setProperty(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY, "compaction"); } @Test @@ -77,7 +81,7 @@ public class CompactLocationModeIT extends ConfigurableMacBase { } // assert that the default mode is "compact" assertEquals("compaction", c.instanceOperations().getSystemConfiguration() - .get(Property.TSERV_LAST_LOCATION_MODE.getKey())); + .get(DEPRECATED_TSERV_LAST_LOCATION_MODE_PROPERTY.getKey())); // no last location should be set yet TabletLocationState unflushed = getTabletLocationState(c, tableId);