keith-turner opened a new issue #1974:
URL: https://github.com/apache/accumulo/issues/1974
**Is your feature request related to a problem? Please describe.**
While working on #1451 I ran into a situation where I needed to read
metadata for multiple non-contiguous tablets from the metadata table. To do
this using Ample currently requires an RPC for each tablet, which is
inefficient. Ample currently only supports reading a range of contiguous
tablets or a single tablet.
**Describe the solution you'd like**
Given a collection of KeyExtents I would like to be able to lookup the
related tablet metadata with code like the following.
```java
ServerContext context = ....;
Collection<KeyExtent> extents= ...;
Iterable<TabletMetadata> tabletsMeta = context.getAmple().
readTablets().
forTablets(extents). // this would be
a new method
fetch(ColumnType.LOCATION,
ColumnType.PREV_ROW).
build();
for (TabletMetadata tabletMetadata : tabletsMeta) {
// use metadata
}
```
The implementation within Ample for this new method could use a BatchScanner
and WholeRowIterator
**Describe alternatives you've considered**
I could use a BatchScanner and WholeIterator directly within the code I am
writing, however that would be less maintainable. Until this implemented I
will do the following which is less efficient (RPC per extent) but maintainable
and easy to understand.
```java
ServerContext context = ....;
Collection<KeyExtent> extents= ...;
for (KeyExtent extent : extents) {
TabletMetadata tabletMetadata = context.getAmple().readTablet(extent,
ColumnType.LOCATION, ColumnType.PREV_ROW);
// use metadata
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]