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


Java IVersionedSerializer.deserialize方法代码示例

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


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

示例1: serializeAndDeserializeReadMessage

import org.apache.cassandra.io.IVersionedSerializer; //导入方法依赖的package包/类
private ReadCommand serializeAndDeserializeReadMessage(ReadCommand rm) throws IOException
{
    IVersionedSerializer<ReadCommand> rms = ReadCommand.serializer;
    DataOutputBuffer out = new DataOutputBuffer();

    rms.serialize(rm, out, MessagingService.current_version);

    DataInputPlus dis = new DataInputBuffer(out.getData());
    return rms.deserialize(dis, MessagingService.current_version);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:11,代码来源:ReadMessageTest.java

示例2: read

import org.apache.cassandra.io.IVersionedSerializer; //导入方法依赖的package包/类
public static <T2> MessageIn<T2> read(DataInput in, int version, int id) throws IOException
{
    InetAddress from = CompactEndpointSerializationHelper.deserialize(in);

    MessagingService.Verb verb = MessagingService.Verb.values()[in.readInt()];
    int parameterCount = in.readInt();
    Map<String, byte[]> parameters;
    if (parameterCount == 0)
    {
        parameters = Collections.emptyMap();
    }
    else
    {
        ImmutableMap.Builder<String, byte[]> builder = ImmutableMap.builder();
        for (int i = 0; i < parameterCount; i++)
        {
            String key = in.readUTF();
            byte[] value = new byte[in.readInt()];
            in.readFully(value);
            builder.put(key, value);
        }
        parameters = builder.build();
    }

    int payloadSize = in.readInt();
    IVersionedSerializer<T2> serializer = (IVersionedSerializer<T2>) MessagingService.verbSerializers.get(verb);
    if (serializer instanceof MessagingService.CallbackDeterminedSerializer)
    {
        CallbackInfo callback = MessagingService.instance().getRegisteredCallback(id);
        if (callback == null)
        {
            // reply for expired callback.  we'll have to skip it.
            FileUtils.skipBytesFully(in, payloadSize);
            return null;
        }
        serializer = (IVersionedSerializer<T2>) callback.serializer;
    }
    if (payloadSize == 0 || serializer == null)
        return create(from, null, parameters, verb, version);
    T2 payload = serializer.deserialize(in, version);
    return MessageIn.create(from, payload, parameters, verb, version);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:43,代码来源:MessageIn.java

示例3: read

import org.apache.cassandra.io.IVersionedSerializer; //导入方法依赖的package包/类
public static <T2> MessageIn<T2> read(DataInputPlus in, int version, int id) throws IOException
{
    InetAddress from = CompactEndpointSerializationHelper.deserialize(in);

    MessagingService.Verb verb = MessagingService.Verb.values()[in.readInt()];
    int parameterCount = in.readInt();
    Map<String, byte[]> parameters;
    if (parameterCount == 0)
    {
        parameters = Collections.emptyMap();
    }
    else
    {
        ImmutableMap.Builder<String, byte[]> builder = ImmutableMap.builder();
        for (int i = 0; i < parameterCount; i++)
        {
            String key = in.readUTF();
            byte[] value = new byte[in.readInt()];
            in.readFully(value);
            builder.put(key, value);
        }
        parameters = builder.build();
    }

    int payloadSize = in.readInt();
    IVersionedSerializer<T2> serializer = (IVersionedSerializer<T2>) MessagingService.verbSerializers.get(verb);
    if (serializer instanceof MessagingService.CallbackDeterminedSerializer)
    {
        CallbackInfo callback = MessagingService.instance().getRegisteredCallback(id);
        if (callback == null)
        {
            // reply for expired callback.  we'll have to skip it.
            in.skipBytesFully(payloadSize);
            return null;
        }
        serializer = (IVersionedSerializer<T2>) callback.serializer;
    }
    if (payloadSize == 0 || serializer == null)
        return create(from, null, parameters, verb, version);
    T2 payload = serializer.deserialize(in, version);
    return MessageIn.create(from, payload, parameters, verb, version);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:43,代码来源:MessageIn.java

示例4: read

import org.apache.cassandra.io.IVersionedSerializer; //导入方法依赖的package包/类
public static <T2> MessageIn<T2> read(DataInput in, int version, String id) throws IOException
{
    InetAddress from = CompactEndpointSerializationHelper.deserialize(in);

    MessagingService.Verb verb = MessagingService.Verb.values()[in.readInt()];
    int parameterCount = in.readInt();
    Map<String, byte[]> parameters;
    if (parameterCount == 0)
    {
        parameters = Collections.emptyMap();
    }
    else
    {
        ImmutableMap.Builder<String, byte[]> builder = ImmutableMap.builder();
        for (int i = 0; i < parameterCount; i++)
        {
            String key = in.readUTF();
            byte[] value = new byte[in.readInt()];
            in.readFully(value);
            builder.put(key, value);
        }
        parameters = builder.build();
    }

    int payloadSize = in.readInt();
    IVersionedSerializer<T2> serializer = (IVersionedSerializer<T2>) MessagingService.verbSerializers.get(verb);
    if (serializer instanceof MessagingService.CallbackDeterminedSerializer)
    {
        CallbackInfo callback = MessagingService.instance().getRegisteredCallback(id);
        if (callback == null)
        {
            // reply for expired callback.  we'll have to skip it.
            FileUtils.skipBytesFully(in, payloadSize);
            return null;
        }
        serializer = (IVersionedSerializer<T2>) callback.serializer;
    }
    if (payloadSize == 0 || serializer == null)
        return create(from, null, parameters, verb, version);
    T2 payload = serializer.deserialize(in, version);
    return MessageIn.create(from, payload, parameters, verb, version);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:43,代码来源:MessageIn.java


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