/** * <p>Getter for the field <code>instanceAdminClient</code>.</p> * * @return a {@link com.google.cloud.bigtable.grpc.BigtableInstanceClient} object. * @throws java.io.IOException if any. */ public synchronized BigtableInstanceClient getInstanceAdminClient() throws IOException { if (instanceAdminClient == null) { ManagedChannel channel = createManagedPool(options.getAdminHost(), 1); instanceAdminClient = new BigtableInstanceGrpcClient(channel); } return instanceAdminClient; }
private ManagedChannel getDataChannelPool() throws IOException { String host = options.getDataHost(); int channelCount = options.getChannelCount(); if (options.useCachedChannel()) { synchronized (BigtableSession.class) { // TODO: Ensure that the host and channelCount are the same. if (cachedDataChannelPool == null) { cachedDataChannelPool = createChannelPool(host, channelCount); } return cachedDataChannelPool; } } return createManagedPool(host, channelCount); }
/** * <p>Getter for the field <code>tableAdminClient</code>.</p> * * @return a {@link com.google.cloud.bigtable.grpc.BigtableTableAdminClient} object. * @throws java.io.IOException if any. */ public synchronized BigtableTableAdminClient getTableAdminClient() throws IOException { if (tableAdminClient == null) { ManagedChannel channel = createManagedPool(options.getAdminHost(), 1); tableAdminClient = new BigtableTableAdminGrpcClient(channel, BigtableSessionSharedThreadPools.getInstance().getRetryExecutor(), options); } return tableAdminClient; }