Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/100#discussion_r64400847
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java 
---
    @@ -386,13 +392,23 @@ public void flushIfNeeded() throws IOException {
     
         private SampleLocalityGroupWriter sample;
     
    -    LocalityGroupWriter(BlockFileWriter fileWriter, long blockSize, 
LocalityGroupMetadata currentLocalityGroup, SampleLocalityGroupWriter sample) {
    +    private SummaryStatistics keyLenStats = new SummaryStatistics();
    +    private double avergageKeySize = 0;
    +
    +    LocalityGroupWriter(BlockFileWriter fileWriter, long blockSize, long 
maxBlockSize, LocalityGroupMetadata currentLocalityGroup,
    +        SampleLocalityGroupWriter sample) {
           this.fileWriter = fileWriter;
           this.blockSize = blockSize;
    +      this.maxBlockSize = maxBlockSize;
           this.currentLocalityGroup = currentLocalityGroup;
           this.sample = sample;
         }
     
    +    private boolean isGiantKey(Key k) {
    +      // consider a key thats more than 3 standard deviations from 
previously seen key sizes as giant
    +      return k.getSize() > keyLenStats.getMean() + 
keyLenStats.getStandardDeviation() * 3;
    --- End diff --
    
    TODO ensure there is a test for case when all keys are exactly the same 
size.  Test should assert more than one data block.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to