aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/cluster/PingableSearcher.java
blob: bcfb943d23a23f2458c2b3f47b184a91f8b82206 (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
24
25
26
27
28
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.cluster;

import com.yahoo.component.ComponentId;
import com.yahoo.prelude.Ping;
import com.yahoo.prelude.Pong;
import com.yahoo.search.Searcher;
import com.yahoo.search.searchchain.Execution;

/**
 * A searcher to which we can send a ping to probe if it is alive
 *
 * @author bratseth
 */
public abstract class PingableSearcher extends Searcher {

    public PingableSearcher() { }

    public PingableSearcher(ComponentId id) {
        super(id);
    }

    /** Send a ping request downwards to probe if this searcher chain is in functioning order */
    public Pong ping(Ping ping, Execution execution) {
        return execution.ping(ping);
    }

}