Search in sources :

Example 26 with PinpointSocket

use of com.navercorp.pinpoint.rpc.PinpointSocket in project pinpoint by naver.

the class CollectorClusterConnector method connect.

PinpointSocket connect(Address address) {
    Objects.requireNonNull(clientFactory, "not started.");
    Objects.requireNonNull(address, "address");
    ClusterAddressProvider clusterAddressProvider = new ClusterAddressProvider(address);
    PinpointSocket socket = ClientFactoryUtils.createPinpointClient(clusterAddressProvider, clientFactory);
    return socket;
}
Also used : PinpointSocket(com.navercorp.pinpoint.rpc.PinpointSocket) ClusterAddressProvider(com.navercorp.pinpoint.collector.cluster.ClusterAddressProvider)

Example 27 with PinpointSocket

use of com.navercorp.pinpoint.rpc.PinpointSocket in project pinpoint by naver.

the class ClusterManager method getSocket.

public List<PinpointSocket> getSocket(String applicationName, String agentId, long startTimeStamp) {
    if (!isEnabled()) {
        return Collections.emptyList();
    }
    List<String> clusterIdList = clusterDataManager.getRegisteredAgentList(applicationName, agentId, startTimeStamp);
    if (clusterIdList.isEmpty()) {
        logger.warn("{}/{}/{} couldn't find agent.", applicationName, agentId, startTimeStamp);
        return Collections.emptyList();
    } else if (clusterIdList.size() > 1) {
        logger.warn("{}/{}/{} found duplicate agent {}.", applicationName, agentId, startTimeStamp, clusterIdList);
    }
    List<PinpointSocket> pinpointSocketList = new ArrayList<>(clusterIdList.size());
    for (String clusterId : clusterIdList) {
        PinpointSocket pinpointSocket = clusterConnectionManager.getSocket(clusterId);
        pinpointSocketList.add(pinpointSocket);
    }
    return pinpointSocketList;
}
Also used : PinpointSocket(com.navercorp.pinpoint.rpc.PinpointSocket) ArrayList(java.util.ArrayList)

Aggregations

PinpointSocket (com.navercorp.pinpoint.rpc.PinpointSocket)27 TestPinpointServerAcceptor (com.navercorp.pinpoint.test.server.TestPinpointServerAcceptor)10 Test (org.junit.Test)10 TestPinpointClient (com.navercorp.pinpoint.test.client.TestPinpointClient)8 PinpointServer (com.navercorp.pinpoint.rpc.server.PinpointServer)5 TCommandTransfer (com.navercorp.pinpoint.thrift.dto.command.TCommandTransfer)5 Map (java.util.Map)5 ServerMessageListener (com.navercorp.pinpoint.rpc.server.ServerMessageListener)3 RecordedStreamChannelMessageListener (com.navercorp.pinpoint.rpc.RecordedStreamChannelMessageListener)2 ResponseMessage (com.navercorp.pinpoint.rpc.ResponseMessage)2 HandshakeResponseCode (com.navercorp.pinpoint.rpc.packet.HandshakeResponseCode)2 PingPacket (com.navercorp.pinpoint.rpc.packet.PingPacket)2 RequestPacket (com.navercorp.pinpoint.rpc.packet.RequestPacket)2 SendPacket (com.navercorp.pinpoint.rpc.packet.SendPacket)2 PinpointServerAcceptor (com.navercorp.pinpoint.rpc.server.PinpointServerAcceptor)2 StreamException (com.navercorp.pinpoint.rpc.stream.StreamException)2 DefaultPinpointRouteResponse (com.navercorp.pinpoint.web.cluster.DefaultPinpointRouteResponse)2 FailedPinpointRouteResponse (com.navercorp.pinpoint.web.cluster.FailedPinpointRouteResponse)2 PinpointRouteResponse (com.navercorp.pinpoint.web.cluster.PinpointRouteResponse)2 ArrayList (java.util.ArrayList)2