本文整理汇总了Java中org.apache.cassandra.net.CompactEndpointSerializationHelper类的典型用法代码示例。如果您正苦于以下问题:Java CompactEndpointSerializationHelper类的具体用法?Java CompactEndpointSerializationHelper怎么用?Java CompactEndpointSerializationHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompactEndpointSerializationHelper类属于org.apache.cassandra.net包,在下文中一共展示了CompactEndpointSerializationHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public GossipDigestAck deserialize(DataInput dis, int version) throws IOException
{
List<GossipDigest> gDigestList = GossipDigestSerializationHelper.deserialize(dis, version);
if (version < MessagingService.VERSION_12)
dis.readBoolean(); // 0.6 compatibility
int size = dis.readInt();
Map<InetAddress, EndpointState> epStateMap = new HashMap<InetAddress, EndpointState>(size);
for (int i = 0; i < size; ++i)
{
InetAddress ep = CompactEndpointSerializationHelper.deserialize(dis);
EndpointState epState = EndpointState.serializer.deserialize(dis, version);
epStateMap.put(ep, epState);
}
return new GossipDigestAck(gDigestList, epStateMap);
}
示例2: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public void serialize(StreamRequest srm, DataOutput dos, int version) throws IOException
{
UUIDSerializer.serializer.serialize(srm.sessionId, dos, MessagingService.current_version);
CompactEndpointSerializationHelper.serialize(srm.target, dos);
if (srm.file != null)
{
dos.writeBoolean(true);
PendingFile.serializer.serialize(srm.file, dos, version);
}
else
{
dos.writeBoolean(false);
dos.writeUTF(srm.table);
dos.writeInt(srm.ranges.size());
for (Range<Token> range : srm.ranges)
AbstractBounds.serializer.serialize(range, dos, version);
dos.writeUTF(srm.type.name());
dos.writeInt(Iterables.size(srm.columnFamilies));
for (ColumnFamilyStore cfs : srm.columnFamilies)
ColumnFamily.serializer.serializeCfId(cfs.metadata.cfId, dos, version);
}
}
示例3: serializedSize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public long serializedSize(StreamRequest sr, int version)
{
long size = TypeSizes.NATIVE.sizeof(sr.sessionId);
size += CompactEndpointSerializationHelper.serializedSize(sr.target);
size += TypeSizes.NATIVE.sizeof(true);
if (sr.file != null)
return size + PendingFile.serializer.serializedSize(sr.file, version);
size += TypeSizes.NATIVE.sizeof(sr.table);
size += TypeSizes.NATIVE.sizeof(sr.ranges.size());
for (Range<Token> range : sr.ranges)
size += AbstractBounds.serializer.serializedSize(range, version);
size += TypeSizes.NATIVE.sizeof(sr.type.name());
size += TypeSizes.NATIVE.sizeof(Iterables.size(sr.columnFamilies));
for (ColumnFamilyStore cfs : sr.columnFamilies)
size += ColumnFamily.serializer.cfIdSerializedSize(cfs.metadata.cfId, TypeSizes.NATIVE, version);
return size;
}
示例4: deserialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public GossipDigest deserialize(DataInput in, int version) throws IOException
{
InetAddress endpoint = CompactEndpointSerializationHelper.deserialize(in);
int generation = in.readInt();
int maxVersion = in.readInt();
return new GossipDigest(endpoint, generation, maxVersion);
}
示例5: serializedSize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public long serializedSize(GossipDigest gDigest, int version)
{
long size = CompactEndpointSerializationHelper.serializedSize(gDigest.endpoint);
size += TypeSizes.NATIVE.sizeof(gDigest.generation);
size += TypeSizes.NATIVE.sizeof(gDigest.maxVersion);
return size;
}
示例6: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public void serialize(GossipDigestAck2 ack2, DataOutputPlus out, int version) throws IOException
{
out.writeInt(ack2.epStateMap.size());
for (Map.Entry<InetAddress, EndpointState> entry : ack2.epStateMap.entrySet())
{
InetAddress ep = entry.getKey();
CompactEndpointSerializationHelper.serialize(ep, out);
EndpointState.serializer.serialize(entry.getValue(), out, version);
}
}
示例7: deserialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public GossipDigestAck2 deserialize(DataInput in, int version) throws IOException
{
int size = in.readInt();
Map<InetAddress, EndpointState> epStateMap = new HashMap<InetAddress, EndpointState>(size);
for (int i = 0; i < size; ++i)
{
InetAddress ep = CompactEndpointSerializationHelper.deserialize(in);
EndpointState epState = EndpointState.serializer.deserialize(in, version);
epStateMap.put(ep, epState);
}
return new GossipDigestAck2(epStateMap);
}
示例8: serializedSize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public long serializedSize(GossipDigestAck2 ack2, int version)
{
long size = TypeSizes.NATIVE.sizeof(ack2.epStateMap.size());
for (Map.Entry<InetAddress, EndpointState> entry : ack2.epStateMap.entrySet())
size += CompactEndpointSerializationHelper.serializedSize(entry.getKey())
+ EndpointState.serializer.serializedSize(entry.getValue(), version);
return size;
}
示例9: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public void serialize(GossipDigestAck gDigestAckMessage, DataOutputPlus out, int version) throws IOException
{
GossipDigestSerializationHelper.serialize(gDigestAckMessage.gDigestList, out, version);
out.writeInt(gDigestAckMessage.epStateMap.size());
for (Map.Entry<InetAddress, EndpointState> entry : gDigestAckMessage.epStateMap.entrySet())
{
InetAddress ep = entry.getKey();
CompactEndpointSerializationHelper.serialize(ep, out);
EndpointState.serializer.serialize(entry.getValue(), out, version);
}
}
示例10: deserialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public GossipDigestAck deserialize(DataInput in, int version) throws IOException
{
List<GossipDigest> gDigestList = GossipDigestSerializationHelper.deserialize(in, version);
int size = in.readInt();
Map<InetAddress, EndpointState> epStateMap = new HashMap<InetAddress, EndpointState>(size);
for (int i = 0; i < size; ++i)
{
InetAddress ep = CompactEndpointSerializationHelper.deserialize(in);
EndpointState epState = EndpointState.serializer.deserialize(in, version);
epStateMap.put(ep, epState);
}
return new GossipDigestAck(gDigestList, epStateMap);
}
示例11: serializedSize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public long serializedSize(GossipDigestAck ack, int version)
{
int size = GossipDigestSerializationHelper.serializedSize(ack.gDigestList, version);
size += TypeSizes.NATIVE.sizeof(ack.epStateMap.size());
for (Map.Entry<InetAddress, EndpointState> entry : ack.epStateMap.entrySet())
size += CompactEndpointSerializationHelper.serializedSize(entry.getKey())
+ EndpointState.serializer.serializedSize(entry.getValue(), version);
return size;
}
示例12: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public void serialize(SyncRequest message, DataOutputPlus out, int version) throws IOException
{
RepairJobDesc.serializer.serialize(message.desc, out, version);
CompactEndpointSerializationHelper.serialize(message.initiator, out);
CompactEndpointSerializationHelper.serialize(message.src, out);
CompactEndpointSerializationHelper.serialize(message.dst, out);
out.writeInt(message.ranges.size());
for (Range<Token> range : message.ranges)
AbstractBounds.serializer.serialize(range, out, version);
}
示例13: deserialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public SyncRequest deserialize(DataInput in, int version) throws IOException
{
RepairJobDesc desc = RepairJobDesc.serializer.deserialize(in, version);
InetAddress owner = CompactEndpointSerializationHelper.deserialize(in);
InetAddress src = CompactEndpointSerializationHelper.deserialize(in);
InetAddress dst = CompactEndpointSerializationHelper.deserialize(in);
int rangesCount = in.readInt();
List<Range<Token>> ranges = new ArrayList<>(rangesCount);
for (int i = 0; i < rangesCount; ++i)
ranges.add((Range<Token>) AbstractBounds.serializer.deserialize(in, version).toTokenBounds());
return new SyncRequest(desc, owner, src, dst, ranges);
}
示例14: serializedSize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public long serializedSize(SyncRequest message, int version)
{
long size = RepairJobDesc.serializer.serializedSize(message.desc, version);
size += 3 * CompactEndpointSerializationHelper.serializedSize(message.initiator);
size += TypeSizes.NATIVE.sizeof(message.ranges.size());
for (Range<Token> range : message.ranges)
size += AbstractBounds.serializer.serializedSize(range, version);
return size;
}
示例15: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入依赖的package包/类
public void serialize(StreamInitMessage message, DataOutputPlus out, int version) throws IOException
{
CompactEndpointSerializationHelper.serialize(message.from, out);
out.writeInt(message.sessionIndex);
UUIDSerializer.serializer.serialize(message.planId, out, MessagingService.current_version);
out.writeUTF(message.description);
out.writeBoolean(message.isForOutgoing);
}