public class ClientContext extends Object implements AccumuloClient
Modifier and Type | Class and Description |
---|---|
static class |
ClientContext.ClientBuilderImpl<T> |
AccumuloClient.AuthenticationArgs<T>, AccumuloClient.ClientFactory<T>, AccumuloClient.ConnectionOptions<T>, AccumuloClient.FromOptions<T>, AccumuloClient.InstanceArgs<T>, AccumuloClient.PropertyOptions<T>, AccumuloClient.SaslOptions<T>, AccumuloClient.SslOptions<T>
Constructor and Description |
---|
ClientContext(ClientInfo info) |
ClientContext(ClientInfo info,
AccumuloConfiguration serverConf) |
ClientContext(Properties clientProperties) |
ClientContext(SingletonReservation reservation,
ClientInfo info) |
ClientContext(SingletonReservation reservation,
ClientInfo info,
AccumuloConfiguration serverConf) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleans up any resources created by an AccumuloClient like threads and sockets.
|
BatchDeleter |
createBatchDeleter(String tableName,
Authorizations authorizations,
int numQueryThreads)
Factory method to create BatchDeleter.
|
BatchDeleter |
createBatchDeleter(String tableName,
Authorizations authorizations,
int numQueryThreads,
BatchWriterConfig config)
Factory method to create BatchDeleter
|
BatchScanner |
createBatchScanner(String tableName)
Factory method to create a BatchScanner with all of user's authorizations and the number of
query threads configured when AccumuloClient was created.
|
BatchScanner |
createBatchScanner(String tableName,
Authorizations authorizations)
Factory method to create a BatchScanner connected to Accumulo.
|
BatchScanner |
createBatchScanner(String tableName,
Authorizations authorizations,
int numQueryThreads)
Factory method to create a BatchScanner connected to Accumulo.
|
BatchWriter |
createBatchWriter(String tableName)
Factory method to create a BatchWriter.
|
BatchWriter |
createBatchWriter(String tableName,
BatchWriterConfig config)
Factory method to create a BatchWriter connected to Accumulo.
|
ConditionalWriter |
createConditionalWriter(String tableName,
ConditionalWriterConfig config)
Factory method to create a ConditionalWriter connected to Accumulo.
|
MultiTableBatchWriter |
createMultiTableBatchWriter()
Factory method to create a Multi-Table BatchWriter.
|
MultiTableBatchWriter |
createMultiTableBatchWriter(BatchWriterConfig config)
Factory method to create a Multi-Table BatchWriter connected to Accumulo.
|
Scanner |
createScanner(String tableName)
Factory method to create a Scanner with all of the user's authorizations.
|
Scanner |
createScanner(String tableName,
Authorizations authorizations)
Factory method to create a Scanner connected to Accumulo.
|
AuthenticationToken |
getAuthenticationToken() |
BatchWriterConfig |
getBatchWriterConfig() |
SslConnectionParams |
getClientSslParams()
Retrieve SSL/TLS configuration to initiate an RPC connection to a server
|
long |
getClientTimeoutInMillis()
Retrieve the universal RPC client timeout from the configuration
|
AccumuloConfiguration |
getConfiguration()
Retrieve the configuration used to construct this context
|
Credentials |
getCredentials()
Retrieve the credentials used to construct this context
|
Instance |
getDeprecatedInstance()
Deprecated.
since 2.0.0
|
String |
getInstanceID()
Returns a unique string that identifies this instance of accumulo.
|
String |
getInstanceName()
Returns the instance name given at system initialization time.
|
List<String> |
getMasterLocations()
Returns the location(s) of the accumulo master and any redundant servers.
|
String |
getPrincipal() |
Properties |
getProperties() |
String |
getRootTabletLocation()
Returns the location of the tablet server that is serving the root tablet.
|
SaslConnectionParams |
getSaslParams()
Retrieve SASL configuration to initiate an RPC connection to a server
|
ZooCache |
getZooCache() |
String |
getZooKeeperRoot() |
String |
getZooKeepers()
Returns a comma-separated list of zookeeper servers the instance is using.
|
int |
getZooKeepersSessionTimeOut()
Returns the zookeeper connection timeout.
|
InstanceOperations |
instanceOperations()
Retrieves an InstanceOperations object to modify instance configuration.
|
NamespaceOperations |
namespaceOperations()
Retrieves a NamespaceOperations object to perform namespace functions, such as create and
delete.
|
Properties |
properties() |
ReplicationOperations |
replicationOperations()
Retrieves a ReplicationOperations object to manage replication configuration.
|
TCredentials |
rpcCreds()
Serialize the credentials just before initiating the RPC call
|
SecurityOperations |
securityOperations()
Retrieves a SecurityOperations object to perform user security operations, such as creating
users.
|
void |
setCredentials(Credentials newCredentials)
Update the credentials in the current context after changing the current user's password or
other auth token
|
TableOperations |
tableOperations()
Retrieves a TableOperations object to perform table functions, such as create and delete.
|
AuthenticationToken |
token() |
String |
whoami()
Get the current user for this AccumuloClient
|
public ClientContext(Properties clientProperties)
public ClientContext(SingletonReservation reservation, ClientInfo info)
public ClientContext(ClientInfo info)
public ClientContext(ClientInfo info, AccumuloConfiguration serverConf)
public ClientContext(SingletonReservation reservation, ClientInfo info, AccumuloConfiguration serverConf)
@Deprecated public Instance getDeprecatedInstance()
public Credentials getCredentials()
public String getPrincipal()
public AuthenticationToken getAuthenticationToken()
public Properties getProperties()
public void setCredentials(Credentials newCredentials)
public AccumuloConfiguration getConfiguration()
public long getClientTimeoutInMillis()
public SslConnectionParams getClientSslParams()
public SaslConnectionParams getSaslParams()
public BatchWriterConfig getBatchWriterConfig()
public TCredentials rpcCreds()
public String getRootTabletLocation()
public List<String> getMasterLocations()
public String getInstanceID()
getInstanceID
in interface AccumuloClient
public String getZooKeeperRoot()
public String getInstanceName()
public String getZooKeepers()
public int getZooKeepersSessionTimeOut()
public ZooCache getZooCache()
public BatchScanner createBatchScanner(String tableName, Authorizations authorizations, int numQueryThreads) throws TableNotFoundException
AccumuloClient
createBatchScanner
in interface AccumuloClient
tableName
- the name of the table to queryauthorizations
- A set of authorization labels that will be checked against the column visibility of
each key in order to filter data. The authorizations passed in must be a subset of the
accumulo user's set of authorizations. If the accumulo user has authorizations (A1,
A2) and authorizations (A2, A3) are passed, then an exception will be thrown.numQueryThreads
- the number of concurrent threads to spawn for queryingTableNotFoundException
- when the specified table doesn't existpublic BatchScanner createBatchScanner(String tableName, Authorizations authorizations) throws TableNotFoundException
AccumuloClient
createBatchScanner
in interface AccumuloClient
tableName
- the name of the table to queryauthorizations
- A set of authorization labels that will be checked against the column visibility of
each key in order to filter data. The authorizations passed in must be a subset of the
accumulo user's set of authorizations. If the accumulo user has authorizations (A1,
A2) and authorizations (A2, A3) are passed, then an exception will be thrown.TableNotFoundException
- when the specified table doesn't existpublic BatchScanner createBatchScanner(String tableName) throws TableNotFoundException, AccumuloSecurityException, AccumuloException
AccumuloClient
createBatchScanner
in interface AccumuloClient
tableName
- the name of the table to queryTableNotFoundException
- when the specified table doesn't existAccumuloSecurityException
AccumuloException
public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, BatchWriterConfig config) throws TableNotFoundException
AccumuloClient
createBatchDeleter
in interface AccumuloClient
tableName
- the name of the table to query and delete fromauthorizations
- A set of authorization labels that will be checked against the column visibility of
each key in order to filter data. The authorizations passed in must be a subset of the
accumulo user's set of authorizations. If the accumulo user has authorizations (A1,
A2) and authorizations (A2, A3) are passed, then an exception will be thrown.numQueryThreads
- the number of concurrent threads to spawn for queryingconfig
- configuration used to create batch writer. This config takes precedence. Any unset
values will be merged with config set when the AccumuloClient was created. If no
config was set during AccumuloClient creation, BatchWriterConfig defaults will be
used.TableNotFoundException
public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads) throws TableNotFoundException
AccumuloClient
createBatchDeleter
in interface AccumuloClient
tableName
- the name of the table to query and delete fromauthorizations
- A set of authorization labels that will be checked against the column visibility of
each key in order to filter data. The authorizations passed in must be a subset of the
accumulo user's set of authorizations. If the accumulo user has authorizations (A1,
A2) and authorizations (A2, A3) are passed, then an exception will be thrown.numQueryThreads
- the number of concurrent threads to spawn for queryingTableNotFoundException
- if table not foundpublic BatchWriter createBatchWriter(String tableName, BatchWriterConfig config) throws TableNotFoundException
AccumuloClient
createBatchWriter
in interface AccumuloClient
tableName
- the name of the table to insert data intoconfig
- configuration used to create batch writer. This config will take precedence. Any unset
values will merged with config set when the AccumuloClient was created. If no config
was set during AccumuloClient creation, BatchWriterConfig defaults will be used.TableNotFoundException
public BatchWriter createBatchWriter(String tableName) throws TableNotFoundException
AccumuloClient
createBatchWriter
in interface AccumuloClient
tableName
- the name of the table to insert data intoTableNotFoundException
- if table not foundpublic MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config)
AccumuloClient
createMultiTableBatchWriter
in interface AccumuloClient
config
- configuration used to create multi-table batch writer. This config will take
precedence. Any unset values will merged with config set when the AccumuloClient was
created. If no config was set during AccumuloClient creation, BatchWriterConfig
defaults will be used.public MultiTableBatchWriter createMultiTableBatchWriter()
AccumuloClient
createMultiTableBatchWriter
in interface AccumuloClient
public ConditionalWriter createConditionalWriter(String tableName, ConditionalWriterConfig config) throws TableNotFoundException
AccumuloClient
createConditionalWriter
in interface AccumuloClient
tableName
- the name of the table to query data fromconfig
- configuration used to create conditional writerTableNotFoundException
- when the specified table doesn't existpublic Scanner createScanner(String tableName, Authorizations authorizations) throws TableNotFoundException
AccumuloClient
createScanner
in interface AccumuloClient
tableName
- the name of the table to query data fromauthorizations
- A set of authorization labels that will be checked against the column visibility of
each key in order to filter data. The authorizations passed in must be a subset of the
accumulo user's set of authorizations. If the accumulo user has authorizations (A1,
A2) and authorizations (A2, A3) are passed, then an exception will be thrown.TableNotFoundException
- when the specified table doesn't existIsolatedScanner
public Scanner createScanner(String tableName) throws TableNotFoundException, AccumuloSecurityException, AccumuloException
AccumuloClient
createScanner
in interface AccumuloClient
tableName
- the name of the table to query data fromTableNotFoundException
- when the specified table doesn't existAccumuloSecurityException
AccumuloException
IsolatedScanner
public String whoami()
AccumuloClient
whoami
in interface AccumuloClient
public TableOperations tableOperations()
AccumuloClient
tableOperations
in interface AccumuloClient
public NamespaceOperations namespaceOperations()
AccumuloClient
namespaceOperations
in interface AccumuloClient
public SecurityOperations securityOperations()
AccumuloClient
securityOperations
in interface AccumuloClient
public InstanceOperations instanceOperations()
AccumuloClient
instanceOperations
in interface AccumuloClient
public ReplicationOperations replicationOperations()
AccumuloClient
replicationOperations
in interface AccumuloClient
public Properties properties()
properties
in interface AccumuloClient
Properties
used to create client except 'auth.token'public AuthenticationToken token()
public void close()
AccumuloClient
close
in interface AutoCloseable
close
in interface AccumuloClient
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.