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


Java CBUtil.writeValue方法代码示例

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


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

示例1: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(QueryOptions options, ByteBuf dest, ProtocolVersion version)
{
    CBUtil.writeConsistencyLevel(options.getConsistency(), dest);

    EnumSet<Flag> flags = gatherFlags(options);
    if (version.isGreaterOrEqualTo(ProtocolVersion.V5))
        dest.writeInt(Flag.serialize(flags));
    else
        dest.writeByte((byte)Flag.serialize(flags));

    if (flags.contains(Flag.VALUES))
        CBUtil.writeValueList(options.getValues(), dest);
    if (flags.contains(Flag.PAGE_SIZE))
        dest.writeInt(options.getPageSize());
    if (flags.contains(Flag.PAGING_STATE))
        CBUtil.writeValue(options.getPagingState().serialize(version), dest);
    if (flags.contains(Flag.SERIAL_CONSISTENCY))
        CBUtil.writeConsistencyLevel(options.getSerialConsistency(), dest);
    if (flags.contains(Flag.TIMESTAMP))
        dest.writeLong(options.getSpecificOptions().timestamp);

    // Note that we don't really have to bother with NAMES_FOR_VALUES server side,
    // and in fact we never really encode QueryOptions, only decode them, so we
    // don't bother.
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:26,代码来源:QueryOptions.java

示例2: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(QueryOptions options, ByteBuf dest, int version)
{
    CBUtil.writeConsistencyLevel(options.getConsistency(), dest);

    EnumSet<Flag> flags = gatherFlags(options);
    dest.writeByte((byte)Flag.serialize(flags));

    if (flags.contains(Flag.VALUES))
        CBUtil.writeValueList(options.getValues(), dest);
    if (flags.contains(Flag.PAGE_SIZE))
        dest.writeInt(options.getPageSize());
    if (flags.contains(Flag.PAGING_STATE))
        CBUtil.writeValue(options.getPagingState().serialize(version), dest);
    if (flags.contains(Flag.SERIAL_CONSISTENCY))
        CBUtil.writeConsistencyLevel(options.getSerialConsistency(), dest);
    if (flags.contains(Flag.TIMESTAMP))
        dest.writeLong(options.getSpecificOptions().timestamp);

    // Note that we don't really have to bother with NAMES_FOR_VALUES server side,
    // and in fact we never really encode QueryOptions, only decode them, so we
    // don't bother.
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:23,代码来源:QueryOptions.java

示例3: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(AuthChallenge challenge, ByteBuf dest, int version)
{
    CBUtil.writeValue(challenge.token, dest);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:AuthChallenge.java

示例4: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(AuthResponse response, ByteBuf dest, int version)
{
    CBUtil.writeValue(response.token, dest);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:AuthResponse.java

示例5: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(AuthSuccess success, ByteBuf dest, int version)
{
    CBUtil.writeValue(success.token, dest);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:AuthSuccess.java

示例6: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(AuthChallenge challenge, ChannelBuffer dest, int version)
{
    CBUtil.writeValue(challenge.token, dest);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:5,代码来源:AuthChallenge.java

示例7: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(AuthResponse response, ChannelBuffer dest, int version)
{
    CBUtil.writeValue(response.token, dest);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:5,代码来源:AuthResponse.java

示例8: encode

import org.apache.cassandra.transport.CBUtil; //导入方法依赖的package包/类
public void encode(AuthSuccess success, ChannelBuffer dest, int version)
{
    CBUtil.writeValue(success.token, dest);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:5,代码来源:AuthSuccess.java


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