Java Code Examples for org.apache.kylin.common.util.BytesUtil#writeVLong()

The following examples show how to use org.apache.kylin.common.util.BytesUtil#writeVLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LongSerializer.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Long value, ByteBuffer out) {
    BytesUtil.writeVLong(value, out);
}
 
Example 2
Source File: GTScanRequest.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(GTScanRequest value, ByteBuffer out) {
    final int serialLevel = KylinConfig.getInstanceFromEnv().getGTScanRequestSerializationLevel();

    GTInfo.serializer.serialize(value.info, out);

    BytesUtil.writeVInt(value.ranges.size(), out);
    for (GTScanRange range : value.ranges) {
        serializeGTRecord(range.pkStart, out);
        serializeGTRecord(range.pkEnd, out);
        BytesUtil.writeVInt(range.fuzzyKeys.size(), out);
        for (GTRecord f : range.fuzzyKeys) {
            serializeGTRecord(f, out);
        }
    }

    ImmutableBitSet.serializer.serialize(value.columns, out);
    BytesUtil.writeByteArray(GTUtil.serializeGTFilter(value.filterPushDown, value.info), out);

    if (serialLevel >= SERIAL_1_HAVING_FILTER) {
        BytesUtil.writeByteArray(
                TupleFilterSerializer.serialize(value.havingFilterPushDown, StringCodeSystem.INSTANCE), out);
    }

    ImmutableBitSet.serializer.serialize(value.aggrGroupBy, out);
    ImmutableBitSet.serializer.serialize(value.aggrMetrics, out);
    BytesUtil.writeAsciiStringArray(value.aggrMetricsFuncs, out);
    BytesUtil.writeVInt(value.allowStorageAggregation ? 1 : 0, out);
    out.putDouble(value.aggCacheMemThreshold);
    BytesUtil.writeUTFString(value.getStorageLimitLevel().name(), out);
    BytesUtil.writeVInt(value.storageScanRowNumThreshold, out);
    BytesUtil.writeVInt(value.storagePushDownLimit, out);
    BytesUtil.writeVLong(value.startTime, out);
    BytesUtil.writeVLong(value.timeout, out);
    BytesUtil.writeUTFString(value.storageBehavior, out);

    // for dynamic related info
    ImmutableBitSet.serializer.serialize(value.dynamicCols, out);

    BytesUtil.writeVInt(value.tupleExpressionMap.size(), out);
    for (int c : value.tupleExpressionMap.keySet()) {
        TupleExpression tupleExpr = value.tupleExpressionMap.get(c);
        BytesUtil.writeVInt(c, out);
        BytesUtil.writeByteArray(TupleExpressionSerializer.serialize(tupleExpr,
                GTUtil.wrap(value.info.codeSystem.getComparator())), out);
    }
    ImmutableBitSet.serializer.serialize(value.rtAggrMetrics, out);
}
 
Example 3
Source File: SegmentStartTimeKeySerializer.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Override
public void writeKey(ByteBuffer out, Long segStartTime) {
    BytesUtil.writeVLong(segStartTime, out);
}
 
Example 4
Source File: LongSerializer.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(Long value, ByteBuffer out) {
    BytesUtil.writeVLong(value, out);
}
 
Example 5
Source File: GTScanRequest.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(GTScanRequest value, ByteBuffer out) {
    final int serialLevel = KylinConfig.getInstanceFromEnv().getGTScanRequestSerializationLevel();

    GTInfo.serializer.serialize(value.info, out);

    BytesUtil.writeVInt(value.ranges.size(), out);
    for (GTScanRange range : value.ranges) {
        serializeGTRecord(range.pkStart, out);
        serializeGTRecord(range.pkEnd, out);
        BytesUtil.writeVInt(range.fuzzyKeys.size(), out);
        for (GTRecord f : range.fuzzyKeys) {
            serializeGTRecord(f, out);
        }
    }

    ImmutableBitSet.serializer.serialize(value.columns, out);
    BytesUtil.writeByteArray(GTUtil.serializeGTFilter(value.filterPushDown, value.info), out);

    if (serialLevel >= SERIAL_1_HAVING_FILTER) {
        BytesUtil.writeByteArray(
                TupleFilterSerializer.serialize(value.havingFilterPushDown, StringCodeSystem.INSTANCE), out);
    }

    ImmutableBitSet.serializer.serialize(value.aggrGroupBy, out);
    ImmutableBitSet.serializer.serialize(value.aggrMetrics, out);
    BytesUtil.writeAsciiStringArray(value.aggrMetricsFuncs, out);
    BytesUtil.writeVInt(value.allowStorageAggregation ? 1 : 0, out);
    out.putDouble(value.aggCacheMemThreshold);
    BytesUtil.writeUTFString(value.getStorageLimitLevel().name(), out);
    BytesUtil.writeVInt(value.storageScanRowNumThreshold, out);
    BytesUtil.writeVInt(value.storagePushDownLimit, out);
    BytesUtil.writeVLong(value.startTime, out);
    BytesUtil.writeVLong(value.timeout, out);
    BytesUtil.writeUTFString(value.storageBehavior, out);

    // for dynamic related info
    ImmutableBitSet.serializer.serialize(value.dynamicCols, out);

    BytesUtil.writeVInt(value.tupleExpressionMap.size(), out);
    for (int c : value.tupleExpressionMap.keySet()) {
        TupleExpression tupleExpr = value.tupleExpressionMap.get(c);
        BytesUtil.writeVInt(c, out);
        BytesUtil.writeByteArray(TupleExpressionSerializer.serialize(tupleExpr,
                GTUtil.wrap(value.info.codeSystem.getComparator())), out);
    }
    ImmutableBitSet.serializer.serialize(value.rtAggrMetrics, out);

    GTTwoLayerAggregateParam.serializer.serialize(value.twoLayerAggParam, out);
}
 
Example 6
Source File: LongSerializer.java    From Kylin with Apache License 2.0 4 votes vote down vote up
@Override
public void serialize(LongWritable value, ByteBuffer out) {
    BytesUtil.writeVLong(value.get(), out);
}