accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo] hkeebler commented on issue #1254: Fix accumulo-1244 Update MetadataTableUtil to use the ample api
Date Mon, 08 Jul 2019 19:34:57 GMT
hkeebler commented on issue #1254: Fix accumulo-1244 Update MetadataTableUtil to use the ample
api
URL: https://github.com/apache/accumulo/pull/1254#issuecomment-509361641
 
 
   Can the following code replacement be done or does "endKey .followingKey(partialKey.ROWCOLFAM)"
change the Range of the scan?
   ```
    public static SortedMap<FileRef,DataFileValue> getDataFileSizes(KeyExtent extent,
       ServerContext context) {
       TreeMap<FileRef,DataFileValue> sizes = new TreeMap<>();
       TabletMetadata tablet = context.getAmple().readTablet(extent, FILES);
       tablet.getFilesMap().forEach((k, v) -> {
         sizes.put(new FileRef(k, context.getVolumeManager().getFullPath(tablet.getTableId(),
k)), v);});
       return sizes;
    /* above replaces the following:
      try (Scanner mdScanner = new ScannerImpl(context, MetadataTable.ID, Authorizations.EMPTY))
{
         mdScanner.fetchColumnFamily(DataFileColumnFamily.NAME);
         Text row = extent.getMetadataEntry();
         Key endKey = new Key(row, DataFileColumnFamily.NAME, new Text(""));
         endKey = endKey.followingKey(PartialKey.ROW_COLFAM);
         mdScanner.setRange(new Range(new Key(row), endKey));
         for (Entry<Key,Value> entry : mdScanner) {
           if (!entry.getKey().getRow().equals(row))
             break;
           DataFileValue dfv = new DataFileValue(entry.getValue().get());
           sizes.put(new FileRef(context.getVolumeManager(), entry.getKey()), dfv);
         }
         return sizes;
       }*/
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message