本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
示例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);
}