Closeable
, AutoCloseable
public class BigtableSession extends Object implements Closeable
Encapsulates the creation of Bigtable Grpc services.
The following functionality is handled by this class:
Constructor | Description |
---|---|
BigtableSession(BigtableOptions opts) |
Constructor for BigtableSession.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
AsyncExecutor |
createAsyncExecutor() |
createAsyncExecutor.
|
BulkMutation |
createBulkMutation(BigtableTableName tableName) |
createBulkMutation.
|
BulkMutation |
createBulkMutation(BigtableTableName tableName,
AsyncExecutor asyncExecutor) |
Deprecated.
use
createBulkMutation(BigtableTableName) instead. |
BulkRead |
createBulkRead(BigtableTableName tableName) |
createBulkRead.
|
protected io.grpc.ManagedChannel |
createChannelPool(ChannelPool.ChannelFactory channelFactory,
int count) |
Create a new
ChannelPool , with auth headers. |
protected io.grpc.ManagedChannel |
createChannelPool(String hostString,
int count) |
Create a new
ChannelPool , with auth headers. |
static io.grpc.ManagedChannel |
createChannelPool(String host,
BigtableOptions options) |
Create a new
ChannelPool , with auth headers. |
static io.grpc.ManagedChannel |
createChannelPool(String host,
BigtableOptions options,
int count) |
Create a new
ChannelPool , with auth headers. |
static BigtableInstanceClient |
createInstanceClient(BigtableOptions options) |
Create a
BigtableInstanceClient . |
protected io.grpc.ManagedChannel |
createManagedPool(String host,
int channelCount) |
Create a new
ChannelPool , with auth headers, that
will be cleaned up when the connection closes. |
static io.grpc.ManagedChannel |
createNettyChannel(String host,
BigtableOptions options,
io.grpc.ClientInterceptor... interceptors) |
createNettyChannel.
|
BigtableDataClientWrapper |
getClientWrapper() |
Getter for the field
clientWrapper . |
BigtableClusterName |
getClusterName() |
Snapshot operations need various aspects of a
BigtableClusterName . |
BigtableDataClient |
getDataClient() |
Getter for the field
dataClient . |
BigtableInstanceClient |
getInstanceAdminClient() |
Getter for the field
instanceAdminClient . |
BigtableOptions |
getOptions() |
Getter for the field
options . |
BigtableTableAdminClient |
getTableAdminClient() |
Getter for the field
tableAdminClient . |
public BigtableSession(BigtableOptions opts) throws IOException
Constructor for BigtableSession.
opts
- a BigtableOptions
object.IOException
- if any.public BigtableClusterName getClusterName() throws IOException
BigtableClusterName
. This method gets a
clusterId from either a lookup (projectId and instanceId translate to a single clusterId when
an instance has only one cluster).IOException
public BigtableDataClient getDataClient()
Getter for the field dataClient
.
BigtableDataClient
object.public BigtableDataClientWrapper getClientWrapper()
Getter for the field clientWrapper
.
BigtableDataClientWrapper
object.public AsyncExecutor createAsyncExecutor()
createAsyncExecutor.
AsyncExecutor
object.@Deprecated public BulkMutation createBulkMutation(BigtableTableName tableName, AsyncExecutor asyncExecutor)
createBulkMutation(BigtableTableName)
instead.createBulkMutation.
tableName
- a BigtableTableName
object.asyncExecutor
- a AsyncExecutor
object.BulkMutation
object.public BulkMutation createBulkMutation(BigtableTableName tableName)
createBulkMutation.
tableName
- a BigtableTableName
object.BulkMutation
object.public BulkRead createBulkRead(BigtableTableName tableName)
createBulkRead.
tableName
- a BigtableTableName
object.BulkRead
object.public BigtableTableAdminClient getTableAdminClient() throws IOException
Getter for the field tableAdminClient
.
BigtableTableAdminClient
object.IOException
- if any.public BigtableInstanceClient getInstanceAdminClient() throws IOException
Getter for the field instanceAdminClient
.
BigtableInstanceClient
object.IOException
- if any.protected io.grpc.ManagedChannel createChannelPool(String hostString, int count) throws IOException
ChannelPool
, with auth headers.hostString
- a String
object.ChannelPool
object.IOException
- if any.protected io.grpc.ManagedChannel createChannelPool(ChannelPool.ChannelFactory channelFactory, int count) throws IOException
ChannelPool
, with auth headers. This
method allows users to override the default implementation with their own.channelFactory
- a ChannelPool.ChannelFactory
object.count
- The number of channels in the pool.ChannelPool
object.IOException
- if any.protected io.grpc.ManagedChannel createManagedPool(String host, int channelCount) throws IOException
ChannelPool
, with auth headers, that
will be cleaned up when the connection closes.host
- a String
object.ChannelPool
object.IOException
- if any.public static BigtableInstanceClient createInstanceClient(BigtableOptions options) throws IOException, GeneralSecurityException
BigtableInstanceClient
. BigtableSession
objects assume that
BigtableOptions
have a project and instance. A BigtableInstanceClient
does not
require project id or instance id, so BigtableOptions.getDefaultOptions()
may be used
if there are no service account credentials settings.BigtableInstanceClient
IOException
GeneralSecurityException
public static io.grpc.ManagedChannel createChannelPool(String host, BigtableOptions options) throws IOException, GeneralSecurityException
ChannelPool
, with auth headers.host
- a String
object.options
- a BigtableOptions
object.ChannelPool
object.IOException
- if any.GeneralSecurityException
public static io.grpc.ManagedChannel createChannelPool(String host, BigtableOptions options, int count) throws IOException, GeneralSecurityException
ChannelPool
, with auth headers.host
- a String
object specifying the host to connect to.options
- a BigtableOptions
object with the credentials, retry and other connection options.count
- an int defining the number of channels to createChannelPool
object.IOException
- if any.GeneralSecurityException
public static io.grpc.ManagedChannel createNettyChannel(String host, BigtableOptions options, io.grpc.ClientInterceptor... interceptors) throws SSLException
createNettyChannel.
host
- a String
object.options
- a BigtableOptions
object.ManagedChannel
object.SSLException
- if any.public void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
public BigtableOptions getOptions()
Getter for the field options
.
BigtableOptions
object.