コード例 #1
0
 @Override
 public void readFields(DataInput in) throws IOException {
   RowKeySchema schema = new RowKeySchema();
   schema.readFields(in);
   int maxLength = getTerminatorCount(schema);
   int andLen = in.readInt();
   List<List<KeyRange>> slots = Lists.newArrayListWithExpectedSize(andLen);
   for (int i = 0; i < andLen; i++) {
     int orlen = in.readInt();
     List<KeyRange> orclause = Lists.newArrayListWithExpectedSize(orlen);
     slots.add(orclause);
     int maxSlotLength = 0;
     for (int j = 0; j < orlen; j++) {
       KeyRange range = new KeyRange();
       range.readFields(in);
       if (range.getLowerRange().length > maxSlotLength) {
         maxSlotLength = range.getLowerRange().length;
       }
       if (range.getUpperRange().length > maxSlotLength) {
         maxSlotLength = range.getUpperRange().length;
       }
       orclause.add(range);
     }
     maxLength += maxSlotLength;
   }
   this.init(slots, schema, maxLength);
 }
コード例 #2
0
 public SkipScanFilter(List<List<KeyRange>> slots, RowKeySchema schema) {
   int maxKeyLength = getTerminatorCount(schema);
   for (List<KeyRange> slot : slots) {
     int maxSlotLength = 0;
     for (KeyRange range : slot) {
       int maxRangeLength = Math.max(range.getLowerRange().length, range.getUpperRange().length);
       if (maxSlotLength < maxRangeLength) {
         maxSlotLength = maxRangeLength;
       }
     }
     maxKeyLength += maxSlotLength;
   }
   init(slots, schema, maxKeyLength);
 }