Search in sources :

Example 11 with ServerAddress

use of org.apache.accumulo.server.rpc.ServerAddress in project accumulo by apache.

the class TabletServer method startServer.

private HostAndPort startServer(AccumuloConfiguration conf, String address, Property portHint, TProcessor processor, String threadName) throws UnknownHostException {
    Property maxMessageSizeProperty = (conf.get(Property.TSERV_MAX_MESSAGE_SIZE) != null ? Property.TSERV_MAX_MESSAGE_SIZE : Property.GENERAL_MAX_MESSAGE_SIZE);
    ServerAddress sp = TServerUtils.startServer(this, address, portHint, processor, this.getClass().getSimpleName(), threadName, Property.TSERV_PORTSEARCH, Property.TSERV_MINTHREADS, Property.TSERV_THREADCHECK, maxMessageSizeProperty);
    this.server = sp.server;
    return sp.address;
}
Also used : ServerAddress(org.apache.accumulo.server.rpc.ServerAddress) Property(org.apache.accumulo.core.conf.Property)

Example 12 with ServerAddress

use of org.apache.accumulo.server.rpc.ServerAddress in project accumulo by apache.

the class TabletServer method startReplicationService.

private HostAndPort startReplicationService() throws UnknownHostException {
    final ReplicationServicerHandler handler = new ReplicationServicerHandler(this);
    ReplicationServicer.Iface rpcProxy = RpcWrapper.service(handler);
    ReplicationServicer.Iface repl = TCredentialsUpdatingWrapper.service(rpcProxy, handler.getClass(), getConfiguration());
    ReplicationServicer.Processor<ReplicationServicer.Iface> processor = new ReplicationServicer.Processor<>(repl);
    AccumuloConfiguration conf = getServerConfigurationFactory().getSystemConfiguration();
    Property maxMessageSizeProperty = (conf.get(Property.TSERV_MAX_MESSAGE_SIZE) != null ? Property.TSERV_MAX_MESSAGE_SIZE : Property.GENERAL_MAX_MESSAGE_SIZE);
    ServerAddress sp = TServerUtils.startServer(this, clientAddress.getHost(), Property.REPLICATION_RECEIPT_SERVICE_PORT, processor, "ReplicationServicerHandler", "Replication Servicer", Property.TSERV_PORTSEARCH, Property.REPLICATION_MIN_THREADS, Property.REPLICATION_THREADCHECK, maxMessageSizeProperty);
    this.replServer = sp.server;
    log.info("Started replication service on {}", sp.address);
    try {
        // The replication service is unique to the thrift service for a tserver, not just a host.
        // Advertise the host and port for replication service given the host and port for the tserver.
        ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(getInstance()) + ReplicationConstants.ZOO_TSERVERS + "/" + clientAddress.toString(), sp.address.toString().getBytes(UTF_8), NodeExistsPolicy.OVERWRITE);
    } catch (Exception e) {
        log.error("Could not advertise replication service port", e);
        throw new RuntimeException(e);
    }
    return sp.address;
}
Also used : Iface(org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface) Processor(org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Processor) TProcessor(org.apache.thrift.TProcessor) ReplicationServicerHandler(org.apache.accumulo.tserver.replication.ReplicationServicerHandler) ServerAddress(org.apache.accumulo.server.rpc.ServerAddress) ReplicationServicer(org.apache.accumulo.core.replication.thrift.ReplicationServicer) Property(org.apache.accumulo.core.conf.Property) TableNotFoundException(org.apache.accumulo.core.client.TableNotFoundException) ThriftSecurityException(org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException) IterationInterruptedException(org.apache.accumulo.core.iterators.IterationInterruptedException) TSampleNotPresentException(org.apache.accumulo.core.tabletserver.thrift.TSampleNotPresentException) WalMarkerException(org.apache.accumulo.server.log.WalStateManager.WalMarkerException) ConstraintViolationException(org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) ExecutionException(java.util.concurrent.ExecutionException) NotServingTabletException(org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException) AccumuloSecurityException(org.apache.accumulo.core.client.AccumuloSecurityException) KeeperException(org.apache.zookeeper.KeeperException) NoSuchScanIDException(org.apache.accumulo.core.tabletserver.thrift.NoSuchScanIDException) CancellationException(java.util.concurrent.CancellationException) DistributedStoreException(org.apache.accumulo.server.master.state.DistributedStoreException) TException(org.apache.thrift.TException) NoNodeException(org.apache.zookeeper.KeeperException.NoNodeException) ThriftTableOperationException(org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException) BadLocationStateException(org.apache.accumulo.server.master.state.TabletLocationState.BadLocationStateException) TimeoutException(java.util.concurrent.TimeoutException) TabletClosedException(org.apache.accumulo.tserver.tablet.TabletClosedException) SampleNotPresentException(org.apache.accumulo.core.client.SampleNotPresentException) AccumuloException(org.apache.accumulo.core.client.AccumuloException) AccumuloConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration)

Aggregations

ServerAddress (org.apache.accumulo.server.rpc.ServerAddress)12 ConfigurationCopy (org.apache.accumulo.core.conf.ConfigurationCopy)5 TServer (org.apache.thrift.server.TServer)5 Test (org.junit.Test)5 IOException (java.io.IOException)4 AccumuloException (org.apache.accumulo.core.client.AccumuloException)3 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)3 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)3 TException (org.apache.thrift.TException)3 KeeperException (org.apache.zookeeper.KeeperException)3 InetAddress (java.net.InetAddress)2 ServerSocket (java.net.ServerSocket)2 UnknownHostException (java.net.UnknownHostException)2 ThriftSecurityException (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException)2 ThriftTableOperationException (org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException)2 Property (org.apache.accumulo.core.conf.Property)2 Iface (org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Iface)2 Processor (org.apache.accumulo.core.tabletserver.thrift.TabletClientService.Processor)2 HostAndPort (org.apache.accumulo.core.util.HostAndPort)2 AccumuloProxy (org.apache.accumulo.proxy.thrift.AccumuloProxy)2