Search in sources :

Example 11 with ServerConnectionManager

use of com.hazelcast.internal.server.ServerConnectionManager in project hazelcast by hazelcast.

the class HazelcastTestSupport method toPacket.

// ###########################################
// ########## implementation getter ##########
// ###########################################
public static Packet toPacket(HazelcastInstance local, HazelcastInstance remote, Operation operation) {
    InternalSerializationService serializationService = Accessors.getSerializationService(local);
    ServerConnectionManager connectionManager = Accessors.getConnectionManager(local);
    return new Packet(serializationService.toBytes(operation), operation.getPartitionId()).setPacketType(Packet.Type.OPERATION).setConn(connectionManager.get(Accessors.getAddress(remote)));
}
Also used : Packet(com.hazelcast.internal.nio.Packet) ServerConnectionManager(com.hazelcast.internal.server.ServerConnectionManager) InternalSerializationService(com.hazelcast.internal.serialization.InternalSerializationService)

Aggregations

ServerConnectionManager (com.hazelcast.internal.server.ServerConnectionManager)11 Address (com.hazelcast.cluster.Address)3 HazelcastInstance (com.hazelcast.core.HazelcastInstance)3 ServerConnection (com.hazelcast.internal.server.ServerConnection)3 Node (com.hazelcast.instance.impl.Node)2 Packet (com.hazelcast.internal.nio.Packet)2 Test (org.junit.Test)2 ClusterState (com.hazelcast.cluster.ClusterState)1 CPGroup (com.hazelcast.cp.CPGroup)1 CPGroupId (com.hazelcast.cp.CPGroupId)1 CPMember (com.hazelcast.cp.CPMember)1 CPSubsystem (com.hazelcast.cp.CPSubsystem)1 CPSubsystemManagementService (com.hazelcast.cp.CPSubsystemManagementService)1 CPSession (com.hazelcast.cp.session.CPSession)1 CLIENT (com.hazelcast.instance.EndpointQualifier.CLIENT)1 MEMCACHE (com.hazelcast.instance.EndpointQualifier.MEMCACHE)1 HazelcastInstanceFactory.newHazelcastInstance (com.hazelcast.instance.impl.HazelcastInstanceFactory.newHazelcastInstance)1 NodeState (com.hazelcast.instance.impl.NodeState)1 OutOfMemoryErrorDispatcher (com.hazelcast.instance.impl.OutOfMemoryErrorDispatcher)1 ADD (com.hazelcast.internal.ascii.TextCommandConstants.TextCommandType.ADD)1