本文整理汇总了Java中org.apache.cassandra.net.CompactEndpointSerializationHelper.serialize方法的典型用法代码示例。如果您正苦于以下问题:Java CompactEndpointSerializationHelper.serialize方法的具体用法?Java CompactEndpointSerializationHelper.serialize怎么用?Java CompactEndpointSerializationHelper.serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.net.CompactEndpointSerializationHelper
的用法示例。
在下文中一共展示了CompactEndpointSerializationHelper.serialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
示例4: 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);
}
示例5: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(GossipDigestAck2 ack2, DataOutput 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);
}
}
示例6: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(GossipDigestAck gDigestAckMessage, DataOutput 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);
}
}
示例7: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(SyncRequest message, DataOutput 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);
}
示例8: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(StreamInitMessage message, DataOutput out, int version) throws IOException
{
CompactEndpointSerializationHelper.serialize(message.from, out);
UUIDSerializer.serializer.serialize(message.planId, out, MessagingService.current_version);
out.writeUTF(message.description);
out.writeBoolean(message.isForOutgoing);
}
示例9: 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)
{
MessagingService.validatePartitioner(range);
AbstractBounds.tokenSerializer.serialize(range, out, version);
}
}
示例10: 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);
out.writeBoolean(message.keepSSTableLevel);
out.writeBoolean(message.isIncremental);
}
示例11: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(GossipDigestAck2 ack2, DataOutput dos, int version) throws IOException
{
dos.writeInt(ack2.epStateMap.size());
for (Map.Entry<InetAddress, EndpointState> entry : ack2.epStateMap.entrySet())
{
InetAddress ep = entry.getKey();
CompactEndpointSerializationHelper.serialize(ep, dos);
EndpointState.serializer.serialize(entry.getValue(), dos, version);
}
}
示例12: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(StreamingRepairTask task, DataOutput dos, int version) throws IOException
{
UUIDSerializer.serializer.serialize(task.id, dos, version);
CompactEndpointSerializationHelper.serialize(task.owner, dos);
CompactEndpointSerializationHelper.serialize(task.src, dos);
CompactEndpointSerializationHelper.serialize(task.dst, dos);
dos.writeUTF(task.tableName);
dos.writeUTF(task.cfName);
dos.writeInt(task.ranges.size());
for (Range<Token> range : task.ranges)
AbstractBounds.serializer.serialize(range, dos, version);
// We don't serialize the callback on purpose
}
示例13: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(GossipDigestAck gDigestAckMessage, DataOutput dos, int version) throws IOException
{
GossipDigestSerializationHelper.serialize(gDigestAckMessage.gDigestList, dos, version);
if (version < MessagingService.VERSION_12)
dos.writeBoolean(true); // 0.6 compatibility
dos.writeInt(gDigestAckMessage.epStateMap.size());
for (Map.Entry<InetAddress, EndpointState> entry : gDigestAckMessage.epStateMap.entrySet())
{
InetAddress ep = entry.getKey();
CompactEndpointSerializationHelper.serialize(ep, dos);
EndpointState.serializer.serialize(entry.getValue(), dos, version);
}
}
示例14: serialize
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public void serialize(StreamInitMessage message, DataOutputPlus out, int version) throws IOException
{
CompactEndpointSerializationHelper.serialize(message.from, out);
UUIDSerializer.serializer.serialize(message.planId, out, MessagingService.current_version);
out.writeUTF(message.description);
out.writeBoolean(message.isForOutgoing);
}
示例15: connect
import org.apache.cassandra.net.CompactEndpointSerializationHelper; //导入方法依赖的package包/类
public boolean connect() {
long start = System.nanoTime();
long timeout = TimeUnit.MILLISECONDS.toNanos(DatabaseDescriptor.getRpcTimeout());
while (System.nanoTime() - start < timeout) {
targetVersion = 10;
try {
SocketChannel channel = SocketChannel.open();
channel.connect(new InetSocketAddress(host, DatabaseDescriptor.getStoragePort()));
socket = channel.socket();
socket.setTcpNoDelay(true);
if (DatabaseDescriptor.getInternodeSendBufferSize() != 0) {
try {
socket.setSendBufferSize(DatabaseDescriptor.getInternodeSendBufferSize());
} catch (SocketException se) {
System.err.println("Failed to set send buffer size on internode socket." + se);
}
}
// SocketChannel may be null when using SSL
WritableByteChannel ch = socket.getChannel();
out = new BufferedDataOutputStreamPlus(ch != null ? ch : Channels.newChannel(socket.getOutputStream()), BUFFER_SIZE);
out.writeInt(MessagingService.PROTOCOL_MAGIC);
writeHeader(out, targetVersion, false);
out.flush();
DataInputStream in = new DataInputStream(socket.getInputStream());
int maxTargetVersion = in.readInt();
MessagingService.instance().setVersion(host, maxTargetVersion);
out.writeInt(MessagingService.current_version);
CompactEndpointSerializationHelper.serialize(FBUtilities.getBroadcastAddress(), out);
out.flush();
return true;
} catch (IOException e) {
socket = null;
e.printStackTrace();
System.err.println("unable to connect to " + host + e);
Uninterruptibles.sleepUninterruptibly(OPEN_RETRY_DELAY, TimeUnit.MILLISECONDS);
}
}
return false;
}