accumuloClient = ensureTraceTableExists(conf); int ports[] = conf.getPort(Property.TRACE_PORT); ServerSocket sock = null; for (int port : ports) {
private void getMasterLock(final String zMasterLoc) throws KeeperException, InterruptedException { log.info("trying to get master lock"); final String masterClientAddress = hostname + ":" + getConfiguration().getPort(Property.MASTER_CLIENTPORT)[0]; while (true) { MasterLockWatcher masterLockWatcher = new MasterLockWatcher(); masterLock = new ZooLock(getContext().getZooReaderWriter(), zMasterLoc); masterLock.lockAsync(masterLockWatcher, masterClientAddress.getBytes()); masterLockWatcher.waitForChange(); if (masterLockWatcher.acquiredLock) { break; } if (!masterLockWatcher.failedToAcquireLock) { throw new IllegalStateException("master lock in unknown state"); } masterLock.tryToCancelAsyncLockOrUnlock(); sleepUninterruptibly(TIME_TO_WAIT_BETWEEN_LOCK_CHECKS, TimeUnit.MILLISECONDS); } setMasterState(MasterState.HAVE_LOCK); }
private static void stopTabletServer(final ClientContext context, List<String> servers, final boolean force) throws AccumuloException, AccumuloSecurityException { if (context.getMasterLocations().size() == 0) { log.info("No masters running. Not attempting safe unload of tserver."); return; } final String zTServerRoot = getTServersZkPath(context); final ZooCache zc = context.getZooCache(); for (String server : servers) { for (int port : context.getConfiguration().getPort(Property.TSERV_CLIENTPORT)) { HostAndPort address = AddressUtil.parseAddress(server, port); final String finalServer = qualifyWithZooKeeperSessionId(zTServerRoot, zc, address.toString()); log.info("Stopping server {}", finalServer); MasterClient.executeVoid(context, client -> client.shutdownTabletServer(Tracer.traceInfo(), context.rpcCreds(), finalServer, force)); } } }
private HostAndPort startStatsService() { Iface rpcProxy = TraceWrap.service(this); final Processor<Iface> processor; if (context.getThriftServerType() == ThriftServerType.SASL) { Iface tcProxy = TCredentialsUpdatingWrapper.service(rpcProxy, getClass(), getConfiguration()); processor = new Processor<>(tcProxy); } else { processor = new Processor<>(rpcProxy); } int port[] = getConfiguration().getPort(Property.GC_PORT); HostAndPort[] addresses = TServerUtils.getHostAndPorts(this.opts.getAddress(), port); long maxMessageSize = getConfiguration().getAsBytes(Property.GENERAL_MAX_MESSAGE_SIZE); try { ServerAddress server = TServerUtils.startTServer(getConfiguration(), context.getThriftServerType(), processor, this.getClass().getSimpleName(), "GC Monitor Service", 2, getConfiguration().getCount(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE), 1000, maxMessageSize, context.getServerSslParams(), context.getSaslParams(), 0, addresses); log.debug("Starting garbage collector listening on " + server.address); return server.address; } catch (Exception ex) { // ACCUMULO-3651 Level changed to error and FATAL added to message for slf4j compatibility log.error("FATAL:", ex); throw new RuntimeException(ex); } }
try { AccumuloConfiguration conf = context.getConfiguration(); SocketServer server = new SocketServer(conf.getPort(Property.MONITOR_LOG4J_PORT)[0]);
public void run() { Monitor.START_TIME = System.currentTimeMillis(); int ports[] = config.getSystemConfiguration().getPort(Property.MONITOR_PORT); for (int port : ports) { try {
final AccumuloConfiguration config = service.getConfiguration(); final int[] portHint = config.getPort(portHintProperty);
private InetSocketAddress startStatsService(String hostname) throws UnknownHostException { Processor<Iface> processor = new Processor<Iface>(TraceWrap.service(this)); int port = instance.getConfiguration().getPort(Property.GC_PORT); long maxMessageSize = instance.getConfiguration().getMemoryInBytes(Property.GENERAL_MAX_MESSAGE_SIZE); try { port = TServerUtils.startTServer(port, processor, this.getClass().getSimpleName(), "GC Monitor Service", 2, 1000, maxMessageSize).port; } catch (Exception ex) { log.fatal(ex, ex); throw new RuntimeException(ex); } return new InetSocketAddress(hostname, port); }
System.setProperty("org.apache.accumulo.core.ip.localhost.hostname", localhost); int logPort = config.getConfiguration().getPort(Property.MONITOR_LOG4J_PORT); System.setProperty("org.apache.accumulo.core.host.log.port", Integer.toString(logPort));
int[] logPort = conf.getPort(Property.MONITOR_LOG4J_PORT); System.setProperty("org.apache.accumulo.core.host.log.port", Integer.toString(logPort[0]));
private void getMasterLock(final String zMasterLoc) throws KeeperException, InterruptedException { log.info("trying to get master lock"); final String masterClientAddress = org.apache.accumulo.core.util.AddressUtil.toString(new InetSocketAddress(hostname, getSystemConfiguration().getPort( Property.MASTER_CLIENTPORT))); while (true) { MasterLockWatcher masterLockWatcher = new MasterLockWatcher(); masterLock = new ZooLock(zMasterLoc); masterLock.lockAsync(masterLockWatcher, masterClientAddress.getBytes(UTF_8)); masterLockWatcher.waitForChange(); if (masterLockWatcher.acquiredLock) { break; } if (!masterLockWatcher.failedToAcquireLock) { throw new IllegalStateException("master lock in unknown state"); } masterLock.tryToCancelAsyncLockOrUnlock(); UtilWaitThread.sleep(TIME_TO_WAIT_BETWEEN_LOCK_CHECKS); } setMasterState(MasterState.HAVE_LOCK); }
connector = ensureTraceTableExists(conf); int ports[] = conf.getPort(Property.TRACE_PORT); ServerSocket sock = null; for (int port : ports) {
private void getMasterLock(final String zMasterLoc) throws KeeperException, InterruptedException { log.info("trying to get master lock"); final String masterClientAddress = hostname + ":" + getConfiguration().getPort(Property.MASTER_CLIENTPORT)[0]; while (true) { MasterLockWatcher masterLockWatcher = new MasterLockWatcher(); masterLock = new ZooLock(zMasterLoc); masterLock.lockAsync(masterLockWatcher, masterClientAddress.getBytes()); masterLockWatcher.waitForChange(); if (masterLockWatcher.acquiredLock) { break; } if (!masterLockWatcher.failedToAcquireLock) { throw new IllegalStateException("master lock in unknown state"); } masterLock.tryToCancelAsyncLockOrUnlock(); sleepUninterruptibly(TIME_TO_WAIT_BETWEEN_LOCK_CHECKS, TimeUnit.MILLISECONDS); } setMasterState(MasterState.HAVE_LOCK); }
Property portSearchProperty, Property minThreadProperty, Property timeBetweenThreadChecksProperty, Property maxMessageSizeProperty) throws UnknownHostException { int portHint = conf.getPort(portHintProperty); int minThreads = 2; if (minThreadProperty != null)
SocketServer server = new SocketServer(conf.getPort(Property.MONITOR_LOG4J_PORT));
String hostAddress) { try { SocketServer server = new SocketServer(conf.getPort(Property.MONITOR_LOG4J_PORT)[0]);
private HostAndPort startStatsService() throws UnknownHostException { Iface rpcProxy = RpcWrapper.service(this, new Processor<Iface>(this)); final Processor<Iface> processor; if (ThriftServerType.SASL == getThriftServerType()) { Iface tcProxy = TCredentialsUpdatingWrapper.service(rpcProxy, getClass(), getConfiguration()); processor = new Processor<>(tcProxy); } else { processor = new Processor<>(rpcProxy); } int port[] = getConfiguration().getPort(Property.GC_PORT); HostAndPort[] addresses = TServerUtils.getHostAndPorts(this.opts.getAddress(), port); long maxMessageSize = getConfiguration().getMemoryInBytes(Property.GENERAL_MAX_MESSAGE_SIZE); try { ServerAddress server = TServerUtils.startTServer(getConfiguration(), getThriftServerType(), processor, this.getClass().getSimpleName(), "GC Monitor Service", 2, getConfiguration().getCount(Property.GENERAL_SIMPLETIMER_THREADPOOL_SIZE), 1000, maxMessageSize, getServerSslParams(), getSaslParams(), 0, addresses); log.debug("Starting garbage collector listening on " + server.address); return server.address; } catch (Exception ex) { // ACCUMULO-3651 Level changed to error and FATAL added to message for slf4j compatibility log.error("FATAL:", ex); throw new RuntimeException(ex); } }
int port = conf.getPort(Property.TRACE_PORT); final ServerSocket sock = ServerSocketChannel.open().socket(); sock.setReuseAddress(true);
private static void stopTabletServer(final ClientContext context, List<String> servers, final boolean force) throws AccumuloException, AccumuloSecurityException { if (context.getInstance().getMasterLocations().size() == 0) { log.info("No masters running. Not attempting safe unload of tserver."); return; } final Instance instance = context.getInstance(); final String zTServerRoot = getTServersZkPath(instance); final ZooCache zc = new ZooCacheFactory().getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()); for (String server : servers) { for (int port : context.getConfiguration().getPort(Property.TSERV_CLIENTPORT)) { HostAndPort address = AddressUtil.parseAddress(server, port); final String finalServer = qualifyWithZooKeeperSessionId(zTServerRoot, zc, address.toString()); log.info("Stopping server " + finalServer); MasterClient.execute(context, new ClientExec<MasterClientService.Client>() { @Override public void execute(MasterClientService.Client client) throws Exception { client.shutdownTabletServer(Tracer.traceInfo(), context.rpcCreds(), finalServer, force); } }); } } }
int port = config.getConfiguration().getPort(Property.MONITOR_PORT); try { log.debug("Creating monitor on port " + port);