/** * Lists all snapshots associated with the specified cluster. * @param request a {@link ListSnapshotsRequest} object. * @return The {@link ListSnapshotsResponse} which has the list of the snapshots in the cluster. */ public CompletableFuture<ListSnapshotsResponse> listSnapshotsAsync(ListSnapshotsRequest request) { return toCompletableFuture(adminClient.listSnapshotsAsync(request)); }
/** * Lists all snapshots associated with the specified cluster. * @param request a {@link ListSnapshotsRequest} object. * @return The {@link ListSnapshotsResponse} which has the list of the snapshots in the cluster. */ public CompletableFuture<ListSnapshotsResponse> listSnapshotsAsync(ListSnapshotsRequest request) { return toCompletableFuture(adminClient.listSnapshotsAsync(request)); }
@Override public List<SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked(bigtableTableAdminClient .listSnapshotsAsync(request), IOException.class); List<SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { response.add(new SnapshotDescription( snapshot.getName(), TableName.valueOf(snapshot.getSourceTable().getName()))); } return response; }
@Override public List<SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked(bigtableTableAdminClient .listSnapshotsAsync(request), IOException.class); List<SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { response.add(new SnapshotDescription( snapshot.getName(), TableName.valueOf(snapshot.getSourceTable().getName()))); } return response; }
/** {@inheritDoc} */ @Override public List<HBaseProtos.SnapshotDescription> listSnapshots() throws IOException { ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder() .setParent(getSnapshotClusterName().toString()) .build(); ListSnapshotsResponse snapshotList = Futures.getChecked( bigtableTableAdminClient.listSnapshotsAsync(request), IOException.class ); List<HBaseProtos.SnapshotDescription> response = new ArrayList<>(); for (Snapshot snapshot : snapshotList.getSnapshotsList()) { BigtableSnapshotName snapshotName = new BigtableSnapshotName(snapshot.getName()); BigtableTableName tableName = new BigtableTableName(snapshot.getSourceTable().getName()); response.add(HBaseProtos.SnapshotDescription.newBuilder() .setName(snapshotName.getSnapshotId()) .setTable(tableName.getTableId()) .setCreationTime(TimeUnit.SECONDS.toMillis(snapshot.getCreateTime().getSeconds())) .build()); } return response; }