/** * * * <pre> * The request that prompted the initiation of this CreateTableFromSnapshot * operation. * </pre> * * <code>.google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1;</code> */ public Builder setOriginalRequest( com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * The request that prompted the initiation of this CreateTableFromSnapshot * operation. * </pre> * * <code>.google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1;</code> */ public Builder setOriginalRequest( com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } return this; } /**
@Override public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName) { return CompletableFuture.supplyAsync(() -> { try { return CreateTableFromSnapshotRequest.newBuilder() .setParent(options.getInstanceName().toString()) .setTableId(tableName.getNameAsString()) .setSourceSnapshot(getClusterName().toSnapshotName(snapshotName)).build(); } catch (IOException e) { throw new CompletionException(e); } }).thenCompose( c -> bigtableTableAdminClient.createTableFromSnapshotAsync(c).thenApply(r -> null)); }
.setTableId(tableId) .setSourceSnapshot(sourceSnapshot) .build(); return createTableFromSnapshotAsync(request);
.setTableId(tableId) .setSourceSnapshot(sourceSnapshot == null ? null : sourceSnapshot.toString()) .build(); return createTableFromSnapshotAsync(request);
/** {@inheritDoc} */ @Override public void cloneSnapshot(String snapshotName, TableName tableName) throws IOException, TableExistsException, RestoreSnapshotException { CreateTableFromSnapshotRequest request = CreateTableFromSnapshotRequest.newBuilder() .setParent(options.getInstanceName().toString()) .setTableId(tableName.getNameAsString()) .setSourceSnapshot(getClusterName().toSnapshotName(snapshotName)) .build(); Operation operation = Futures .getChecked(bigtableTableAdminClient.createTableFromSnapshotAsync(request), IOException.class); try { connection.getSession().getInstanceAdminClient(). waitForOperation(operation); } catch (TimeoutException e) { throw new IOException("Timed out waiting for cloneSnapshot operation to finish", e); } }
/** {@inheritDoc} */ @Override public void cloneSnapshot(String snapshotName, TableName tableName) throws IOException, TableExistsException, RestoreSnapshotException { CreateTableFromSnapshotRequest request = CreateTableFromSnapshotRequest.newBuilder() .setParent(options.getInstanceName().toString()) .setTableId(tableName.getNameAsString()) .setSourceSnapshot(getClusterName().toSnapshotName(snapshotName)) .build(); Operation operation = Futures .getChecked(bigtableTableAdminClient.createTableFromSnapshotAsync(request), IOException.class); try { connection.getSession().getInstanceAdminClient(). waitForOperation(operation); } catch (TimeoutException e) { throw new IOException("Timed out waiting for cloneSnapshot operation to finish", e); } }
@Override public CompletableFuture<Void> cloneSnapshot(String snapshotName, TableName tableName) { return CompletableFuture.supplyAsync(() -> { try { return CreateTableFromSnapshotRequest.newBuilder() .setParent(options.getInstanceName().toString()) .setTableId(tableName.getNameAsString()) .setSourceSnapshot(getClusterName().toSnapshotName(snapshotName)).build(); } catch (IOException e) { throw new CompletionException(e); } }).thenCompose( c -> bigtableTableAdminClient.createTableFromSnapshotAsync(c).thenApply(r -> null)); }
.setTableId(tableId) .setSourceSnapshot(sourceSnapshot) .build(); return createTableFromSnapshotAsync(request);
.setTableId(tableId) .setSourceSnapshot(sourceSnapshot == null ? null : sourceSnapshot.toString()) .build(); return createTableFromSnapshotAsync(request);