if (session == null) { try { options = BigtableOptionsFactory.fromConfiguration(CONFIG); session = new BigtableSession(options);
bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY, null); if (appProfileId != null) { getHost(configuration, BIGTABLE_HOST_KEY, BIGTABLE_DATA_HOST_DEFAULT, "API Data")); bigtableOptionsBuilder.setAdminHost(getHost( configuration, BIGTABLE_ADMIN_HOST_KEY, BIGTABLE_ADMIN_HOST_DEFAULT, "Admin")); configuration.getBoolean(BIGTABLE_USE_PLAINTEXT_NEGOTIATION, false)); setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder);
private static void setChannelOptions(Configuration configuration, BigtableOptions.Builder builder) throws IOException { setCredentialOptions(builder, configuration); builder.setRetryOptions(createRetryOptions(configuration)); int channelCount = configuration.getInt( BIGTABLE_DATA_CHANNEL_COUNT_KEY, BigtableOptions.BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT); builder.setDataChannelCount(channelCount); // This is primarily used by Dataflow where connections open and close often. This is a // performance optimization that will reduce the cost to open connections. boolean useCachedDataPool = configuration.getBoolean(BIGTABLE_USE_CACHED_DATA_CHANNEL_POOL, false); builder.setUseCachedDataPool(useCachedDataPool); // This information is in addition to bigtable-client-core version, and jdk version. StringBuilder agentBuilder = new StringBuilder(); agentBuilder.append("hbase-").append(VersionInfo.getVersion()); String customUserAgent = configuration.get(CUSTOM_USER_AGENT_KEY); if (customUserAgent != null) { agentBuilder.append(',').append(customUserAgent); } builder.setUserAgent(agentBuilder.toString()); }
bigtableOptionsBuilder.setProjectId(getValue(configuration, PROJECT_ID_KEY, "Project ID")); bigtableOptionsBuilder.setInstanceId(getValue(configuration, INSTANCE_ID_KEY, "Instance ID")); String appProfileId = configuration.get(APP_PROFILE_ID_KEY, null); if (appProfileId != null) { getHost(configuration, BIGTABLE_HOST_KEY, BIGTABLE_DATA_HOST_DEFAULT, "API Data")); bigtableOptionsBuilder.setAdminHost(getHost( configuration, BIGTABLE_ADMIN_HOST_KEY, BIGTABLE_ADMIN_HOST_DEFAULT, "Admin")); configuration.getBoolean(BIGTABLE_USE_PLAINTEXT_NEGOTIATION, false)); setBulkOptions(configuration, bigtableOptionsBuilder); setChannelOptions(configuration, bigtableOptionsBuilder); setClientCallOptions(configuration, bigtableOptionsBuilder);
private static void setChannelOptions(Configuration configuration, BigtableOptions.Builder builder) throws IOException { setCredentialOptions(builder, configuration); builder.setRetryOptions(createRetryOptions(configuration)); int channelCount = configuration.getInt( BIGTABLE_DATA_CHANNEL_COUNT_KEY, BigtableOptions.BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT); builder.setDataChannelCount(channelCount); // This is primarily used by Dataflow where connections open and close often. This is a // performance optimization that will reduce the cost to open connections. boolean useCachedDataPool = configuration.getBoolean(BIGTABLE_USE_CACHED_DATA_CHANNEL_POOL, false); builder.setUseCachedDataPool(useCachedDataPool); // This information is in addition to bigtable-client-core version, and jdk version. StringBuilder agentBuilder = new StringBuilder(); agentBuilder.append("hbase-").append(VersionInfo.getVersion()); String customUserAgent = configuration.get(CUSTOM_USER_AGENT_KEY); if (customUserAgent != null) { agentBuilder.append(',').append(customUserAgent); } builder.setUserAgent(agentBuilder.toString()); }
/** * Converts the {@link CloudBigtableConfiguration} to a {@link BigtableOptions} object. * @return The {@link BigtableOptions} object. */ public BigtableOptions toBigtableOptions() throws IOException { return BigtableOptionsFactory.fromConfiguration(toHBaseConfig()); }
/** * Converts the {@link CloudBigtableConfiguration} to a {@link BigtableOptions} object. * @return The {@link BigtableOptions} object. */ public BigtableOptions toBigtableOptions() throws IOException { return BigtableOptionsFactory.fromConfiguration(toHBaseConfig()); }
/** * Converts the {@link CloudBigtableConfiguration} to a {@link BigtableOptions} object. * @return The {@link BigtableOptions} object. */ public BigtableOptions toBigtableOptions() throws IOException { return BigtableOptionsFactory.fromConfiguration(toHBaseConfig()); }
opts = BigtableOptionsFactory.fromConfiguration(conf); } catch (IOException ioe) { LOG.error("Error loading BigtableOptions from Configuration.", ioe);
opts = BigtableOptionsFactory.fromConfiguration(conf); } catch (IOException ioe) { LOG.error("Error loading BigtableOptions from Configuration.", ioe);
public BigtableAsyncConnection(Configuration conf, AsyncRegistry ignoredRegistry, String ignoredClusterId, User ignoredUser) throws IOException { LOG.debug("Creating BigtableAsyncConnection"); this.conf = conf; BigtableOptions opts; try { opts = BigtableOptionsFactory.fromConfiguration(conf); } catch (IOException ioe) { LOG.error("Error loading BigtableOptions from Configuration.", ioe); throw ioe; } this.closed = false; this.session = new BigtableSession(opts); this.options = this.session.getOptions(); }
public BigtableAsyncConnection(Configuration conf, AsyncRegistry ignoredRegistry, String ignoredClusterId, User ignoredUser) throws IOException { LOG.debug("Creating BigtableAsyncConnection"); this.conf = conf; BigtableOptions opts; try { opts = BigtableOptionsFactory.fromConfiguration(conf); } catch (IOException ioe) { LOG.error("Error loading BigtableOptions from Configuration.", ioe); throw ioe; } this.closed = false; this.session = new BigtableSession(opts); this.options = this.session.getOptions(); }
options = BigtableOptionsFactory.fromConfiguration(fullConfiguration); } catch (IOException | RuntimeException exc) { logger.warn("Encountered errors attempting to parse configuration.", exc);
@VisibleForTesting void initializeScanner() throws IOException { Configuration config = source.getConfiguration().toHBaseConfig(); // This will use cached data channels under the covers. session = new BigtableSession(BigtableOptionsFactory.fromConfiguration(config)); scanner = session.getDataClient().readFlatRows(source.getConfiguration().getRequest()); }
options = BigtableOptionsFactory.fromConfiguration(fullConfiguration); } catch (IOException | RuntimeException exc) { logger.warn("Encountered errors attempting to parse configuration.", exc);
@VisibleForTesting void initializeScanner() throws IOException { Configuration config = source.getConfiguration().toHBaseConfig(); // This will use cached data channels under the covers. session = new BigtableSession(BigtableOptionsFactory.fromConfiguration(config)); scanner = session.getDataClient().readFlatRows(source.getConfiguration().getRequest()); }
@VisibleForTesting void initializeScanner() throws IOException { Configuration config = source.getConfiguration().toHBaseConfig(); // This will use cached data channels under the covers. session = new BigtableSession(BigtableOptionsFactory.fromConfiguration(config)); scanner = session.getDataClient().readFlatRows(source.getConfiguration().getRequest()); }