private static String getHost(Configuration configuration, String key, String defaultVal, String type) { String hostName = configuration.get(key, defaultVal); LOG.debug("%s endpoint host %s.", type, hostName); return hostName; }
private static String getHost(Configuration configuration, String key, String defaultVal, String type) { String hostName = configuration.get(key, defaultVal); LOG.debug("%s endpoint host %s.", type, hostName); return hostName; }
private static String getValue(final Configuration configuration, String key, String type) { String value = configuration.get(key); Preconditions.checkArgument( !isNullOrEmpty(value), String.format("%s must be supplied via %s", type, key)); LOG.debug("%s %s", type, value); return value; }
private static String getValue(final Configuration configuration, String key, String type) { String value = configuration.get(key); Preconditions.checkArgument( !isNullOrEmpty(value), String.format("%s must be supplied via %s", type, key)); LOG.debug("%s %s", type, value); return value; }
@Override public void close() throws IOException { LOG.debug("closeing BigtableAsyncConnection"); if (!this.closed) { this.session.close(); this.closed = true; } }
@Override public void close() throws IOException { LOG.debug("closeing BigtableAsyncConnection"); if (!this.closed) { this.session.close(); this.closed = true; } }
private void setParallelism(long meanLatencyNanos, String type, int newValue) { int currentValue = getCurrentInFlightMaxRpcs(); if (newValue != currentValue) { setCurrentInFlightMaxRpcs(newValue); LOG.debug("Latency is at %d ms. %s paralellelism from %d to %d.", TimeUnit.NANOSECONDS.toMillis(meanLatencyNanos), type, currentValue, newValue); } } };
failedMutations.add(mutationException.mutation); hostnames.add(host); LOG.debug("Exception occurred in BufferedMutator", mutationException.throwable);
failedMutations.add(mutationException.mutation); hostnames.add(host); LOG.debug("Exception occurred in BufferedMutator", mutationException.throwable);
if (configuration.getBoolean( BIGTABLE_USE_SERVICE_ACCOUNTS_KEY, BIGTABLE_USE_SERVICE_ACCOUNTS_DEFAULT)) { LOG.debug("Using service accounts"); } else if (configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_VALUE_KEY) != null) { String jsonValue = configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_VALUE_KEY); LOG.debug("Using json value"); builder.setCredentialOptions( CredentialOptions.jsonCredentials(jsonValue)); String keyFileLocation = configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_KEYFILE_LOCATION_KEY); LOG.debug("Using json keyfile: %s", keyFileLocation); builder.setCredentialOptions( CredentialOptions.jsonCredentials( } else if (configuration.get(BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY) != null) { String serviceAccount = configuration.get(BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY); LOG.debug("Service account %s specified.", serviceAccount); String keyFileLocation = configuration.get(BIGTABLE_SERVICE_ACCOUNT_P12_KEYFILE_LOCATION_KEY); Preconditions.checkState(!isNullOrEmpty(keyFileLocation), "Key file location must be specified when setting service account email"); LOG.debug("Using p12 keyfile: %s", keyFileLocation); builder.setCredentialOptions( CredentialOptions.p12Credential(serviceAccount, keyFileLocation)); } else { LOG.debug("Using default credentials."); builder.setCredentialOptions(
if (configuration.getBoolean( BIGTABLE_USE_SERVICE_ACCOUNTS_KEY, BIGTABLE_USE_SERVICE_ACCOUNTS_DEFAULT)) { LOG.debug("Using service accounts"); } else if (configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_VALUE_KEY) != null) { String jsonValue = configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_VALUE_KEY); LOG.debug("Using json value"); builder.setCredentialOptions( CredentialOptions.jsonCredentials(jsonValue)); String keyFileLocation = configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_KEYFILE_LOCATION_KEY); LOG.debug("Using json keyfile: %s", keyFileLocation); builder.setCredentialOptions( CredentialOptions.jsonCredentials( } else if (configuration.get(BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY) != null) { String serviceAccount = configuration.get(BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY); LOG.debug("Service account %s specified.", serviceAccount); String keyFileLocation = configuration.get(BIGTABLE_SERVICE_ACCOUNT_P12_KEYFILE_LOCATION_KEY); Preconditions.checkState(!isNullOrEmpty(keyFileLocation), "Key file location must be specified when setting service account email"); LOG.debug("Using p12 keyfile: %s", keyFileLocation); builder.setCredentialOptions( CredentialOptions.p12Credential(serviceAccount, keyFileLocation)); } else { LOG.debug("Using default credentials."); builder.setCredentialOptions(
private boolean wouldBeFull(MutateRowsRequest.Entry entry) { boolean hitMutationMax = numberOfMutations + entry.getMutationsCount() > MAX_NUMBER_OF_MUTATIONS; if (hitMutationMax) { LOG.debug( "Would overflow maximum number of mutations, current = %d, adding = %d", numberOfMutations, entry.getMutationsCount()); } return getRequestCount() + 1 > maxRowKeyCount || (approximateByteSize + entry.getSerializedSize() > maxRequestSize) || hitMutationMax; }
LOG.debug("Sampling rowkeys for table %s", request.getTableName());
LOG.debug("Sampling rowkeys for table %s", request.getTableName());
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(); }
public BigtableAsyncAdmin(CommonConnection asyncConnection) throws IOException { LOG.debug("Creating BigtableAsyncAdmin"); this.options = asyncConnection.getOptions(); this.bigtableTableAdminClient = new BigtableTableAdminClient( asyncConnection.getSession().getTableAdminClient()); this.disabledTables = asyncConnection.getDisabledTables(); this.bigtableInstanceName = options.getInstanceName(); this.tableAdapter2x = new TableAdapter2x(options); this.asyncConnection = asyncConnection; this.configuration = asyncConnection.getConfiguration(); String clusterId = configuration.get(BigtableOptionsFactory.BIGTABLE_SNAPSHOT_CLUSTER_ID_KEY, null); if (clusterId != null) { bigtableSnapshotClusterName = bigtableInstanceName.toClusterName(clusterId); } }
public BigtableAsyncAdmin(CommonConnection asyncConnection) throws IOException { LOG.debug("Creating BigtableAsyncAdmin"); this.options = asyncConnection.getOptions(); this.bigtableTableAdminClient = new BigtableTableAdminClient( asyncConnection.getSession().getTableAdminClient()); this.disabledTables = asyncConnection.getDisabledTables(); this.bigtableInstanceName = options.getInstanceName(); this.tableAdapter2x = new TableAdapter2x(options); this.asyncConnection = asyncConnection; this.configuration = asyncConnection.getConfiguration(); String clusterId = configuration.get(BigtableOptionsFactory.BIGTABLE_SNAPSHOT_CLUSTER_ID_KEY, null); if (clusterId != null) { bigtableSnapshotClusterName = bigtableInstanceName.toClusterName(clusterId); } }
/** * <p> * Constructor for AbstractBigtableAdmin. * </p> * @param connection a {@link CommonConnection} object. * @throws IOException */ public AbstractBigtableAdmin(CommonConnection connection) throws IOException { LOG.debug("Creating BigtableAdmin"); configuration = connection.getConfiguration(); options = connection.getOptions(); this.connection = connection; bigtableTableAdminClient = connection.getSession().getTableAdminClient(); disabledTables = connection.getDisabledTables(); bigtableInstanceName = options.getInstanceName(); tableAdapter = new TableAdapter(bigtableInstanceName); String clusterId = configuration.get(BigtableOptionsFactory.BIGTABLE_SNAPSHOT_CLUSTER_ID_KEY, null); if (clusterId != null) { bigtableSnapshotClusterName = bigtableInstanceName.toClusterName(clusterId); } }
/** * <p> * Constructor for AbstractBigtableAdmin. * </p> * @param connection a {@link CommonConnection} object. * @throws IOException */ public AbstractBigtableAdmin(CommonConnection connection) throws IOException { LOG.debug("Creating BigtableAdmin"); configuration = connection.getConfiguration(); options = connection.getOptions(); this.connection = connection; bigtableTableAdminClient = connection.getSession().getTableAdminClient(); disabledTables = connection.getDisabledTables(); bigtableInstanceName = options.getInstanceName(); tableAdapter = new TableAdapter(bigtableInstanceName); tableAdminClientWrapper = connection.getSession().getTableAdminClientWrapper(); String clusterId = configuration.get(BigtableOptionsFactory.BIGTABLE_SNAPSHOT_CLUSTER_ID_KEY, null); if (clusterId != null) { bigtableSnapshotClusterName = bigtableInstanceName.toClusterName(clusterId); } }