This is an automated email from the ASF dual-hosted git repository. ctubbsii 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 bc6fa04 Deprecate Master and replace with Manager in public API (#1703) bc6fa04 is described below commit bc6fa04283d1dda3bfcde5ef193027d171adb37b Author: Joseph Koshakow <jkos...@users.noreply.github.com> AuthorDate: Thu Sep 10 22:24:21 2020 -0400 Deprecate Master and replace with Manager in public API (#1703) Fixes #1643 --- .../java/org/apache/accumulo/core/client/Instance.java | 15 ++++++++++++++- .../apache/accumulo/core/client/ZooKeeperInstance.java | 2 +- .../apache/accumulo/core/clientImpl/ClientContext.java | 2 +- .../cluster/standalone/StandaloneAccumuloCluster.java | 2 +- .../cluster/standalone/StandaloneClusterControl.java | 6 ++++++ .../apache/accumulo/minicluster/MiniAccumuloConfig.java | 2 +- .../apache/accumulo/minicluster/MiniAccumuloRunner.java | 2 +- .../java/org/apache/accumulo/minicluster/ServerType.java | 5 +++++ .../miniclusterImpl/MiniAccumuloClusterControl.java | 6 ++++++ .../accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java | 6 +++--- .../miniclusterImpl/MiniAccumuloClusterImplTest.java | 2 +- .../miniclusterImpl/MiniAccumuloConfigImplTest.java | 6 +++--- .../test/ThriftServerBindsBeforeZooKeeperLockIT.java | 6 +++--- .../org/apache/accumulo/test/functional/KerberosIT.java | 4 ++-- .../apache/accumulo/test/functional/MasterFailoverIT.java | 4 ++-- .../org/apache/accumulo/test/functional/RestartIT.java | 10 +++++----- 16 files changed, 55 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/client/Instance.java b/core/src/main/java/org/apache/accumulo/core/client/Instance.java index fe8c0df..3a4bd45 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/Instance.java +++ b/core/src/main/java/org/apache/accumulo/core/client/Instance.java @@ -44,8 +44,21 @@ public interface Instance { * Returns the location(s) of the accumulo master and any redundant servers. * * @return a list of locations in "hostname:port" form + * + * @deprecated Use {@link #getManagerLocations()} instead + */ + @Deprecated(since = "2.1.0", forRemoval = true) + default List<String> getMasterLocations() { + return getManagerLocations(); + } + + /** + * Returns the location(s) of the accumulo manager and any redundant servers. + * + * @return a list of locations in "hostname:port" form + * */ - List<String> getMasterLocations(); + List<String> getManagerLocations(); /** * Returns a unique string that identifies this instance of accumulo. diff --git a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java index f671767..0fe98c1 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java +++ b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java @@ -134,7 +134,7 @@ public class ZooKeeperInstance implements Instance { } @Override - public List<String> getMasterLocations() { + public List<String> getManagerLocations() { return ClientContext.getMasterLocations(zooCache, getInstanceID()); } diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java index 2c8ab60..bacb4ad 100644 --- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java +++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java @@ -166,7 +166,7 @@ public class ClientContext implements AccumuloClient { } @Override - public List<String> getMasterLocations() { + public List<String> getManagerLocations() { return context.getMasterLocations(); } diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java index 1e476f53..145af13 100644 --- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java +++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java @@ -56,7 +56,7 @@ public class StandaloneAccumuloCluster implements AccumuloCluster { private static final Logger log = LoggerFactory.getLogger(StandaloneAccumuloCluster.class); static final List<ServerType> ALL_SERVER_TYPES = - Collections.unmodifiableList(Arrays.asList(ServerType.MASTER, ServerType.TABLET_SERVER, + Collections.unmodifiableList(Arrays.asList(ServerType.MANAGER, ServerType.TABLET_SERVER, ServerType.TRACER, ServerType.GARBAGE_COLLECTOR, ServerType.MONITOR)); private ClientInfo info; diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java index 7ff6f84..7741df3 100644 --- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java +++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java @@ -160,6 +160,7 @@ public class StandaloneClusterControl implements ClusterControl { } @Override + @SuppressWarnings("removal") public void startAllServers(ServerType server) throws IOException { switch (server) { case TABLET_SERVER: @@ -168,6 +169,7 @@ public class StandaloneClusterControl implements ClusterControl { } break; case MASTER: + case MANAGER: for (String master : getHosts(MASTER_HOSTS_FILE)) { start(server, master); } @@ -212,6 +214,7 @@ public class StandaloneClusterControl implements ClusterControl { } @Override + @SuppressWarnings("removal") public void stopAllServers(ServerType server) throws IOException { switch (server) { case TABLET_SERVER: @@ -220,6 +223,7 @@ public class StandaloneClusterControl implements ClusterControl { } break; case MASTER: + case MANAGER: for (String master : getHosts(MASTER_HOSTS_FILE)) { stop(server, master); } @@ -317,6 +321,7 @@ public class StandaloneClusterControl implements ClusterControl { "'{print \\$2}'", "|", "head", "-1", "|", "tr", "-d", "'\\n'"}; } + @SuppressWarnings("removal") protected String getProcessString(ServerType server) { switch (server) { case TABLET_SERVER: @@ -324,6 +329,7 @@ public class StandaloneClusterControl implements ClusterControl { case GARBAGE_COLLECTOR: return "gc"; case MASTER: + case MANAGER: return "master"; case TRACER: return "tracer"; diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java index edacc9a..c8f6e7b 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloConfig.java @@ -113,7 +113,7 @@ public class MiniAccumuloConfig { } /** - * Sets the amount of memory to use in the master process. Calling this method is optional. + * Sets the amount of memory to use in the manager process. Calling this method is optional. * Default memory is 128M * * @param serverType diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java index ded38c4..1b8ce44 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloRunner.java @@ -198,7 +198,7 @@ public class MiniAccumuloRunner { setMemoryOnConfig(config, opts.prop.getProperty(TSERVER_MEMORY_PROP), ServerType.TABLET_SERVER); if (opts.prop.containsKey(MASTER_MEMORY_PROP)) - setMemoryOnConfig(config, opts.prop.getProperty(MASTER_MEMORY_PROP), ServerType.MASTER); + setMemoryOnConfig(config, opts.prop.getProperty(MASTER_MEMORY_PROP), ServerType.MANAGER); if (opts.prop.containsKey(DEFAULT_MEMORY_PROP)) setMemoryOnConfig(config, opts.prop.getProperty(DEFAULT_MEMORY_PROP)); if (opts.prop.containsKey(SHUTDOWN_PORT_PROP)) diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/ServerType.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/ServerType.java index 00d2040..837e1c6 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/ServerType.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/ServerType.java @@ -22,7 +22,12 @@ package org.apache.accumulo.minicluster; * @since 1.6.0 */ public enum ServerType { + /** + * @deprecated Use {@link #MANAGER} instead + */ + @Deprecated(since = "2.1.0", forRemoval = true) MASTER("Master"), + MANAGER("Manager"), ZOOKEEPER("ZooKeeper"), TABLET_SERVER("TServer"), GARBAGE_COLLECTOR("GC"), diff --git a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java index 617bea1..92ad603 100644 --- a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java +++ b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterControl.java @@ -123,6 +123,7 @@ public class MiniAccumuloClusterControl implements ClusterControl { start(server, Collections.emptyMap(), Integer.MAX_VALUE); } + @SuppressWarnings("removal") public synchronized void start(ServerType server, Map<String,String> configOverrides, int limit) throws IOException { if (limit <= 0) { @@ -141,6 +142,7 @@ public class MiniAccumuloClusterControl implements ClusterControl { } break; case MASTER: + case MANAGER: if (masterProcess == null) { masterProcess = cluster._exec(Master.class, server, configOverrides).getProcess(); } @@ -182,9 +184,11 @@ public class MiniAccumuloClusterControl implements ClusterControl { } @Override + @SuppressWarnings("removal") public synchronized void stop(ServerType server, String hostname) throws IOException { switch (server) { case MASTER: + case MANAGER: if (masterProcess != null) { try { cluster.stopProcessWithTimeout(masterProcess, 30, TimeUnit.SECONDS); @@ -287,11 +291,13 @@ public class MiniAccumuloClusterControl implements ClusterControl { throw new UnsupportedOperationException(); } + @SuppressWarnings("removal") public void killProcess(ServerType type, ProcessReference procRef) throws ProcessNotFoundException, InterruptedException { boolean found = false; switch (type) { case MASTER: + case MANAGER: if (procRef.getProcess().equals(masterProcess)) { try { cluster.stopProcessWithTimeout(masterProcess, 30, TimeUnit.SECONDS); diff --git a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java index 9451123..c5732c8 100644 --- a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java +++ b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java @@ -583,7 +583,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { + ". Check the logs in " + config.getLogDir() + " for errors."); } - control.start(ServerType.MASTER); + control.start(ServerType.MANAGER); control.start(ServerType.GARBAGE_COLLECTOR); if (executor == null) { @@ -615,7 +615,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { public Map<ServerType,Collection<ProcessReference>> getProcesses() { Map<ServerType,Collection<ProcessReference>> result = new HashMap<>(); MiniAccumuloClusterControl control = getClusterControl(); - result.put(ServerType.MASTER, references(control.masterProcess)); + result.put(ServerType.MANAGER, references(control.masterProcess)); result.put(ServerType.TABLET_SERVER, references(control.tabletServerProcesses.toArray(new Process[0]))); if (control.zooKeeperProcess != null) { @@ -665,7 +665,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { MiniAccumuloClusterControl control = getClusterControl(); control.stop(ServerType.GARBAGE_COLLECTOR, null); - control.stop(ServerType.MASTER, null); + control.stop(ServerType.MANAGER, null); control.stop(ServerType.TABLET_SERVER, null); control.stop(ServerType.ZOOKEEPER, null); diff --git a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java index aeb7437..7f966cc 100644 --- a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java +++ b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImplTest.java @@ -89,7 +89,7 @@ public class MiniAccumuloClusterImplTest { assertTrue(procs.containsKey(ServerType.GARBAGE_COLLECTOR)); - for (ServerType t : new ServerType[] {ServerType.MASTER, ServerType.TABLET_SERVER, + for (ServerType t : new ServerType[] {ServerType.MANAGER, ServerType.TABLET_SERVER, ServerType.ZOOKEEPER}) { assertTrue(procs.containsKey(t)); Collection<ProcessReference> procRefs = procs.get(t); diff --git a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java index 37c49a2..e8c7bfb 100644 --- a/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java +++ b/minicluster/src/test/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloConfigImplTest.java @@ -83,11 +83,11 @@ public class MiniAccumuloConfigImplTest { MiniAccumuloConfigImpl config = new MiniAccumuloConfigImpl(tempFolder.getRoot(), "password").initialize(); config.setDefaultMemory(96, MemoryUnit.MEGABYTE); - assertEquals(96 * 1024 * 1024L, config.getMemory(ServerType.MASTER)); + assertEquals(96 * 1024 * 1024L, config.getMemory(ServerType.MANAGER)); assertEquals(96 * 1024 * 1024L, config.getMemory(ServerType.TABLET_SERVER)); assertEquals(96 * 1024 * 1024L, config.getDefaultMemory()); - config.setMemory(ServerType.MASTER, 256, MemoryUnit.MEGABYTE); - assertEquals(256 * 1024 * 1024L, config.getMemory(ServerType.MASTER)); + config.setMemory(ServerType.MANAGER, 256, MemoryUnit.MEGABYTE); + assertEquals(256 * 1024 * 1024L, config.getMemory(ServerType.MANAGER)); assertEquals(96 * 1024 * 1024L, config.getDefaultMemory()); assertEquals(96 * 1024 * 1024L, config.getMemory(ServerType.TABLET_SERVER)); } diff --git a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java index 6fec7d1..bdf6dcf 100644 --- a/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ThriftServerBindsBeforeZooKeeperLockIT.java @@ -157,7 +157,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne Process master = null; try { LOG.debug("Starting standby master on {}", freePort); - master = startProcess(cluster, ServerType.MASTER, freePort); + master = startProcess(cluster, ServerType.MANAGER, freePort); while (true) { try (Socket s = new Socket("localhost", freePort)) { @@ -177,7 +177,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne if (!master.isAlive()) { freePort = PortUtils.getRandomFreePort(); LOG.debug("Master died, restarting it listening on {}", freePort); - master = startProcess(cluster, ServerType.MASTER, freePort); + master = startProcess(cluster, ServerType.MANAGER, freePort); } } } finally { @@ -257,7 +257,7 @@ public class ThriftServerBindsBeforeZooKeeperLockIT extends AccumuloClusterHarne property = Property.MONITOR_PORT; service = Monitor.class; break; - case MASTER: + case MANAGER: property = Property.MASTER_CLIENTPORT; service = Master.class; break; diff --git a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java index fd0ecc7..7d1391a 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java @@ -538,10 +538,10 @@ public class KerberosIT extends AccumuloITBase { }); log.info("Stopping master"); - mac.getClusterControl().stop(ServerType.MASTER); + mac.getClusterControl().stop(ServerType.MANAGER); Thread.sleep(5000); log.info("Restarting master"); - mac.getClusterControl().start(ServerType.MASTER); + mac.getClusterControl().start(ServerType.MANAGER); // Make sure our original token is still good root.doAs((PrivilegedExceptionAction<Void>) () -> { diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MasterFailoverIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MasterFailoverIT.java index f4f42bc..a39a97a 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/MasterFailoverIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/MasterFailoverIT.java @@ -58,9 +58,9 @@ public class MasterFailoverIT extends AccumuloClusterHarness { TestIngest.ingest(c, params); ClusterControl control = cluster.getClusterControl(); - control.stopAllServers(ServerType.MASTER); + control.stopAllServers(ServerType.MANAGER); // start up a new one - control.startAllServers(ServerType.MASTER); + control.startAllServers(ServerType.MANAGER); // talk to it c.tableOperations().rename(names[0], names[1]); params.tableName = names[1]; diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java b/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java index 4ccbe71..59ec1c2 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/RestartIT.java @@ -114,8 +114,8 @@ public class RestartIT extends AccumuloClusterHarness { } }); - control.stopAllServers(ServerType.MASTER); - control.startAllServers(ServerType.MASTER); + control.stopAllServers(ServerType.MANAGER); + control.startAllServers(ServerType.MANAGER); assertEquals(0, ret.get().intValue()); VerifyIngest.verifyIngest(c, params); } @@ -132,7 +132,7 @@ public class RestartIT extends AccumuloClusterHarness { // TODO implement a kill all too? // cluster.stop() would also stop ZooKeeper - control.stopAllServers(ServerType.MASTER); + control.stopAllServers(ServerType.MANAGER); control.stopAllServers(ServerType.TRACER); control.stopAllServers(ServerType.TABLET_SERVER); control.stopAllServers(ServerType.GARBAGE_COLLECTOR); @@ -153,7 +153,7 @@ public class RestartIT extends AccumuloClusterHarness { cluster.start(); sleepUninterruptibly(5, TimeUnit.MILLISECONDS); - control.stopAllServers(ServerType.MASTER); + control.stopAllServers(ServerType.MANAGER); masterLockData = new byte[0]; do { @@ -189,7 +189,7 @@ public class RestartIT extends AccumuloClusterHarness { } }); - control.stopAllServers(ServerType.MASTER); + control.stopAllServers(ServerType.MANAGER); ClientInfo info = ClientInfo.from(c.properties()); ZooReader zreader = new ZooReader(info.getZooKeepers(), info.getZooKeepersSessionTimeOut());