diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-05-27 13:52:08 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-05-31 10:52:42 +0000 |
commit | b741e5ffdfceb532c1166e778a072de8d4d1e6ea (patch) | |
tree | cb31e40859b6174a4bb4dba6f56db8e0392d263b /configd/src/apps/sentinel/peer-check.h | |
parent | 781cb0770f50a5fd00bae0ecc0c5d323132ab166 (diff) |
prepare for "check connectivity" api
* Cmd now has more generic "name" property and optional "portNumber"
* add CmdType CHECK_CONNECTIVITY
* add a simple one-shot PeerCheck utility
* add CheckCompletionHandler that handles a Cmd with type CHECK_CONNECTIVITY
* dummy in handleCmd for now
Diffstat (limited to 'configd/src/apps/sentinel/peer-check.h')
-rw-r--r-- | configd/src/apps/sentinel/peer-check.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/configd/src/apps/sentinel/peer-check.h b/configd/src/apps/sentinel/peer-check.h new file mode 100644 index 00000000000..658375a8d7b --- /dev/null +++ b/configd/src/apps/sentinel/peer-check.h @@ -0,0 +1,37 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#pragma once + +#include "status-callback.h" +#include <string> +#include <vespa/fnet/task.h> +#include <vespa/fnet/frt/invoker.h> +#include <vespa/fnet/frt/rpcrequest.h> +#include <vespa/fnet/frt/supervisor.h> +#include <vespa/fnet/frt/target.h> + +namespace config::sentinel { + +class PeerCheck : public FRT_IRequestWait +{ +public: + PeerCheck(StatusCallback &callback, const std::string &host, int portnum, FRT_Supervisor &orb); + ~PeerCheck(); + + PeerCheck(const PeerCheck &) = delete; + PeerCheck(PeerCheck &&) = delete; + PeerCheck& operator= (const PeerCheck &) = delete; + PeerCheck& operator= (PeerCheck &&) = delete; + + /** from FRT_IRequestWait **/ + void RequestDone(FRT_RPCRequest *req) override; + +private: + StatusCallback &_callback; + std::string _hostname; + int _portnum; + FRT_Target *_target; + FRT_RPCRequest *_req; +}; + +} |