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

Add per table sampling

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.8.0
    • None
    • None

    Description

      I am working on prototyping adding hash based sampling to Accumulo. I am trying to accomplish the following goals in the prototype.

      1. Have each RFile store a sample per locality group. Also store the configuration used to generate the sample.
      2. Use sampling functions that ensure the same row columns exist across the samples in all RFiles. Hash mod is a good candidate that gives a random sample that's consistent across files.
      3. Have scanners support scanning RFile's samples sets. Scan should fail if RFiles have different sample configuration. Different sampling config implies the RFile's sample sets contain a possibly disjoint set of row columns.
      4. Support generating sample data for RFiles generated for bulk import
      5. Support sample data in the memory map
      6. Support enabling and disabling sampling per table AND configuring a sample function.

      I am currently using the following function in my prototype to determine what data an RFile stores in its sample set. This code will always select same subset of rows for each RFile's sample set. I have not yet made the function configurable.

      public class RowSampler implements Sampler {
      
        private HashFunction hasher = Hashing.murmur3_32();
      
        @Override
        public boolean accept(Key k) {
          ByteSequence row = k.getRowData();
          HashCode hc = hasher.hashBytes(row.getBackingArray(), row.offset(), row.length());
          return hc.asInt() % 1009 == 0;
        }
      }
      

      Although not yet implemented, the divisor in this RowSample could be configurable. RFiles with sample data would store the fact that a RowSample with a divisor of 1009 was used to generate sample data.

      Attachments

        Issue Links

          Activity

            People

              kturner Keith Turner
              kturner Keith Turner
              Votes:
              0 Vote for this issue
              Watchers:
              3 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