当前位置: 首页>>代码示例>>Java>>正文


Java BytesSerializer类代码示例

本文整理汇总了Java中org.apache.kylin.common.util.BytesSerializer的典型用法代码示例。如果您正苦于以下问题:Java BytesSerializer类的具体用法?Java BytesSerializer怎么用?Java BytesSerializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BytesSerializer类属于org.apache.kylin.common.util包,在下文中一共展示了BytesSerializer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serializeGTScanReq

import org.apache.kylin.common.util.BytesSerializer; //导入依赖的package包/类
private ByteString serializeGTScanReq(GTScanRequest scanRequest) {
    ByteString scanRequestByteString;
    int scanRequestBufferSize = BytesSerializer.SERIALIZE_BUFFER_SIZE;
    while (true) {
        try {
            ByteBuffer buffer = ByteBuffer.allocate(scanRequestBufferSize);
            GTScanRequest.serializer.serialize(scanRequest, buffer);
            buffer.flip();
            scanRequestByteString = HBaseZeroCopyByteString.wrap(buffer.array(), buffer.position(), buffer.limit());
            break;
        } catch (BufferOverflowException boe) {
            logger.info("Buffer size {} cannot hold the scan request, resizing to 4 times", scanRequestBufferSize);
            scanRequestBufferSize *= 4;
        }
    }
    return scanRequestByteString;
}
 
开发者ID:apache,项目名称:kylin,代码行数:18,代码来源:CubeHBaseEndpointRPC.java

示例2: serializeRawScans

import org.apache.kylin.common.util.BytesSerializer; //导入依赖的package包/类
private ByteString serializeRawScans(List<RawScan> rawScans) {
    ByteString rawScanByteString;
    int rawScanBufferSize = BytesSerializer.SERIALIZE_BUFFER_SIZE;
    while (true) {
        try {
            ByteBuffer rawScanBuffer = ByteBuffer.allocate(rawScanBufferSize);
            BytesUtil.writeVInt(rawScans.size(), rawScanBuffer);
            for (RawScan rs : rawScans) {
                RawScan.serializer.serialize(rs, rawScanBuffer);
            }
            rawScanBuffer.flip();
            rawScanByteString = HBaseZeroCopyByteString.wrap(rawScanBuffer.array(), rawScanBuffer.position(), rawScanBuffer.limit());
            break;
        } catch (BufferOverflowException boe) {
            logger.info("Buffer size {} cannot hold the raw scans, resizing to 4 times", rawScanBufferSize);
            rawScanBufferSize *= 4;
        }
    }
    return rawScanByteString;
}
 
开发者ID:apache,项目名称:kylin,代码行数:21,代码来源:CubeHBaseEndpointRPC.java

示例3: useDeserializedGTScanRequest

import org.apache.kylin.common.util.BytesSerializer; //导入依赖的package包/类
public static GTScanRequest useDeserializedGTScanRequest(GTScanRequest origin) {
    ByteBuffer buffer = ByteBuffer.allocate(BytesSerializer.SERIALIZE_BUFFER_SIZE);
    GTScanRequest.serializer.serialize(origin, buffer);
    buffer.flip();
    GTScanRequest sGTScanRequest = GTScanRequest.serializer.deserialize(buffer);

    Assert.assertArrayEquals(origin.getAggrMetricsFuncs(), sGTScanRequest.getAggrMetricsFuncs());
    Assert.assertEquals(origin.getAggCacheMemThreshold(), sGTScanRequest.getAggCacheMemThreshold(), 0.01);
    return sGTScanRequest;
}
 
开发者ID:apache,项目名称:kylin,代码行数:11,代码来源:DictGridTableTest.java

示例4: serialize

import org.apache.kylin.common.util.BytesSerializer; //导入依赖的package包/类
public static byte[] serialize(CoprocessorRowType o) {
    ByteBuffer buf = ByteBuffer.allocate(BytesSerializer.SERIALIZE_BUFFER_SIZE);
    serializer.serialize(o, buf);
    byte[] result = new byte[buf.position()];
    System.arraycopy(buf.array(), 0, result, 0, buf.position());
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:8,代码来源:CoprocessorRowType.java

示例5: serialize

import org.apache.kylin.common.util.BytesSerializer; //导入依赖的package包/类
public static byte[] serialize(CoprocessorProjector o) {
    ByteBuffer buf = ByteBuffer.allocate(BytesSerializer.SERIALIZE_BUFFER_SIZE);
    serializer.serialize(o, buf);
    byte[] result = new byte[buf.position()];
    System.arraycopy(buf.array(), 0, result, 0, buf.position());
    return result;
}
 
开发者ID:apache,项目名称:kylin,代码行数:8,代码来源:CoprocessorProjector.java


注:本文中的org.apache.kylin.common.util.BytesSerializer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。