當前位置: 首頁>>代碼示例>>Java>>正文


Java BytesUtil.writeByteArray方法代碼示例

本文整理匯總了Java中org.apache.kylin.common.util.BytesUtil.writeByteArray方法的典型用法代碼示例。如果您正苦於以下問題:Java BytesUtil.writeByteArray方法的具體用法?Java BytesUtil.writeByteArray怎麽用?Java BytesUtil.writeByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.kylin.common.util.BytesUtil的用法示例。


在下文中一共展示了BytesUtil.writeByteArray方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: serialize

import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public void serialize(RawScan value, ByteBuffer out) {
    BytesUtil.writeByteArray(value.startKey, out);
    BytesUtil.writeByteArray(value.endKey, out);
    BytesUtil.writeVInt(value.hbaseColumns.size(), out);
    for (Pair<byte[], byte[]> hbaseColumn : value.hbaseColumns) {
        BytesUtil.writeByteArray(hbaseColumn.getFirst(), out);
        BytesUtil.writeByteArray(hbaseColumn.getSecond(), out);
    }
    BytesUtil.writeVInt(value.fuzzyKeys.size(), out);
    for (Pair<byte[], byte[]> fuzzyKey : value.fuzzyKeys) {
        BytesUtil.writeByteArray(fuzzyKey.getFirst(), out);
        BytesUtil.writeByteArray(fuzzyKey.getSecond(), out);
    }
    BytesUtil.writeVInt(value.hbaseCaching, out);
    BytesUtil.writeVInt(value.hbaseMaxResultSize, out);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:18,代碼來源:RawScan.java

示例2: writeDimensionEncoding

import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
private static void writeDimensionEncoding(DimensionEncoding encoding, ByteBuffer out) {
    try {
        if (encoding == null) {
            BytesUtil.writeVInt(1, out);
        } else {
            BytesUtil.writeVInt(0, out);

            if (encoding instanceof DictionaryDimEnc) {
                encoding = new TrimmedDimEnc(encoding.getLengthOfEncoding());
            }
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(baos);
            oos.writeObject(encoding);
            BytesUtil.writeByteArray(baos.toByteArray(), out);
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:20,代碼來源:TrimmedCubeCodeSystem.java

示例3: serialize

import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public void serialize(ByteArray value, ByteBuffer out) {
    if (value != null && value.array() != null) {
        BytesUtil.writeByteArray(value.array(), value.offset(), value.length(), out);
    } else {
        BytesUtil.writeByteArray(null, out);
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:9,代碼來源:ExtendedColumnSerializer.java

示例4: serialize

import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public void serialize(List<ByteArray> values, ByteBuffer out) {
    if (values == null) {
        BytesUtil.writeVInt(0, out);
    } else {
        BytesUtil.writeVInt(values.size(), out);
        for (ByteArray array : values) {
            if (!out.hasRemaining() || out.remaining() < array.length()) {
                throw new RuntimeException("BufferOverflow! Please use one higher cardinality column for dimension column when build RAW cube!");
            }
            BytesUtil.writeByteArray(BytesUtil.subarray(array.array(), array.offset(), array.offset() + array.length()), out);
        }
    }
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:15,代碼來源:RawSerializer.java

示例5: serialize

import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@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);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:37,代碼來源:GTScanRequest.java

示例6: serialize

import org.apache.kylin.common.util.BytesUtil; //導入方法依賴的package包/類
@Override
public void serialize(CoprocessorProjector value, ByteBuffer out) {
    BytesUtil.writeByteArray(value.groupByMask, out);
    BytesUtil.writeVInt(value.hasGroupby ? 1 : 0, out);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:6,代碼來源:CoprocessorProjector.java


注:本文中的org.apache.kylin.common.util.BytesUtil.writeByteArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。