Package org.apache.accumulo.server
Class ServerContext
- java.lang.Object
-
- org.apache.accumulo.core.clientImpl.ClientContext
-
- org.apache.accumulo.server.ServerContext
-
- All Implemented Interfaces:
AutoCloseable
,AccumuloClient
public class ServerContext extends ClientContext
Provides a server context for Accumulo server components that operate with the system credentials and have access to the system files and configuration.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.accumulo.core.clientImpl.ClientContext
ClientContext.ClientBuilderImpl<T extends Object>
-
Nested classes/interfaces inherited from interface org.apache.accumulo.core.client.AccumuloClient
AccumuloClient.AuthenticationArgs<T extends Object>, AccumuloClient.ClientFactory<T extends Object>, AccumuloClient.ConnectionOptions<T extends Object>, AccumuloClient.FromOptions<T extends Object>, AccumuloClient.InstanceArgs<T extends Object>, AccumuloClient.PropertyOptions<T extends Object>, AccumuloClient.SaslOptions<T extends Object>, AccumuloClient.SslOptions<T extends Object>
-
-
Constructor Summary
Constructors Constructor Description ServerContext(SiteConfiguration siteConfig)
-
Method Summary
-
Methods inherited from class org.apache.accumulo.core.clientImpl.ClientContext
_getTableIdDetectNamespaceNotFound, clearTableListCache, close, createBatchDeleter, createBatchDeleter, createBatchScanner, createBatchScanner, createBatchScanner, createBatchWriter, createBatchWriter, createConditionalWriter, createConditionalWriter, createMultiTableBatchWriter, createMultiTableBatchWriter, createScanner, createScanner, executeCleanupTask, getAuthenticationToken, getBatchWriterConfig, getClientSslParams, getClientTimeoutInMillis, getConditionalWriterConfig, getCredentials, getHadoopConf, getInstanceID, getInstanceName, getManagerLocations, getManagerLocations, getNamespaceId, getPrincipal, getPrintableTableInfoFromId, getPrintableTableInfoFromName, getProperties, getRootTabletLocation, getScanServers, getScanServerSelector, getTableId, getTableIdToNameMap, getTableName, getTableNameToIdMap, getTableState, getTableState, getTransportPool, getZooCache, getZooKeeperRoot, getZooKeepers, getZooKeepersSessionTimeOut, instanceOperations, namespaceOperations, properties, replicationOperations, requireNotDeleted, requireNotOffline, requireTableExists, rpcCreds, securityOperations, setCredentials, submitScannerReadAheadTask, tableNodeExists, tableOperations, threadPools, token, verifyInstanceId, whoami
-
-
-
-
Constructor Detail
-
ServerContext
public ServerContext(SiteConfiguration siteConfig)
-
-
Method Detail
-
initialize
public static ServerContext initialize(SiteConfiguration siteConfig, String instanceName, InstanceId instanceID)
Used during initialization to set the instance name and ID.
-
override
public static ServerContext override(SiteConfiguration siteConfig, String instanceName, String zooKeepers, int zkSessionTimeOut)
Override properties for testing
-
getInstanceID
public InstanceId getInstanceID()
- Overrides:
getInstanceID
in classClientContext
-
getSiteConfiguration
public SiteConfiguration getSiteConfiguration()
-
getConfiguration
public AccumuloConfiguration getConfiguration()
- Overrides:
getConfiguration
in classClientContext
-
getTableConfiguration
public TableConfiguration getTableConfiguration(TableId id)
-
getNamespaceConfiguration
public NamespaceConfiguration getNamespaceConfiguration(NamespaceId namespaceId)
-
getDefaultConfiguration
public DefaultConfiguration getDefaultConfiguration()
-
getServerDirs
public ServerDirs getServerDirs()
-
getVolumeManager
public VolumeManager getVolumeManager()
-
getZooReader
public ZooReader getZooReader()
- Overrides:
getZooReader
in classClientContext
-
getZooReaderWriter
public ZooReaderWriter getZooReaderWriter()
-
getServerSslParams
public SslConnectionParams getServerSslParams()
Retrieve the SSL/TLS configuration for starting up a listening service
-
getSaslParams
public SaslServerConnectionParams getSaslParams()
- Overrides:
getSaslParams
in classClientContext
-
getThriftServerType
public ThriftServerType getThriftServerType()
Determine the type of Thrift server to instantiate given the server's configuration.- Returns:
- A
ThriftServerType
value to denote the type of Thrift server to construct
-
getSecretManager
public AuthenticationTokenSecretManager getSecretManager()
-
getTableManager
public TableManager getTableManager()
-
getUniqueNameAllocator
public UniqueNameAllocator getUniqueNameAllocator()
-
getCryptoFactory
public CryptoServiceFactory getCryptoFactory()
-
getAmple
public Ample getAmple()
- Overrides:
getAmple
in classClientContext
-
getVolumeReplacements
public List<Pair<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path>> getVolumeReplacements()
-
ensureDataVersionCompatible
public static void ensureDataVersionCompatible(int dataVersion)
Check to see if this version of Accumulo can run against or upgrade the passed in data version.
-
waitForZookeeperAndHdfs
public void waitForZookeeperAndHdfs()
-
init
public void init(String application)
Wait for ZK and hdfs, check data version and some properties, and start thread to monitor swappiness. Should only be called once during server start up.
-
getScheduledExecutor
public ScheduledThreadPoolExecutor getScheduledExecutor()
-
getPropStore
public PropStore getPropStore()
-
getTransportPoolMaxAgeMillis
protected long getTransportPoolMaxAgeMillis()
- Overrides:
getTransportPoolMaxAgeMillis
in classClientContext
-
getSecurityOperation
public AuditedSecurityOperation getSecurityOperation()
-
-