org.apache.accumulo.core.client.impl
Class ConnectorImpl

java.lang.Object
  extended by org.apache.accumulo.core.client.Connector
      extended by org.apache.accumulo.core.client.impl.ConnectorImpl

public class ConnectorImpl
extends Connector


Constructor Summary
ConnectorImpl(Instance instance, Credentials cred)
           
 
Method Summary
 BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, BatchWriterConfig config)
           
 BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, long maxMemory, long maxLatency, int maxWriteThreads)
          Deprecated. 
 BatchScanner createBatchScanner(String tableName, Authorizations authorizations, int numQueryThreads)
          Factory method to create a BatchScanner connected to Accumulo.
 BatchWriter createBatchWriter(String tableName, BatchWriterConfig config)
          Factory method to create a BatchWriter connected to Accumulo.
 BatchWriter createBatchWriter(String tableName, long maxMemory, long maxLatency, int maxWriteThreads)
          Deprecated. 
 ConditionalWriter createConditionalWriter(String tableName, ConditionalWriterConfig config)
          Factory method to create a ConditionalWriter connected to Accumulo.
 MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config)
          Factory method to create a Multi-Table BatchWriter connected to Accumulo.
 MultiTableBatchWriter createMultiTableBatchWriter(long maxMemory, long maxLatency, int maxWriteThreads)
          Deprecated. 
 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.
 NamespaceOperations namespaceOperations()
          Retrieves a NamespaceOperations object to perform namespace functions, such as create and delete.
 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

ConnectorImpl

public ConnectorImpl(Instance instance,
                     Credentials cred)
              throws AccumuloException,
                     AccumuloSecurityException
Throws:
AccumuloException
AccumuloSecurityException
Method Detail

getInstance

public Instance getInstance()
Description copied from class: Connector
Accessor method for internal instance object.

Specified by:
getInstance in class Connector
Returns:
the internal instance object

createBatchScanner

public BatchScanner createBatchScanner(String tableName,
                                       Authorizations authorizations,
                                       int numQueryThreads)
                                throws TableNotFoundException
Description copied from class: Connector
Factory method to create a BatchScanner connected to Accumulo.

Specified by:
createBatchScanner in class Connector
Parameters:
tableName - the name of the table to query
authorizations - 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
Returns:
BatchScanner object for configuring and querying
Throws:
TableNotFoundException - when the specified table doesn't exist

createBatchDeleter

@Deprecated
public BatchDeleter createBatchDeleter(String tableName,
                                                  Authorizations authorizations,
                                                  int numQueryThreads,
                                                  long maxMemory,
                                                  long maxLatency,
                                                  int maxWriteThreads)
                                throws TableNotFoundException
Deprecated. 

Description copied from class: Connector
Factory method to create a BatchDeleter connected to Accumulo.

Specified by:
createBatchDeleter in class Connector
Parameters:
tableName - the name of the table to query and delete from
authorizations - 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
maxMemory - size in bytes of the maximum memory to batch before writing
maxLatency - size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
maxWriteThreads - the maximum number of threads to use for writing data to the tablet servers
Returns:
BatchDeleter object for configuring and deleting
Throws:
TableNotFoundException - when the specified table doesn't exist

createBatchDeleter

public BatchDeleter createBatchDeleter(String tableName,
                                       Authorizations authorizations,
                                       int numQueryThreads,
                                       BatchWriterConfig config)
                                throws TableNotFoundException
Specified by:
createBatchDeleter in class Connector
Parameters:
tableName - the name of the table to query and delete from
authorizations - 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
config - configuration used to create batch writer
Returns:
BatchDeleter object for configuring and deleting
Throws:
TableNotFoundException

createBatchWriter

@Deprecated
public BatchWriter createBatchWriter(String tableName,
                                                long maxMemory,
                                                long maxLatency,
                                                int maxWriteThreads)
                              throws TableNotFoundException
Deprecated. 

Description copied from class: Connector
Factory method to create a BatchWriter connected to Accumulo.

Specified by:
createBatchWriter in class Connector
Parameters:
tableName - the name of the table to insert data into
maxMemory - size in bytes of the maximum memory to batch before writing
maxLatency - time in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
maxWriteThreads - the maximum number of threads to use for writing data to the tablet servers
Returns:
BatchWriter object for configuring and writing data to
Throws:
TableNotFoundException - when the specified table doesn't exist

createBatchWriter

public BatchWriter createBatchWriter(String tableName,
                                     BatchWriterConfig config)
                              throws TableNotFoundException
Description copied from class: Connector
Factory method to create a BatchWriter connected to Accumulo.

Specified by:
createBatchWriter in class Connector
Parameters:
tableName - the name of the table to insert data into
config - configuration used to create batch writer
Returns:
BatchWriter object for configuring and writing data to
Throws:
TableNotFoundException

createMultiTableBatchWriter

@Deprecated
public MultiTableBatchWriter createMultiTableBatchWriter(long maxMemory,
                                                                    long maxLatency,
                                                                    int maxWriteThreads)
Deprecated. 

Description copied from class: Connector
Factory method to create a Multi-Table BatchWriter connected to Accumulo. Multi-table batch writers can queue data for multiple tables, which is good for ingesting data into multiple tables from the same source

Specified by:
createMultiTableBatchWriter in class Connector
Parameters:
maxMemory - size in bytes of the maximum memory to batch before writing
maxLatency - size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
maxWriteThreads - the maximum number of threads to use for writing data to the tablet servers
Returns:
MultiTableBatchWriter object for configuring and writing data to

createMultiTableBatchWriter

public MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config)
Description copied from class: Connector
Factory method to create a Multi-Table BatchWriter connected to Accumulo. Multi-table batch writers can queue data for multiple tables. Also data for multiple tables can be sent to a server in a single batch. Its an efficient way to ingest data into multiple tables from a single process.

Specified by:
createMultiTableBatchWriter in class Connector
Parameters:
config - configuration used to create multi-table batch writer
Returns:
MultiTableBatchWriter object for configuring and writing data to

createConditionalWriter

public ConditionalWriter createConditionalWriter(String tableName,
                                                 ConditionalWriterConfig config)
                                          throws TableNotFoundException
Description copied from class: Connector
Factory method to create a ConditionalWriter connected to Accumulo.

Specified by:
createConditionalWriter in class Connector
Parameters:
tableName - the name of the table to query data from
config - configuration used to create conditional writer
Returns:
ConditionalWriter object for writing ConditionalMutations
Throws:
TableNotFoundException - when the specified table doesn't exist

createScanner

public Scanner createScanner(String tableName,
                             Authorizations authorizations)
                      throws TableNotFoundException
Description copied from class: Connector
Factory method to create a Scanner connected to Accumulo.

Specified by:
createScanner in class Connector
Parameters:
tableName - the name of the table to query data from
authorizations - 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.
Returns:
Scanner object for configuring and querying data with
Throws:
TableNotFoundException - when the specified table doesn't exist

whoami

public String whoami()
Description copied from class: Connector
Get the current user for this connector

Specified by:
whoami in class Connector
Returns:
the user name

tableOperations

public TableOperations tableOperations()
Description copied from class: Connector
Retrieves a TableOperations object to perform table functions, such as create and delete.

Specified by:
tableOperations in class Connector
Returns:
an object to manipulate tables

namespaceOperations

public NamespaceOperations namespaceOperations()
Description copied from class: Connector
Retrieves a NamespaceOperations object to perform namespace functions, such as create and delete.

Specified by:
namespaceOperations in class Connector
Returns:
an object to manipulate namespaces

securityOperations

public SecurityOperations securityOperations()
Description copied from class: Connector
Retrieves a SecurityOperations object to perform user security operations, such as creating users.

Specified by:
securityOperations in class Connector
Returns:
an object to modify users and permissions

instanceOperations

public InstanceOperations instanceOperations()
Description copied from class: Connector
Retrieves an InstanceOperations object to modify instance configuration.

Specified by:
instanceOperations in class Connector
Returns:
an object to modify instance configuration


Copyright © 2015 Apache Accumulo Project. All rights reserved.