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 b32a5b2a8d removes port search properties (#6207)
b32a5b2a8d is described below
commit b32a5b2a8dd7d4e22f1f3eec6416d94d858a48aa
Author: Keith Turner <[email protected]>
AuthorDate: Thu Mar 12 12:38:46 2026 -0400
removes port search properties (#6207)
---
.../accumulo/core/conf/AccumuloConfiguration.java | 6 +-
.../org/apache/accumulo/core/conf/Property.java | 33 +++-----
.../core/conf/AccumuloConfigurationTest.java | 6 +-
.../apache/accumulo/core/conf/PropertyTest.java | 19 +++--
.../miniclusterImpl/MiniAccumuloConfigImpl.java | 3 -
.../apache/accumulo/server/rpc/TServerUtils.java | 77 ++-----------------
.../server/conf/SystemConfigurationTest.java | 8 +-
.../accumulo/server/rpc/TServerUtilsTest.java | 89 +---------------------
.../org/apache/accumulo/compactor/Compactor.java | 4 +-
.../apache/accumulo/gc/SimpleGarbageCollector.java | 2 +-
.../java/org/apache/accumulo/manager/Manager.java | 2 +-
.../org/apache/accumulo/tserver/ScanServer.java | 3 +-
.../org/apache/accumulo/tserver/TabletServer.java | 4 +-
.../compaction/ExternalCompactionTestUtils.java | 1 -
.../test/functional/GracefulShutdownIT.java | 1 -
.../accumulo/test/functional/ZombieTServer.java | 2 +-
.../accumulo/test/manager/SuspendedTabletsIT.java | 5 +-
.../accumulo/test/performance/NullTserver.java | 2 +-
18 files changed, 59 insertions(+), 208 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 158db00a00..74f7f13b24 100644
---
a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++
b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@ -356,7 +356,11 @@ public abstract class AccumuloConfiguration implements
Iterable<Entry<String,Str
return IntStream.of(port);
} else {
log.error("Invalid port number {}; Using default {}", port,
property.getDefaultValue());
- return IntStream.of(Integer.parseInt(property.getDefaultValue()));
+ if (property.getDefaultValue().contains("-")) {
+ return PortRange.parse(property.getDefaultValue());
+ } else {
+ return IntStream.of(Integer.parseInt(property.getDefaultValue()));
+ }
}
} catch (NumberFormatException e1) {
throw new IllegalArgumentException("Invalid port syntax. Must be a
single positive "
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 dd3aa1920a..99040f1f5d 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
@@ -589,10 +589,7 @@ public enum Property {
expiration time, will trigger a background refresh for future hits. \
Value must be less than 100%. Set to 0 will disable refresh.
""", "2.1.3"),
- SSERV_PORTSEARCH("sserver.port.search", "true", PropertyType.BOOLEAN,
- "if the sserver.port.client ports are in use, search higher ports until
one is available.",
- "2.1.0"),
- SSERV_CLIENTPORT("sserver.port.client", "9996", PropertyType.PORT,
+ SSERV_CLIENTPORT("sserver.port.client", "9700-9799", PropertyType.PORT,
"The port used for handling client connections on the tablet servers.",
"2.1.0"),
SSERV_MINTHREADS("sserver.server.threads.minimum", "20", PropertyType.COUNT,
"The minimum number of threads to use to handle incoming requests.",
"2.1.0"),
@@ -657,10 +654,7 @@ public enum Property {
"Specifies the size of the cache for RFile index blocks.", "1.3.5"),
TSERV_SUMMARYCACHE_SIZE("tserver.cache.summary.size", "10%",
PropertyType.MEMORY,
"Specifies the size of the cache for summary data on each tablet
server.", "2.0.0"),
- TSERV_PORTSEARCH("tserver.port.search", "true", PropertyType.BOOLEAN,
- "if the tserver.port.client ports are in use, search higher ports until
one is available.",
- "1.3.5"),
- TSERV_CLIENTPORT("tserver.port.client", "9997", PropertyType.PORT,
+ TSERV_CLIENTPORT("tserver.port.client", "9800-9899", PropertyType.PORT,
"The port used for handling client connections on the tablet servers.",
"1.3.5"),
TSERV_TOTAL_MUTATION_QUEUE_MAX("tserver.total.mutation.queue.max", "5%",
PropertyType.MEMORY,
"The amount of memory used to store write-ahead-log mutations before
flushing them.",
@@ -1318,10 +1312,7 @@ public enum Property {
+ " should be cancelled. This checks for situations like was the
tablet deleted (split "
+ " and merge do this), was the table deleted, was a user compaction
canceled, etc.",
"2.1.4"),
- COMPACTOR_PORTSEARCH("compactor.port.search", "true", PropertyType.BOOLEAN,
- "If the compactor.port.client ports are in use, search higher ports
until one is available.",
- "2.1.0"),
- COMPACTOR_CLIENTPORT("compactor.port.client", "9133", PropertyType.PORT,
+ COMPACTOR_CLIENTPORT("compactor.port.client", "9600-9699", PropertyType.PORT,
"The port used for handling client connections on the compactor
servers.", "2.1.0"),
COMPACTOR_MIN_JOB_WAIT_TIME("compactor.wait.time.job.min", "1s",
PropertyType.TIMEDURATION,
"The minimum amount of time to wait between checks for the next
compaction job, backing off"
@@ -1684,10 +1675,9 @@ public enum Property {
// SSERV options
SSERV_CACHED_TABLET_METADATA_REFRESH_PERCENT, SSERV_THREADCHECK,
SSERV_CLIENTPORT,
- SSERV_PORTSEARCH, SSERV_DATACACHE_SIZE, SSERV_INDEXCACHE_SIZE,
SSERV_SUMMARYCACHE_SIZE,
- SSERV_DEFAULT_BLOCKSIZE, SSERV_SCAN_REFERENCE_EXPIRATION_TIME,
- SSERV_CACHED_TABLET_METADATA_EXPIRATION, SSERV_MINTHREADS,
SSERV_MINTHREADS_TIMEOUT,
- SSERV_WAL_SORT_MAX_CONCURRENT, SSERV_GROUP_NAME,
+ SSERV_DATACACHE_SIZE, SSERV_INDEXCACHE_SIZE, SSERV_SUMMARYCACHE_SIZE,
SSERV_DEFAULT_BLOCKSIZE,
+ SSERV_SCAN_REFERENCE_EXPIRATION_TIME,
SSERV_CACHED_TABLET_METADATA_EXPIRATION,
+ SSERV_MINTHREADS, SSERV_MINTHREADS_TIMEOUT,
SSERV_WAL_SORT_MAX_CONCURRENT, SSERV_GROUP_NAME,
// TSERV options
TSERV_TOTAL_MUTATION_QUEUE_MAX, TSERV_WAL_MAX_SIZE, TSERV_WAL_MAX_AGE,
@@ -1695,10 +1685,10 @@ public enum Property {
TSERV_WAL_TOLERATED_MAXIMUM_WAIT_DURATION, TSERV_MAX_IDLE,
TSERV_SESSION_MAXIDLE,
TSERV_SCAN_RESULTS_MAX_TIMEOUT, TSERV_MINC_MAXCONCURRENT,
TSERV_THREADCHECK,
TSERV_LOG_BUSY_TABLETS_COUNT, TSERV_LOG_BUSY_TABLETS_INTERVAL,
TSERV_WAL_SORT_MAX_CONCURRENT,
- TSERV_SLOW_FILEPERMIT_MILLIS, TSERV_WAL_BLOCKSIZE, TSERV_CLIENTPORT,
TSERV_PORTSEARCH,
- TSERV_DATACACHE_SIZE, TSERV_INDEXCACHE_SIZE, TSERV_SUMMARYCACHE_SIZE,
TSERV_DEFAULT_BLOCKSIZE,
- TSERV_MINTHREADS, TSERV_MINTHREADS_TIMEOUT, TSERV_NATIVEMAP_ENABLED,
TSERV_MAXMEM,
- TSERV_SCAN_MAX_OPENFILES, TSERV_ONDEMAND_UNLOADER_INTERVAL,
TSERV_GROUP_NAME,
+ TSERV_SLOW_FILEPERMIT_MILLIS, TSERV_WAL_BLOCKSIZE, TSERV_CLIENTPORT,
TSERV_DATACACHE_SIZE,
+ TSERV_INDEXCACHE_SIZE, TSERV_SUMMARYCACHE_SIZE, TSERV_DEFAULT_BLOCKSIZE,
TSERV_MINTHREADS,
+ TSERV_MINTHREADS_TIMEOUT, TSERV_NATIVEMAP_ENABLED, TSERV_MAXMEM,
TSERV_SCAN_MAX_OPENFILES,
+ TSERV_ONDEMAND_UNLOADER_INTERVAL, TSERV_GROUP_NAME,
// GC options
GC_CANDIDATE_BATCH_SIZE, GC_CYCLE_START, GC_PORT,
@@ -1709,8 +1699,7 @@ public enum Property {
// COMPACTOR options
COMPACTOR_CANCEL_CHECK_INTERVAL, COMPACTOR_CLIENTPORT,
COMPACTOR_THREADCHECK,
- COMPACTOR_PORTSEARCH, COMPACTOR_MINTHREADS, COMPACTOR_MINTHREADS_TIMEOUT,
- COMPACTOR_GROUP_NAME,
+ COMPACTOR_MINTHREADS, COMPACTOR_MINTHREADS_TIMEOUT, COMPACTOR_GROUP_NAME,
// COMPACTION_COORDINATOR options
COMPACTION_COORDINATOR_DEAD_COMPACTOR_CHECK_INTERVAL,
diff --git
a/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
b/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
index cfcf240306..1374b3ef67 100644
---
a/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
+++
b/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
@@ -19,6 +19,7 @@
package org.apache.accumulo.core.conf;
import static
org.apache.accumulo.core.conf.Property.TABLE_ITERATOR_MINC_PREFIX;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotSame;
@@ -83,8 +84,9 @@ public class AccumuloConfigurationTest {
ConfigurationCopy cc = new ConfigurationCopy(c);
cc.set(Property.TSERV_CLIENTPORT, "1020");
int[] ports = cc.getPort(Property.TSERV_CLIENTPORT);
- assertEquals(1, ports.length);
-
assertEquals(Integer.parseInt(Property.TSERV_CLIENTPORT.getDefaultValue()),
ports[0]);
+ assertEquals(100, ports.length);
+ assertArrayEquals(
+
PropertyType.PortRange.parse(Property.TSERV_CLIENTPORT.getDefaultValue()).toArray(),
ports);
}
@Test
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
index 79d84444c7..40faf625f8 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
@@ -32,6 +32,7 @@ import java.util.TreeMap;
import java.util.function.Predicate;
import java.util.stream.Collector;
import java.util.stream.Collectors;
+import java.util.stream.IntStream;
import java.util.stream.StreamSupport;
import org.junit.jupiter.api.Test;
@@ -110,11 +111,19 @@ public class PropertyTest {
HashSet<Integer> usedPorts = new HashSet<>();
for (Property prop : Property.values()) {
if (prop.getType().equals(PropertyType.PORT)) {
- int port = Integer.parseInt(prop.getDefaultValue());
- assertTrue(Property.isValidProperty(prop.getKey(),
Integer.toString(port)));
- assertFalse(usedPorts.contains(port), "Port already in use: " + port);
- usedPorts.add(port);
- assertTrue(port > 1023 && port < 65536, "Port out of range of valid
ports: " + port);
+ var defaultVal = prop.getDefaultValue();
+ assertTrue(Property.isValidProperty(prop.getKey(), defaultVal));
+ IntStream ports;
+ if (defaultVal.contains("-")) {
+ ports = PropertyType.PortRange.parse(defaultVal);
+ } else {
+ ports = IntStream.of(Integer.parseInt(defaultVal));
+ }
+ ports.forEach(port -> {
+ assertFalse(usedPorts.contains(port), "Port already in use: " +
port);
+ usedPorts.add(port);
+ assertTrue(port > 1023 && port < 65536, "Port out of range of valid
ports: " + port);
+ });
}
}
}
diff --git
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
index a09f00df49..6f00276d9c 100644
---
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
+++
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImpl.java
@@ -177,7 +177,6 @@ public class MiniAccumuloConfigImpl {
// enable metrics reporting - by default will appear in standard log
files.
mergeProp(Property.GENERAL_MICROMETER_ENABLED.getKey(), "true");
- mergeProp(Property.TSERV_PORTSEARCH.getKey(), "true");
mergeProp(Property.TSERV_DATACACHE_SIZE.getKey(), "10M");
mergeProp(Property.TSERV_INDEXCACHE_SIZE.getKey(), "10M");
mergeProp(Property.TSERV_SUMMARYCACHE_SIZE.getKey(), "10M");
@@ -191,8 +190,6 @@ public class MiniAccumuloConfigImpl {
mergePropWithRandomPort(Property.MONITOR_PORT.getKey());
mergePropWithRandomPort(Property.GC_PORT.getKey());
- mergeProp(Property.COMPACTOR_PORTSEARCH.getKey(), "true");
-
mergeProp(Property.MANAGER_COMPACTION_SERVICE_PRIORITY_QUEUE_SIZE.getKey(),
Property.MANAGER_COMPACTION_SERVICE_PRIORITY_QUEUE_SIZE.getDefaultValue());
mergeProp(Property.COMPACTION_SERVICE_DEFAULT_PLANNER.getKey(),
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
index b109812d00..a83ca11c46 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java
@@ -28,13 +28,10 @@ import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.util.Arrays;
-import java.util.EnumSet;
import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
-import java.util.stream.Collectors;
import java.util.stream.IntStream;
import javax.net.ssl.SSLServerSocket;
@@ -42,14 +39,11 @@ import javax.net.ssl.SSLServerSocket;
import org.apache.accumulo.core.cli.ServerOpts;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.conf.PropertyType;
-import org.apache.accumulo.core.conf.PropertyType.PortRange;
import org.apache.accumulo.core.data.InstanceId;
import org.apache.accumulo.core.metrics.MetricsInfo;
import org.apache.accumulo.core.rpc.SslConnectionParams;
import org.apache.accumulo.core.rpc.ThriftUtil;
import org.apache.accumulo.core.rpc.UGIAssumingTransportFactory;
-import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.threads.ThreadPools;
import org.apache.accumulo.server.ServerContext;
import org.apache.hadoop.security.SaslRpcServer;
@@ -97,19 +91,6 @@ public class TServerUtils {
.toArray(HostAndPort[]::new);
}
- /**
- *
- * @param config Accumulo configuration
- * @return A Map object with reserved port numbers as keys and Property
objects as values
- */
- static Map<Integer,Property> getReservedPorts(AccumuloConfiguration config,
- Property portProperty) {
- return EnumSet.allOf(Property.class).stream()
- .filter(p -> p.getType() == PropertyType.PORT && p != portProperty)
- .flatMap(rp -> config.getPortStream(rp).mapToObj(portNum -> new
Pair<>(portNum, rp)))
- .filter(p -> p.getFirst() !=
0).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond));
- }
-
/**
* Create a ServerAddress, at the given port, or higher, if that port is not
available. Callers
* must start the ThriftServer after calling this method using
@@ -119,8 +100,6 @@ public class TServerUtils {
* @param portHintProperty the port to attempt to open, can be zero, meaning
"any available port"
* @param processor the service to be started
* @param serverName the name of the class that is providing the service
- * @param portSearchProperty A boolean Property to control if port-search
should be used, or null
- * to disable
* @param minThreadProperty A Property to control the minimum number of
threads in the pool
* @param timeBetweenThreadChecksProperty A Property to control the amount
of time between checks
* to resize the thread pool
@@ -129,7 +108,7 @@ public class TServerUtils {
*/
public static ServerAddress createThriftServer(ServerContext context, String
hostname,
Property portHintProperty, TProcessor processor, String serverName,
- Property portSearchProperty, Property minThreadProperty, Property
threadTimeOutProperty,
+ Property minThreadProperty, Property threadTimeOutProperty,
Property timeBetweenThreadChecksProperty) throws UnknownHostException {
final AccumuloConfiguration config = context.getConfiguration();
@@ -152,11 +131,6 @@ public class TServerUtils {
long maxMessageSize = config.getAsBytes(Property.RPC_MAX_MESSAGE_SIZE);
- boolean portSearch = false;
- if (portSearchProperty != null) {
- portSearch = config.getBoolean(portSearchProperty);
- }
-
int backlog = config.getCount(Property.RPC_BACKLOG);
final ThriftServerType serverType = context.getThriftServerType();
@@ -175,43 +149,10 @@ public class TServerUtils {
return TServerUtils.createThriftServer(serverType, timedProcessor,
context.getInstanceID(),
serverName, minThreads, threadTimeOut, config,
timeBetweenThreadChecks, maxMessageSize,
context.getServerSslParams(), context.getSaslParams(),
context.getClientTimeoutInMillis(),
- backlog, portSearch, addresses);
+ backlog, addresses);
} catch (TTransportException e) {
- if (portSearch) {
- // Build a list of reserved ports - as identified by properties of
type PropertyType.PORT
- Map<Integer,Property> reservedPorts = getReservedPorts(config,
portHintProperty);
-
- HostAndPort last = addresses[addresses.length - 1];
- // Attempt to allocate a port outside of the specified port property
- // Search sequentially over the next 1000 ports
- for (int port = last.getPort() + 1; port < last.getPort() + 1001;
port++) {
- if (reservedPorts.containsKey(port)) {
- log.debug("During port search, skipping reserved port {} -
property {} ({})", port,
- reservedPorts.get(port).getKey(),
reservedPorts.get(port).getDescription());
-
- continue;
- }
-
- if (PortRange.VALID_RANGE.isBefore(port)) {
- break;
- }
- try {
- HostAndPort addr = HostAndPort.fromParts(hostname, port);
- return TServerUtils.createThriftServer(serverType, timedProcessor,
- context.getInstanceID(), serverName, minThreads,
threadTimeOut, config,
- timeBetweenThreadChecks, maxMessageSize,
context.getServerSslParams(),
- context.getSaslParams(), context.getClientTimeoutInMillis(),
backlog, portSearch,
- addr);
- } catch (TTransportException tte) {
- log.info("Unable to use port {}, retrying.", port);
- }
- }
- log.error("Unable to start TServer", e);
- throw new UnknownHostException("Unable to find a listen port");
- } else {
- log.error("Unable to start TServer", e);
- throw new UnknownHostException("Unable to find a listen port");
- }
+ log.error("Unable to start TServer", e);
+ throw new UnknownHostException("Unable to find a listen port");
}
}
@@ -570,8 +511,7 @@ public class TServerUtils {
ThriftServerType serverType, TProcessor processor, InstanceId
instanceId, String serverName,
int numThreads, long threadTimeOut, long timeBetweenThreadChecks, long
maxMessageSize,
SslConnectionParams sslParams, SaslServerConnectionParams saslParams,
- long serverSocketTimeout, int backlog, MetricsInfo metricsInfo, boolean
portSearch,
- HostAndPort... addresses) {
+ long serverSocketTimeout, int backlog, MetricsInfo metricsInfo,
HostAndPort... addresses) {
if (serverType == ThriftServerType.SASL) {
processor = updateSaslProcessor(serverType, processor);
@@ -580,7 +520,7 @@ public class TServerUtils {
try {
return createThriftServer(serverType, new TimedProcessor(processor,
metricsInfo), instanceId,
serverName, numThreads, threadTimeOut, conf,
timeBetweenThreadChecks, maxMessageSize,
- sslParams, saslParams, serverSocketTimeout, backlog, portSearch,
addresses);
+ sslParams, saslParams, serverSocketTimeout, backlog, addresses);
} catch (TTransportException e) {
throw new IllegalStateException(e);
}
@@ -597,8 +537,7 @@ public class TServerUtils {
TimedProcessor processor, InstanceId instanceId, String serverName, int
numThreads,
long threadTimeOut, final AccumuloConfiguration conf, long
timeBetweenThreadChecks,
long maxMessageSize, SslConnectionParams sslParams,
SaslServerConnectionParams saslParams,
- long serverSocketTimeout, int backlog, boolean portSearch,
HostAndPort... addresses)
- throws TTransportException {
+ long serverSocketTimeout, int backlog, HostAndPort... addresses) throws
TTransportException {
TProtocolFactory protocolFactory =
ThriftUtil.serverProtocolFactory(instanceId);
// This is presently not supported. It's hypothetically possible, I
believe, to work, but it
// would require changes in how the transports
@@ -641,7 +580,7 @@ public class TServerUtils {
};
break;
} catch (TTransportException e) {
- if (portSearch) {
+ if (addresses.length > 1) {
log.debug("Failed attempting to create server at {}. {}", address,
e.getMessage());
} else {
log.warn("Error attempting to create server at {}. Error: {}",
address, e.getMessage());
diff --git
a/server/base/src/test/java/org/apache/accumulo/server/conf/SystemConfigurationTest.java
b/server/base/src/test/java/org/apache/accumulo/server/conf/SystemConfigurationTest.java
index a7533e899c..ed1d50f485 100644
---
a/server/base/src/test/java/org/apache/accumulo/server/conf/SystemConfigurationTest.java
+++
b/server/base/src/test/java/org/apache/accumulo/server/conf/SystemConfigurationTest.java
@@ -108,7 +108,7 @@ public class SystemConfigurationTest {
public void testFromFixed() {
var sysPropKey = SystemPropKey.of();
- assertEquals("9997", sysConfig.get(TSERV_CLIENTPORT)); // default
+ assertEquals("9800-9899", sysConfig.get(TSERV_CLIENTPORT)); // default
assertEquals("1234", sysConfig.get(GC_PORT)); // fixed sys config
assertEquals("19", sysConfig.get(TSERV_SCAN_MAX_OPENFILES)); // fixed sys
config
assertEquals("true", sysConfig.get(TABLE_BLOOM_ENABLED)); // sys config
@@ -132,7 +132,7 @@ public class SystemConfigurationTest {
sysConfig.zkChangeEvent(sysPropKey);
- assertEquals("9997", sysConfig.get(TSERV_CLIENTPORT)); // default
+ assertEquals("9800-9899", sysConfig.get(TSERV_CLIENTPORT)); // default
assertEquals("1234", sysConfig.get(GC_PORT)); // fixed sys config
assertEquals("19", sysConfig.get(TSERV_SCAN_MAX_OPENFILES)); // fixed sys
config
assertEquals("false", sysConfig.get(TABLE_BLOOM_ENABLED)); // sys config
@@ -169,7 +169,7 @@ public class SystemConfigurationTest {
sysConfig.zkChangeEvent(sysPropKey);
sysConfig.zkChangeEvent(defaultRGPropKey);
- assertEquals("9997", sysConfig.get(TSERV_CLIENTPORT)); // default
+ assertEquals("9800-9899", sysConfig.get(TSERV_CLIENTPORT)); // default
assertEquals("1234", sysConfig.get(GC_PORT)); // fixed sys config
assertEquals("19", sysConfig.get(TSERV_SCAN_MAX_OPENFILES)); // fixed sys
config
assertEquals("true", sysConfig.get(TABLE_BLOOM_ENABLED)); // sys config
@@ -186,7 +186,7 @@ public class SystemConfigurationTest {
ResourceGroupConfiguration rgConfig =
new ResourceGroupConfiguration(context, testRGPropKey, testSysConfig);
- assertEquals("9997", rgConfig.get(TSERV_CLIENTPORT)); // default
+ assertEquals("9800-9899", rgConfig.get(TSERV_CLIENTPORT)); // default
assertEquals("1234", rgConfig.get(GC_PORT)); // fixed sys config
assertEquals("19", rgConfig.get(TSERV_SCAN_MAX_OPENFILES)); // fixed sys
config
assertEquals("false", rgConfig.get(TABLE_BLOOM_ENABLED)); // sys config
diff --git
a/server/base/src/test/java/org/apache/accumulo/server/rpc/TServerUtilsTest.java
b/server/base/src/test/java/org/apache/accumulo/server/rpc/TServerUtilsTest.java
index c4eed579b3..21c2fcface 100644
---
a/server/base/src/test/java/org/apache/accumulo/server/rpc/TServerUtilsTest.java
+++
b/server/base/src/test/java/org/apache/accumulo/server/rpc/TServerUtilsTest.java
@@ -25,7 +25,6 @@ import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -34,7 +33,6 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
-import java.util.Map;
import org.apache.accumulo.core.clientImpl.thrift.ClientService.Iface;
import org.apache.accumulo.core.clientImpl.thrift.ClientService.Processor;
@@ -95,7 +93,6 @@ public class TServerUtilsTest {
public void testStartServerZeroPort() throws Exception {
TServer server = null;
conf.set(Property.TSERV_CLIENTPORT, "0");
- conf.set(Property.TSERV_PORTSEARCH, "false");
try {
ServerAddress address = startServer();
assertNotNull(address);
@@ -114,7 +111,6 @@ public class TServerUtilsTest {
TServer server = null;
int port = getFreePort(1024);
conf.set(Property.TSERV_CLIENTPORT, Integer.toString(port));
- conf.set(Property.TSERV_PORTSEARCH, "false");
try {
ServerAddress address = startServer();
assertNotNull(address);
@@ -135,98 +131,18 @@ public class TServerUtilsTest {
InetAddress addr = InetAddress.getByName("localhost");
// Bind to the port
conf.set(Property.TSERV_CLIENTPORT, Integer.toString(port));
- conf.set(Property.TSERV_PORTSEARCH, "false");
try (ServerSocket s = new ServerSocket(port, 50, addr)) {
assertNotNull(s);
assertThrows(UnknownHostException.class, this::startServer);
}
}
- @SuppressFBWarnings(value = "UNENCRYPTED_SERVER_SOCKET", justification =
"socket for testing")
- @Test
- public void testStartServerUsedPortWithSearch() throws Exception {
- TServer server = null;
- int[] port = findTwoFreeSequentialPorts(1024);
- // Bind to the port
- InetAddress addr = InetAddress.getByName("localhost");
- conf.set(Property.TSERV_CLIENTPORT, Integer.toString(port[0]));
- try (ServerSocket s = new ServerSocket(port[0], 50, addr)) {
- assertNotNull(s);
- ServerAddress address = startServer();
- assertNotNull(address);
- server = address.getServer();
- assertNotNull(server);
- assertEquals(port[1], address.getAddress().getPort());
- } finally {
- if (server != null) {
- server.stop();
- }
-
- }
- }
-
- @SuppressFBWarnings(value = "UNENCRYPTED_SERVER_SOCKET", justification =
"socket for testing")
- @Test
- public void testStartServerNonDefaultPorts() throws Exception {
- TServer server = null;
-
- // This test finds 5 free ports in more-or-less a contiguous way and then
- // uses those port numbers to Accumulo services in the below (ascending)
sequence
- // 0. TServer default client port (this test binds to this port to force a
port search)
- // 1. GC
- // 2. Manager
- // 3. Monitor
- // 4. One free port - this is the one that we expect the TServer to
finally use
- int[] ports = findTwoFreeSequentialPorts(1024);
- int tserverDefaultPort = ports[0];
- conf.set(Property.TSERV_CLIENTPORT, Integer.toString(tserverDefaultPort));
- int gcPort = ports[1];
- conf.set(Property.GC_PORT, Integer.toString(gcPort));
-
- ports = findTwoFreeSequentialPorts(gcPort + 1);
- int managerPort = ports[0];
- conf.set(Property.MANAGER_CLIENTPORT, Integer.toString(managerPort));
- int monitorPort = ports[1];
- conf.set(Property.MONITOR_PORT, Integer.toString(monitorPort));
-
- ports = findTwoFreeSequentialPorts(monitorPort + 1);
- int tserverFinalPort = ports[0];
-
- // Ensure that the TServer client port we set above is NOT in the reserved
ports
- Map<Integer,Property> reservedPorts =
- TServerUtils.getReservedPorts(conf, Property.TSERV_CLIENTPORT);
- assertFalse(reservedPorts.containsKey(tserverDefaultPort));
-
- // Ensure that all the ports we assigned (GC, Manager, Monitor) are
included in the reserved
- // ports as returned by TServerUtils
- assertTrue(reservedPorts.containsKey(gcPort));
- assertTrue(reservedPorts.containsKey(managerPort));
- assertTrue(reservedPorts.containsKey(monitorPort));
-
- InetAddress addr = InetAddress.getByName("localhost");
- try (ServerSocket s = new ServerSocket(tserverDefaultPort, 50, addr)) {
- ServerAddress address = startServer();
- assertNotNull(address);
- server = address.getServer();
- assertNotNull(server);
-
- // Finally ensure that the TServer is using the last port (i.e. port
search worked)
- assertEquals(address.getAddress().getPort(), tserverFinalPort);
- } finally {
- if (server != null) {
- server.stop();
- }
-
- }
- }
-
@Test
public void testStartServerPortRange() throws Exception {
TServer server = null;
int[] port = findTwoFreeSequentialPorts(1024);
String portRange = port[0] + "-" + port[1];
conf.set(Property.TSERV_CLIENTPORT, portRange);
- conf.set(Property.TSERV_PORTSEARCH, "false");
try {
ServerAddress address = startServer();
assertNotNull(address);
@@ -250,7 +166,6 @@ public class TServerUtilsTest {
String portRange = port[0] + "-" + port[1];
// Bind to the port
conf.set(Property.TSERV_CLIENTPORT, portRange);
- conf.set(Property.TSERV_PORTSEARCH, "false");
try (ServerSocket s = new ServerSocket(port[0], 50, addr)) {
assertNotNull(s);
ServerAddress address = startServer();
@@ -302,8 +217,8 @@ public class TServerUtilsTest {
String hostname = "localhost";
ServerAddress sa = TServerUtils.createThriftServer(context, hostname,
Property.TSERV_CLIENTPORT,
- processor, "TServerUtilsTest", Property.TSERV_PORTSEARCH,
Property.TSERV_MINTHREADS,
- Property.TSERV_MINTHREADS_TIMEOUT, Property.TSERV_THREADCHECK);
+ processor, "TServerUtilsTest", Property.TSERV_MINTHREADS,
Property.TSERV_MINTHREADS_TIMEOUT,
+ Property.TSERV_THREADCHECK);
sa.startThriftServer("TServerUtilsTestThread");
return sa;
}
diff --git
a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
index 74fb2b39d7..66f11b7eb2 100644
---
a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
+++
b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
@@ -419,8 +419,8 @@ public class Compactor extends AbstractServer implements
MetricsProducer, Compac
updateThriftServer(() -> {
return TServerUtils.createThriftServer(getContext(), getBindAddress(),
Property.COMPACTOR_CLIENTPORT, processor,
this.getClass().getSimpleName(),
- Property.COMPACTOR_PORTSEARCH, Property.COMPACTOR_MINTHREADS,
- Property.COMPACTOR_MINTHREADS_TIMEOUT,
Property.COMPACTOR_THREADCHECK);
+ Property.COMPACTOR_MINTHREADS, Property.COMPACTOR_MINTHREADS_TIMEOUT,
+ Property.COMPACTOR_THREADCHECK);
});
}
diff --git
a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 5985bf7122..5fb80a404f 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -428,7 +428,7 @@ public class SimpleGarbageCollector extends AbstractServer
implements Iface {
processor, getContext().getInstanceID(),
this.getClass().getSimpleName(), 2,
ThreadPools.DEFAULT_TIMEOUT_MILLISECS, 1000, maxMessageSize,
getContext().getServerSslParams(), getContext().getSaslParams(), 0,
- getConfiguration().getCount(Property.RPC_BACKLOG),
getContext().getMetricsInfo(), false,
+ getConfiguration().getCount(Property.RPC_BACKLOG),
getContext().getMetricsInfo(),
addresses);
});
}
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 ccc92e4e74..c9a7df3a3d 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
@@ -998,7 +998,7 @@ public class Manager extends AbstractServer
try {
updateThriftServer(() -> {
return TServerUtils.createThriftServer(context, getBindAddress(),
- Property.MANAGER_CLIENTPORT, processor, "Manager", null,
Property.MANAGER_MINTHREADS,
+ Property.MANAGER_CLIENTPORT, processor, "Manager",
Property.MANAGER_MINTHREADS,
Property.MANAGER_MINTHREADS_TIMEOUT, Property.MANAGER_THREADCHECK);
});
} catch (UnknownHostException e) {
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
index 603e02b12f..7cc1e02fd7 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java
@@ -312,8 +312,7 @@ public class ScanServer extends AbstractServer
updateThriftServer(() -> {
return TServerUtils.createThriftServer(getContext(), getBindAddress(),
Property.SSERV_CLIENTPORT, processor,
this.getClass().getSimpleName(),
- Property.SSERV_PORTSEARCH, Property.SSERV_MINTHREADS,
Property.SSERV_MINTHREADS_TIMEOUT,
- Property.SSERV_THREADCHECK);
+ Property.SSERV_MINTHREADS, Property.SSERV_MINTHREADS_TIMEOUT,
Property.SSERV_THREADCHECK);
});
}
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 254107383b..c91ac319c5 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -410,8 +410,8 @@ public class TabletServer extends AbstractServer implements
TabletHostingServer
private void startServer(String address, TProcessor processor) throws
UnknownHostException {
updateThriftServer(() -> {
return TServerUtils.createThriftServer(getContext(), address,
Property.TSERV_CLIENTPORT,
- processor, this.getClass().getSimpleName(),
Property.TSERV_PORTSEARCH,
- Property.TSERV_MINTHREADS, Property.TSERV_MINTHREADS_TIMEOUT,
Property.TSERV_THREADCHECK);
+ processor, this.getClass().getSimpleName(),
Property.TSERV_MINTHREADS,
+ Property.TSERV_MINTHREADS_TIMEOUT, Property.TSERV_THREADCHECK);
});
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
index 18b6edae03..457abf588f 100644
---
a/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
+++
b/test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionTestUtils.java
@@ -239,7 +239,6 @@ public class ExternalCompactionTestUtils {
"[{'group':'" + GROUP8 + "'}]");
cfg.setProperty(Property.COMPACTION_COORDINATOR_DEAD_COMPACTOR_CHECK_INTERVAL,
"5s");
cfg.setProperty(Property.COMPACTOR_CANCEL_CHECK_INTERVAL, "5s");
- cfg.setProperty(Property.COMPACTOR_PORTSEARCH, "true");
cfg.setProperty(Property.COMPACTOR_MIN_JOB_WAIT_TIME, "100ms");
cfg.setProperty(Property.COMPACTOR_MAX_JOB_WAIT_TIME, "1s");
cfg.setProperty(Property.GENERAL_THREADPOOL_SIZE, "10");
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/GracefulShutdownIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/GracefulShutdownIT.java
index ff1b0e9c0f..289b2c06a5 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/GracefulShutdownIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/GracefulShutdownIT.java
@@ -105,7 +105,6 @@ public class GracefulShutdownIT extends
SharedMiniClusterBase {
cfg.getClusterServerConfiguration().setNumDefaultTabletServers(2);
cfg.setProperty(Property.COMPACTION_COORDINATOR_DEAD_COMPACTOR_CHECK_INTERVAL,
"5s");
cfg.setProperty(Property.COMPACTOR_CANCEL_CHECK_INTERVAL, "5s");
- cfg.setProperty(Property.COMPACTOR_PORTSEARCH, "true");
cfg.setProperty(Property.COMPACTION_SERVICE_PREFIX.getKey() + GROUP_NAME
+ ".planner",
RatioBasedCompactionPlanner.class.getName());
cfg.setProperty(
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
index c87fcaf788..9519a5b2fc 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ZombieTServer.java
@@ -127,7 +127,7 @@ public class ZombieTServer {
ServerAddress serverPort =
TServerUtils.createThriftServer(context.getConfiguration(),
ThriftServerType.CUSTOM_HS_HA, muxProcessor, context.getInstanceID(),
"ZombieTServer", 2,
ThreadPools.DEFAULT_TIMEOUT_MILLISECS, 1000, 10 * 1024 * 1024, null,
null, -1,
- context.getConfiguration().getCount(Property.RPC_BACKLOG),
context.getMetricsInfo(), false,
+ context.getConfiguration().getCount(Property.RPC_BACKLOG),
context.getMetricsInfo(),
HostAndPort.fromParts(ServerOpts.BIND_ALL_ADDRESSES, port));
serverPort.startThriftServer("walking dead");
diff --git
a/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
b/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
index 033fab023c..e69ebec9dc 100644
---
a/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/manager/SuspendedTabletsIT.java
@@ -268,9 +268,8 @@ public class SuspendedTabletsIT extends
AccumuloClusterHarness {
HostAndPort restartedServer =
deadTabletsByServer.keySet().iterator().next();
log.info("Restarting " + restartedServer);
((MiniAccumuloClusterImpl) getCluster())._exec(TabletServer.class,
ServerType.TABLET_SERVER,
- Map.of(Property.TSERV_CLIENTPORT.getKey(), "" +
restartedServer.getPort(),
- Property.TSERV_PORTSEARCH.getKey(), "false"),
- "-o", Property.TSERV_GROUP_NAME.getKey() + "=" + TEST_GROUP_NAME);
+ Map.of(Property.TSERV_CLIENTPORT.getKey(), "" +
restartedServer.getPort()), "-o",
+ Property.TSERV_GROUP_NAME.getKey() + "=" + TEST_GROUP_NAME);
// Eventually, the suspended tablets should be reassigned to the newly
alive tserver.
log.info("Awaiting tablet unsuspension for tablets belonging to " +
restartedServer);
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 7225e06360..73adbe90e3 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
@@ -318,7 +318,7 @@ public class NullTserver {
ServerAddress sa =
TServerUtils.createThriftServer(context.getConfiguration(),
ThriftServerType.CUSTOM_HS_HA, muxProcessor, context.getInstanceID(),
"NullTServer", 2,
ThreadPools.DEFAULT_TIMEOUT_MILLISECS, 1000, 10 * 1024 * 1024, null,
null, -1,
- context.getConfiguration().getCount(Property.RPC_BACKLOG),
context.getMetricsInfo(), false,
+ context.getConfiguration().getCount(Property.RPC_BACKLOG),
context.getMetricsInfo(),
HostAndPort.fromParts(ServerOpts.BIND_ALL_ADDRESSES, opts.port));
sa.startThriftServer("null tserver");