|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.client.Connector
public class Connector
Connector connects to an Accumulo instance and allows the user to request readers and writers for the instance as well as various objects that permit administrative operations. The Connector enforces security on the client side by forcing all API calls to be accompanied by user credentials.
Constructor Summary | |
---|---|
Connector()
Deprecated. Not for client use |
|
Connector(Instance instance,
String user,
byte[] password)
Deprecated. Not for client use |
Method Summary | |
---|---|
BatchDeleter |
createBatchDeleter(String tableName,
Authorizations authorizations,
int numQueryThreads,
long maxMemory,
long maxLatency,
int maxWriteThreads)
Factory method to create a BatchDeleter connected to Accumulo. |
BatchScanner |
createBatchScanner(String tableName,
Authorizations authorizations,
int numQueryThreads)
Factory method to create a BatchScanner connected to Accumulo. |
BatchWriter |
createBatchWriter(String tableName,
long maxMemory,
long maxLatency,
int maxWriteThreads)
Factory method to create a BatchWriter connected to Accumulo. |
MultiTableBatchWriter |
createMultiTableBatchWriter(long maxMemory,
long maxLatency,
int maxWriteThreads)
Factory method to create a Multi-Table BatchWriter connected to Accumulo. |
Scanner |
createScanner(String tableName,
Authorizations authorizations)
Factory method to create a Scanner connected to Accumulo. |
Instance |
getInstance()
Accessor method for internal instance object. |
InstanceOperations |
instanceOperations()
Retrieves an InstanceOperations object to modify instance configuration. |
SecurityOperations |
securityOperations()
Retrieves a SecurityOperations object to perform user security operations, such as creating users. |
TableOperations |
tableOperations()
Retrieves a TableOperations object to perform table functions, such as create and delete. |
String |
whoami()
Get the current user for this connector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Connector(Instance instance, String user, byte[] password) throws AccumuloException, AccumuloSecurityException
Instance
instance
- contains the precise connection information to identify the running accumulo instanceuser
- a valid accumulo userpassword
- the password for the user
AccumuloException
- when a generic exception occurs
AccumuloSecurityException
- when a user's credentials are invalidInstance.getConnector(String user, byte[] password)
public Connector()
Instance.getConnector(String user, byte[] password)
Method Detail |
---|
public BatchScanner createBatchScanner(String tableName, Authorizations authorizations, int numQueryThreads) throws TableNotFoundException
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 querying
TableNotFoundException
- when the specified table doesn't existpublic BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, long maxMemory, long maxLatency, int maxWriteThreads) throws TableNotFoundException
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 queryingmaxMemory
- size in bytes of the maximum memory to batch before writingmaxLatency
- size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writingmaxWriteThreads
- the maximum number of threads to use for writing data to the tablet servers
TableNotFoundException
- when the specified table doesn't existpublic BatchWriter createBatchWriter(String tableName, long maxMemory, long maxLatency, int maxWriteThreads) throws TableNotFoundException
tableName
- the name of the table to insert data intomaxMemory
- size in bytes of the maximum memory to batch before writingmaxLatency
- time in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writingmaxWriteThreads
- the maximum number of threads to use for writing data to the tablet servers
TableNotFoundException
- when the specified table doesn't existpublic MultiTableBatchWriter createMultiTableBatchWriter(long maxMemory, long maxLatency, int maxWriteThreads)
maxMemory
- size in bytes of the maximum memory to batch before writingmaxLatency
- size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writingmaxWriteThreads
- the maximum number of threads to use for writing data to the tablet servers
public Scanner createScanner(String tableName, Authorizations authorizations) throws TableNotFoundException
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 existpublic Instance getInstance()
public String whoami()
public TableOperations tableOperations()
public SecurityOperations securityOperations()
public InstanceOperations instanceOperations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |