Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-3282

Reduce scans of metadata when assigning tablet

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • tserver
    • None

    Description

      Noticed the following case digging through the assignment code:

      TabletServer.java
        public static Pair<Text,KeyExtent> verifyTabletInformation(KeyExtent extent, TServerInstance instance, SortedMap<Key,Value> tabletsKeyValues,
            String clientAddress, ZooLock lock) throws AccumuloSecurityException, DistributedStoreException, AccumuloException {
      ...
        public static Pair<Text,KeyExtent> verifyTabletInformation(KeyExtent extent, TServerInstance instance, SortedMap<Key,Value> tabletsKeyValues,
            String clientAddress, ZooLock lock) throws AccumuloSecurityException, DistributedStoreException, AccumuloException {
      
          log.debug("verifying extent " + extent);
          if (extent.isRootTablet()) {
            return verifyRootTablet(extent, instance);
          }
          String tableToVerify = MetadataTable.ID;
          if (extent.isMeta())
            tableToVerify = RootTable.ID;
      
          List<ColumnFQ> columnsToFetch = Arrays.asList(new ColumnFQ[] {TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN,
              TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN, TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN,
              TabletsSection.TabletColumnFamily.OLD_PREV_ROW_COLUMN, TabletsSection.ServerColumnFamily.TIME_COLUMN});
      
          ScannerImpl scanner = new ScannerImpl(HdfsZooInstance.getInstance(), SystemCredentials.get(), tableToVerify, Authorizations.EMPTY);
          scanner.setRange(extent.toMetadataRange());
      
          TreeMap<Key,Value> tkv = new TreeMap<Key,Value>();
          for (Entry<Key,Value> entry : scanner)
            tkv.put(entry.getKey(), entry.getValue());
      
          // only populate map after success
          if (tabletsKeyValues == null) {
            tabletsKeyValues = tkv;
          } else {
            tabletsKeyValues.clear();
            tabletsKeyValues.putAll(tkv);
      

      Essentially, we read a few columns for the tablet's row from metadata and (when metadata is in a consistent state) we return those columns to the Tablet constructor.

      Tablet.java
        private Tablet(TabletServer tabletServer, Text location, KeyExtent extent, TabletResourceManager trm, Configuration conf, VolumeManager fs,
            SortedMap<Key,Value> tabletsKeyValues) throws IOException {
          this(tabletServer, location, extent, trm, conf, fs, lookupLogEntries(extent, tabletsKeyValues), lookupDatafiles(tabletServer.getSystemConfiguration(), fs,
              extent, tabletsKeyValues), lookupTime(tabletServer.getSystemConfiguration(), extent, tabletsKeyValues), lookupLastServer(extent, tabletsKeyValues),
              lookupScanFiles(extent, tabletsKeyValues, fs), lookupFlushID(extent, tabletsKeyValues), lookupCompactID(extent, tabletsKeyValues));
        }
      

      lookupDataFiles reaches back out to the metadata table to fetch this column. I'm not sure if there's a reason why we can't do this all at once.

      Attachments

        1. ACCUMULO-3282.patch
          3 kB
          Josh Elser

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              elserj Josh Elser
              elserj Josh Elser
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m