private RetriesExhaustedWithDetailsException createRetriesExhaustedWithDetailsException(Throwable e, Row action) { return new RetriesExhaustedWithDetailsException(Arrays.asList(e), Arrays.asList(action), Arrays.asList(options.getDataHost().toString())); }
private RetriesExhaustedWithDetailsException createRetriesExhaustedWithDetailsException(Throwable e, Row action) { return new RetriesExhaustedWithDetailsException(Arrays.asList(e), Arrays.asList(action), Arrays.asList(options.getDataHost().toString())); }
/** {@inheritDoc} */ @Override public String toString() { return MoreObjects.toStringHelper(AbstractBigtableTable.class) .add("hashCode", "0x" + Integer.toHexString(hashCode())) .add("project", options.getProjectId()) .add("instance", options.getInstanceId()) .add("table", tableName.getNameAsString()) .add("host", options.getDataHost()) .toString(); }
/** {@inheritDoc} */ @Override public String toString() { return MoreObjects.toStringHelper(AbstractBigtableTable.class) .add("hashCode", "0x" + Integer.toHexString(hashCode())) .add("project", options.getProjectId()) .add("instance", options.getInstanceId()) .add("table", tableName.getNameAsString()) .add("host", options.getDataHost()) .toString(); }
/** {@inheritDoc} */ @Override public String toString() { return MoreObjects.toStringHelper(AbstractBigtableConnection.class) .add("project", options.getProjectId()) .add("instance", options.getInstanceId()) .add("dataHost", options.getDataHost()) .add("tableAdminHost", options.getAdminHost()) .toString(); }
/** {@inheritDoc} */ @Override public String toString() { return MoreObjects.toStringHelper(AbstractBigtableConnection.class) .add("project", options.getProjectId()) .add("instance", options.getInstanceId()) .add("dataHost", options.getDataHost()) .add("tableAdminHost", options.getAdminHost()) .toString(); }
/** * <p>Constructor for BigtableBufferedMutator.</p> * * @param adapter Converts HBase objects to Bigtable protos * @param configuration For Additional configuration. TODO: move this to options * @param listener Handles exceptions. By default, it just throws the exception. * @param session a {@link com.google.cloud.bigtable.grpc.BigtableSession} to get {@link com.google.cloud.bigtable.config.BigtableOptions}, {@link com.google.cloud.bigtable.grpc.async.AsyncExecutor} * and {@link com.google.cloud.bigtable.grpc.async.BulkMutation} objects from * starting the async operations on the BigtableDataClient. */ public BigtableBufferedMutator( HBaseRequestAdapter adapter, Configuration configuration, BigtableSession session, BufferedMutator.ExceptionListener listener) { helper = new BigtableBufferedMutatorHelper(adapter, configuration, session); this.listener = listener; this.host = session.getOptions().getDataHost().toString(); }
/** * <p>Constructor for BigtableBufferedMutator.</p> * * @param adapter Converts HBase objects to Bigtable protos * @param configuration For Additional configuration. TODO: move this to options * @param listener Handles exceptions. By default, it just throws the exception. * @param session a {@link com.google.cloud.bigtable.grpc.BigtableSession} to get {@link com.google.cloud.bigtable.config.BigtableOptions}, {@link com.google.cloud.bigtable.grpc.async.AsyncExecutor} * and {@link com.google.cloud.bigtable.grpc.async.BulkMutation} objects from * starting the async operations on the BigtableDataClient. */ public BigtableBufferedMutator( HBaseRequestAdapter adapter, Configuration configuration, BigtableSession session, BufferedMutator.ExceptionListener listener) { helper = new BigtableBufferedMutatorHelper(adapter, configuration, session); this.listener = listener; this.host = session.getOptions().getDataHost().toString(); }
problemActions.add(actions.get(i)); problems.add(e.getCause()); hosts.add(options.getDataHost().toString());
problemActions.add(actions.get(i)); problems.add(e.getCause()); hosts.add(options.getDataHost().toString());
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); }
@Override public List<HRegionInfo> getAllRegionInfos(TableName tableName) throws IOException { ServerName serverName = ServerName.valueOf(options.getDataHost(), options.getPort(), 0); SampleRowKeysRequest.Builder request = SampleRowKeysRequest.newBuilder(); request.setTableName(options.getInstanceName().toTableNameStr(tableName.getNameAsString())); List<SampleRowKeysResponse> sampleRowKeyResponse = this.session.getDataClient().sampleRowKeys(request.build()); return getSampledRowKeysAdapter(tableName, serverName).adaptResponse(sampleRowKeyResponse) .stream() .map(location -> location.getRegionInfo()) .collect(Collectors.toCollection(CopyOnWriteArrayList::new)); }
@Override public List<HRegionInfo> getAllRegionInfos(TableName tableName) throws IOException { ServerName serverName = ServerName.valueOf(options.getDataHost(), options.getPort(), 0); SampleRowKeysRequest.Builder request = SampleRowKeysRequest.newBuilder(); request.setTableName(options.getInstanceName().toTableNameStr(tableName.getNameAsString())); List<SampleRowKeysResponse> sampleRowKeyResponse = this.session.getDataClient().sampleRowKeys(request.build()); return getSampledRowKeysAdapter(tableName, serverName).adaptResponse(sampleRowKeyResponse) .stream() .map(location -> location.getRegionInfo()) .collect(Collectors.toCollection(CopyOnWriteArrayList::new)); }
System.out.println(String.format("Instance Id: %s", options.getInstanceId())); System.out.println(String.format("Admin host: %s", options.getAdminHost())); System.out.println(String.format("Data host: %s", options.getDataHost()));
System.out.println(String.format("Instance Id: %s", options.getInstanceId())); System.out.println(String.format("Admin host: %s", options.getAdminHost())); System.out.println(String.format("Data host: %s", options.getDataHost()));
public AbstractBigtableRegionLocator (TableName tableName, BigtableOptions options, BigtableDataClient client) { this.tableName = tableName; this.client = client; this.bigtableTableName = options.getInstanceName().toTableName(tableName.getNameAsString()); ServerName serverName = ServerName.valueOf(options.getDataHost(), options.getPort(), 0); this.adapter = getSampledRowKeysAdapter(tableName, serverName); }
public AbstractBigtableRegionLocator (TableName tableName, BigtableOptions options, BigtableDataClient client) { this.tableName = tableName; this.client = client; this.bigtableTableName = options.getInstanceName().toTableName(tableName.getNameAsString()); ServerName serverName = ServerName.valueOf(options.getDataHost(), options.getPort(), 0); this.adapter = getSampledRowKeysAdapter(tableName, serverName); }
"Opening connection for projectId %s, instanceId %s, " + "on data host %s, admin host %s.", options.getProjectId(), options.getInstanceId(), options.getDataHost(), options.getAdminHost()); LOG.info("Bigtable options: %s.", options);