@Override public Configuration getConfiguration() { return conn.getConfiguration(); }
AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); this.locatePrefetchLimit = conn.getConfiguration().getInt(LOCATE_PREFETCH_LIMIT, DEFAULT_LOCATE_PREFETCH_LIMIT); }
@Override public CompletableFuture<Void> restoreSnapshot(String snapshotName) { boolean takeFailSafeSnapshot = this.connection.getConfiguration().getBoolean( HConstants.SNAPSHOT_RESTORE_TAKE_FAILSAFE_SNAPSHOT, HConstants.DEFAULT_SNAPSHOT_RESTORE_TAKE_FAILSAFE_SNAPSHOT); return restoreSnapshot(snapshotName, takeFailSafeSnapshot); }
/** * List all region locations for the specific table. */ private CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(TableName tableName) { if (TableName.META_TABLE_NAME.equals(tableName)) { CompletableFuture<List<HRegionLocation>> future = new CompletableFuture<>(); // For meta table, we use zk to fetch all locations. AsyncRegistry registry = AsyncRegistryFactory.getRegistry(connection.getConfiguration()); addListener(registry.getMetaRegionLocation(), (metaRegions, err) -> { if (err != null) { future.completeExceptionally(err); } else if (metaRegions == null || metaRegions.isEmpty() || metaRegions.getDefaultRegionLocation() == null) { future.completeExceptionally(new IOException("meta region does not found")); } else { future.complete(Collections.singletonList(metaRegions.getDefaultRegionLocation())); } // close the registry. IOUtils.closeQuietly(registry); }); return future; } else { // For non-meta table, we fetch all locations by scanning hbase:meta table return AsyncMetaTableAccessor.getTableHRegionLocations(metaTable, Optional.of(tableName)); } }
this.connection.getConfiguration().get(HConstants.SNAPSHOT_RESTORE_FAILSAFE_NAME, HConstants.DEFAULT_SNAPSHOT_RESTORE_FAILSAFE_NAME); final String failSafeSnapshotSnapshotName =
try { peerConf = ReplicationPeerConfigUtil.getPeerClusterConfiguration(connection.getConfiguration(), peer); } catch (IOException e) { return failedFuture(e);
try (AsyncConnectionImpl mockedConn = new AsyncConnectionImpl(CONN.getConfiguration(), CONN.registry, CONN.registry.getClusterId().get(), User.getCurrent()) {
@Override public Configuration getConfiguration() { return conn.getConfiguration(); }
AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); this.locatePrefetchLimit = conn.getConfiguration().getInt(LOCATE_PREFETCH_LIMIT, DEFAULT_LOCATE_PREFETCH_LIMIT); }
@Override public CompletableFuture<Void> restoreSnapshot(String snapshotName) { boolean takeFailSafeSnapshot = this.connection.getConfiguration().getBoolean( HConstants.SNAPSHOT_RESTORE_TAKE_FAILSAFE_SNAPSHOT, HConstants.DEFAULT_SNAPSHOT_RESTORE_TAKE_FAILSAFE_SNAPSHOT); return restoreSnapshot(snapshotName, takeFailSafeSnapshot); }
CompletableFuture<Void> future = new CompletableFuture<>(); String failSafeSnapshotSnapshotNameFormat = this.connection.getConfiguration().get( HConstants.SNAPSHOT_RESTORE_FAILSAFE_NAME, HConstants.DEFAULT_SNAPSHOT_RESTORE_FAILSAFE_NAME);
/** * List all region locations for the specific table. */ private CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(TableName tableName) { if (TableName.META_TABLE_NAME.equals(tableName)) { CompletableFuture<List<HRegionLocation>> future = new CompletableFuture<>(); // For meta table, we use zk to fetch all locations. AsyncRegistry registry = AsyncRegistryFactory.getRegistry(connection.getConfiguration()); registry.getMetaRegionLocation().whenComplete( (metaRegions, err) -> { if (err != null) { future.completeExceptionally(err); } else if (metaRegions == null || metaRegions.isEmpty() || metaRegions.getDefaultRegionLocation() == null) { future.completeExceptionally(new IOException("meta region does not found")); } else { future.complete(Collections.singletonList(metaRegions.getDefaultRegionLocation())); } // close the registry. IOUtils.closeQuietly(registry); }); return future; } else { // For non-meta table, we fetch all locations by scanning hbase:meta table return AsyncMetaTableAccessor.getTableHRegionLocations(metaTable, Optional.of(tableName)); } }
peerConf = ReplicationPeerConfigUtil .getPeerClusterConfiguration(connection.getConfiguration(), peer); } catch (IOException e) { return failedFuture(e);
@Override public Configuration getConfiguration() { return conn.getConfiguration(); }
AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); }
@Override public CompletableFuture<Void> restoreSnapshot(String snapshotName) { boolean takeFailSafeSnapshot = this.connection.getConfiguration().getBoolean( HConstants.SNAPSHOT_RESTORE_TAKE_FAILSAFE_SNAPSHOT, HConstants.DEFAULT_SNAPSHOT_RESTORE_TAKE_FAILSAFE_SNAPSHOT); return restoreSnapshot(snapshotName, takeFailSafeSnapshot); }
CompletableFuture<Void> future = new CompletableFuture<>(); String failSafeSnapshotSnapshotNameFormat = this.connection.getConfiguration().get( HConstants.SNAPSHOT_RESTORE_FAILSAFE_NAME, HConstants.DEFAULT_SNAPSHOT_RESTORE_FAILSAFE_NAME);
/** * List all region locations for the specific table. */ private CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(TableName tableName) { if (TableName.META_TABLE_NAME.equals(tableName)) { CompletableFuture<List<HRegionLocation>> future = new CompletableFuture<>(); // For meta table, we use zk to fetch all locations. AsyncRegistry registry = AsyncRegistryFactory.getRegistry(connection.getConfiguration()); registry.getMetaRegionLocation().whenComplete( (metaRegions, err) -> { if (err != null) { future.completeExceptionally(err); } else if (metaRegions == null || metaRegions.isEmpty() || metaRegions.getDefaultRegionLocation() == null) { future.completeExceptionally(new IOException("meta region does not found")); } else { future.complete(Collections.singletonList(metaRegions.getDefaultRegionLocation())); } // close the registry. IOUtils.closeQuietly(registry); }); return future; } else { // For non-meta table, we fetch all locations by scanning hbase:meta table return AsyncMetaTableAccessor.getTableHRegionLocations(metaTable, Optional.of(tableName)); } }
return sn; VHostMapListener vhostMap = VHostMapListener.getInstance(root, getConfiguration()); if (vhostMap != null && vhostMap.getVhost(sn.getHostname()) != null) { vsn = ServerName.valueOf(vhostMap.getVhost(sn.getHostname()), sn.getPort(), sn.getStartcode());
try (AsyncConnectionImpl mockedConn = new AsyncConnectionImpl(CONN.getConfiguration(), CONN.registry, CONN.registry.getClusterId().get(), User.getCurrent()) {