Example #1
0
        @Override
        public GTScanRequest deserialize(ByteBuffer in) {
          GTInfo sInfo = GTInfo.serializer.deserialize(in);

          List<GTScanRange> sRanges = Lists.newArrayList();
          int sRangesCount = BytesUtil.readVInt(in);
          for (int rangeIdx = 0; rangeIdx < sRangesCount; rangeIdx++) {
            GTRecord sPkStart = deserializeGTRecord(in, sInfo);
            GTRecord sPkEnd = deserializeGTRecord(in, sInfo);
            List<GTRecord> sFuzzyKeys = Lists.newArrayList();
            int sFuzzyKeySize = BytesUtil.readVInt(in);
            for (int i = 0; i < sFuzzyKeySize; i++) {
              sFuzzyKeys.add(deserializeGTRecord(in, sInfo));
            }
            GTScanRange sRange = new GTScanRange(sPkStart, sPkEnd, sFuzzyKeys);
            sRanges.add(sRange);
          }

          ImmutableBitSet sColumns = ImmutableBitSet.serializer.deserialize(in);
          TupleFilter sGTFilter = GTUtil.deserializeGTFilter(BytesUtil.readByteArray(in), sInfo);

          ImmutableBitSet sAggGroupBy = ImmutableBitSet.serializer.deserialize(in);
          ImmutableBitSet sAggrMetrics = ImmutableBitSet.serializer.deserialize(in);
          String[] sAggrMetricFuncs = BytesUtil.readAsciiStringArray(in);
          boolean sAllowPreAggr = (BytesUtil.readVInt(in) == 1);
          double sAggrCacheGB = in.getDouble();
          int storageScanRowNumThreshold = BytesUtil.readVInt(in);
          int storagePushDownLimit = BytesUtil.readVInt(in);
          long startTime = BytesUtil.readVLong(in);
          long timeout = BytesUtil.readVLong(in);
          String storageBehavior = BytesUtil.readUTFString(in);

          return new GTScanRequestBuilder()
              .setInfo(sInfo)
              .setRanges(sRanges)
              .setDimensions(sColumns)
              . //
              setAggrGroupBy(sAggGroupBy)
              .setAggrMetrics(sAggrMetrics)
              .setAggrMetricsFuncs(sAggrMetricFuncs)
              . //
              setFilterPushDown(sGTFilter)
              .setAllowStorageAggregation(sAllowPreAggr)
              .setAggCacheMemThreshold(sAggrCacheGB)
              . //
              setStorageScanRowNumThreshold(storageScanRowNumThreshold)
              .setStoragePushDownLimit(storagePushDownLimit)
              . //
              setStartTime(startTime)
              .setTimeout(timeout)
              .setStorageBehavior(storageBehavior)
              .createGTScanRequest();
        }
Example #2
0
        @Override
        public GTScanRequest deserialize(ByteBuffer in) {
          GTInfo sInfo = GTInfo.serializer.deserialize(in);

          List<GTScanRange> sRanges = Lists.newArrayList();
          int sRangesCount = BytesUtil.readVInt(in);
          for (int rangeIdx = 0; rangeIdx < sRangesCount; rangeIdx++) {
            GTRecord sPkStart = deserializeGTRecord(in, sInfo);
            GTRecord sPkEnd = deserializeGTRecord(in, sInfo);
            List<GTRecord> sFuzzyKeys = Lists.newArrayList();
            int sFuzzyKeySize = BytesUtil.readVInt(in);
            for (int i = 0; i < sFuzzyKeySize; i++) {
              sFuzzyKeys.add(deserializeGTRecord(in, sInfo));
            }
            GTScanRange sRange = new GTScanRange(sPkStart, sPkEnd, sFuzzyKeys);
            sRanges.add(sRange);
          }

          ImmutableBitSet sColumns = ImmutableBitSet.serializer.deserialize(in);
          TupleFilter sGTFilter = GTUtil.deserializeGTFilter(BytesUtil.readByteArray(in), sInfo);

          ImmutableBitSet sAggGroupBy = ImmutableBitSet.serializer.deserialize(in);
          ImmutableBitSet sAggrMetrics = ImmutableBitSet.serializer.deserialize(in);
          String[] sAggrMetricFuncs = BytesUtil.readAsciiStringArray(in);
          boolean sAllowPreAggr = (BytesUtil.readVInt(in) == 1);
          double sAggrCacheGB = in.getDouble();

          return new GTScanRequest(
              sInfo,
              sRanges,
              sColumns,
              sAggGroupBy,
              sAggrMetrics,
              sAggrMetricFuncs,
              sGTFilter,
              sAllowPreAggr,
              sAggrCacheGB);
        }