.overlapping(startRow, endRow).fetchFiles().fetchLocation().fetchLast().fetchPrev() .build(ctx);
.overlapping(startRow, endRow).fetchLocation().fetchPrev().fetchCompactId() .build(master.getContext());
.overlapping(startRow, endRow).fetchFlushId().fetchLocation().fetchLogs().fetchPrev() .build(master.getContext())) { int tabletsToWaitFor = 0;
.overlapping(startRow, null).checkConsistency().fetchPrev().fetchLocation().fetchLoaded() .build(master.getContext()).iterator();
protected Iterable<Pair<KeyExtent,Location>> getLocationProvider() { return () -> { try { return TabletsMetadata.builder().forTable(tableId).fetchLocation().fetchPrev() .build(context).stream().map(tm -> { Location loc = Location.NONE; if (tm.hasCurrent()) { loc = new Location(new TServerInstance(tm.getLocation())); } return new Pair<>(tm.getExtent(), loc); }).iterator(); } catch (Exception e) { throw new RuntimeException(e); } }; }
private int countFiles() { // TODO use a batch scanner + iterator to parallelize counting files return TabletsMetadata.builder().forTable(tableId).overlapping(startRow, endRow).fetchFiles() .fetchPrev().build(ctx).stream().mapToInt(tm -> tm.getFiles().size()).sum(); }
@VisibleForTesting protected Stream<KeyExtent> lookupExtents(Text row) throws TableNotFoundException, AccumuloException, AccumuloSecurityException { return TabletsMetadata.builder().forTable(tableId).overlapping(row, null).checkConsistency() .fetchPrev().build(ctx).stream().limit(100).map(TabletMetadata::getExtent); }
private void checkForMerge(final Master master) throws Exception { VolumeManager fs = master.getFileSystem(); final Path bulkDir = new Path(bulkInfo.sourceDir); try (LoadMappingIterator lmi = BulkSerialize.readLoadMapping(bulkDir.toString(), bulkInfo.tableId, p -> fs.open(p))) { TabletIterFactory tabletIterFactory = startRow -> TabletsMetadata.builder() .forTable(bulkInfo.tableId).overlapping(startRow, null).checkConsistency().fetchPrev() .build(master.getContext()).stream().map(TabletMetadata::getExtent).iterator(); checkForMerge(bulkInfo.tableId.canonicalID(), Iterators.transform(lmi, entry -> entry.getKey()), tabletIterFactory); } }
/** * @see #overlapping(Text, Text) */ default Options overlapping(byte[] startRow, byte[] endRow) { return overlapping(startRow == null ? null : new Text(startRow), endRow == null ? null : new Text(endRow)); }