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


Java ByteBufferUtil.writeWithShortLength方法代码示例

本文整理汇总了Java中org.apache.cassandra.utils.ByteBufferUtil.writeWithShortLength方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBufferUtil.writeWithShortLength方法的具体用法?Java ByteBufferUtil.writeWithShortLength怎么用?Java ByteBufferUtil.writeWithShortLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.utils.ByteBufferUtil的用法示例。


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

示例1: build

import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public ByteBuffer build()
{
    try (DataOutputBuffer out = new DataOutputBufferFixed(serializedSize))
    {
        if (isStatic)
            out.writeShort(STATIC_MARKER);

        for (int i = 0; i < components.size(); i++)
        {
            ByteBufferUtil.writeWithShortLength(components.get(i), out);
            out.write(endOfComponents[i]);
        }
        return ByteBuffer.wrap(out.getData(), 0, out.getLength());
    }
    catch (IOException e)
    {
        throw new RuntimeException(e);
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:20,代码来源:CompositeType.java

示例2: serialize

import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException
{
    ColumnDefinition column = subSel.column();
    ByteBufferUtil.writeWithShortLength(column.name.bytes, out);
    out.writeByte(subSel.kind().ordinal());
    switch (subSel.kind())
    {
        case SLICE:
            Slice slice = (Slice)subSel;
            column.cellPathSerializer().serialize(slice.from, out);
            column.cellPathSerializer().serialize(slice.to, out);
            break;
        case ELEMENT:
            Element eltSelection = (Element)subSel;
            column.cellPathSerializer().serialize(eltSelection.element, out);
            break;
        default:
            throw new AssertionError();
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:21,代码来源:ColumnSubselection.java

示例3: append

import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public void append(DecoratedKey key, RowIndexEntry indexEntry, long dataEnd, ByteBuffer indexInfo) throws IOException
{
    bf.add(key);
    long indexStart = indexFile.position();
    try
    {
        ByteBufferUtil.writeWithShortLength(key.getKey(), indexFile);
        rowIndexEntrySerializer.serialize(indexEntry, indexFile, indexInfo);
    }
    catch (IOException e)
    {
        throw new FSWriteError(e, indexFile.getPath());
    }
    long indexEnd = indexFile.position();

    if (logger.isTraceEnabled())
        logger.trace("wrote index entry: {} at {}", indexEntry, indexStart);

    summary.maybeAddEntry(key, indexStart, indexEnd, dataEnd);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:21,代码来源:BigTableWriter.java

示例4: writePartitionHeader

import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
private void writePartitionHeader(UnfilteredRowIterator iterator) throws IOException
{
    ByteBufferUtil.writeWithShortLength(iterator.partitionKey().getKey(), writer);
    DeletionTime.serializer.serialize(iterator.partitionLevelDeletion(), writer);
    if (header.hasStatic())
    {
        Row staticRow = iterator.staticRow();

        UnfilteredSerializer.serializer.serializeStaticRow(staticRow, header, writer, version);
        if (!observers.isEmpty())
            observers.forEach((o) -> o.nextUnfilteredCluster(staticRow));
    }
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:14,代码来源:ColumnIndex.java

示例5: serialize

import org.apache.cassandra.utils.ByteBufferUtil; //导入方法依赖的package包/类
public void serialize(PartitionPosition pos, DataOutputPlus out, int version) throws IOException
{
    Kind kind = pos.kind();
    out.writeByte(kind.ordinal());
    if (kind == Kind.ROW_KEY)
        ByteBufferUtil.writeWithShortLength(((DecoratedKey)pos).getKey(), out);
    else
        Token.serializer.serialize(pos.getToken(), out, version);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:10,代码来源:PartitionPosition.java


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