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