public class BigtableSession extends Object implements Closeable
Encapsulates the creation of Bigtable Grpc services.
The following functionality is handled by this class:
Constructor and Description |
---|
BigtableSession(BigtableOptions opts)
Constructor for BigtableSession.
|
Modifier and Type | Method and 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.
|
static ChannelPool |
createChannelPool(String host,
BigtableOptions options)
Create a new
ChannelPool , with auth headers. |
static ChannelPool |
createChannelPool(String host,
BigtableOptions options,
int count)
Create a new
ChannelPool , with auth headers. |
protected ChannelPool |
createChannelPool(String hostString,
int count)
Create a new
ChannelPool , with auth headers. |
protected ChannelPool |
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.
|
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 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 ChannelPool createChannelPool(String hostString, int count) throws IOException
ChannelPool
, with auth headers.hostString
- a String
object.ChannelPool
object.IOException
- if any.protected ChannelPool 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 ChannelPool 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 ChannelPool 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 Closeable
close
in interface AutoCloseable
IOException
public BigtableOptions getOptions()
Getter for the field options
.
BigtableOptions
object.