summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcPingFactory.java
blob: 2e690198c1c225022b526e12571b25b5d5d62149 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.dispatch.rpc;

import com.yahoo.search.cluster.ClusterMonitor;
import com.yahoo.search.dispatch.searchcluster.Node;
import com.yahoo.search.dispatch.searchcluster.PingFactory;
import com.yahoo.search.dispatch.searchcluster.Pinger;
import com.yahoo.search.dispatch.searchcluster.PongHandler;

public class RpcPingFactory implements PingFactory {

    private final RpcResourcePool rpcResourcePool;

    public RpcPingFactory(RpcResourcePool rpcResourcePool) {
        this.rpcResourcePool = rpcResourcePool;
    }

    @Override
    public Pinger createPinger(Node node, ClusterMonitor<Node> monitor, PongHandler pongHandler) {
        return new RpcPing(node, monitor, rpcResourcePool, pongHandler);
    }

}