#include "src/cpp/server/health/default_health_check_service.h"
#include <stdint.h>
#include <memory>
#include <utility>
#include "upb/upb.h"
#include "upb/upb.hpp"
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/support/slice.h>
#include "src/proto/grpc/health/v1/health.upb.h"
#define MAX_SERVICE_NAME_LENGTH …
namespace grpc {
DefaultHealthCheckService::DefaultHealthCheckService() { … }
void DefaultHealthCheckService::SetServingStatus(
const std::string& service_name, bool serving) { … }
void DefaultHealthCheckService::SetServingStatus(bool serving) { … }
void DefaultHealthCheckService::Shutdown() { … }
DefaultHealthCheckService::ServingStatus
DefaultHealthCheckService::GetServingStatus(
const std::string& service_name) const { … }
void DefaultHealthCheckService::RegisterWatch(
const std::string& service_name,
grpc_core::RefCountedPtr<HealthCheckServiceImpl::WatchReactor> watcher) { … }
void DefaultHealthCheckService::UnregisterWatch(
const std::string& service_name,
HealthCheckServiceImpl::WatchReactor* watcher) { … }
DefaultHealthCheckService::HealthCheckServiceImpl*
DefaultHealthCheckService::GetHealthCheckService() { … }
void DefaultHealthCheckService::ServiceData::SetServingStatus(
ServingStatus status) { … }
void DefaultHealthCheckService::ServiceData::AddWatch(
grpc_core::RefCountedPtr<HealthCheckServiceImpl::WatchReactor> watcher) { … }
void DefaultHealthCheckService::ServiceData::RemoveWatch(
HealthCheckServiceImpl::WatchReactor* watcher) { … }
namespace {
const char kHealthCheckMethodName[] = …;
const char kHealthWatchMethodName[] = …;
}
DefaultHealthCheckService::HealthCheckServiceImpl::HealthCheckServiceImpl(
DefaultHealthCheckService* database)
: … { … }
DefaultHealthCheckService::HealthCheckServiceImpl::~HealthCheckServiceImpl() { … }
ServerUnaryReactor*
DefaultHealthCheckService::HealthCheckServiceImpl::HandleCheckRequest(
DefaultHealthCheckService* database, CallbackServerContext* context,
const ByteBuffer* request, ByteBuffer* response) { … }
bool DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest(
const ByteBuffer& request, std::string* service_name) { … }
bool DefaultHealthCheckService::HealthCheckServiceImpl::EncodeResponse(
ServingStatus status, ByteBuffer* response) { … }
DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::WatchReactor(
HealthCheckServiceImpl* service, const ByteBuffer* request)
: … { … }
void DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::
SendHealth(ServingStatus status) { … }
void DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::
SendHealthLocked(ServingStatus status) { … }
void DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::
OnWriteDone(bool ok) { … }
void DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::
OnCancel() { … }
void DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::OnDone() { … }
void DefaultHealthCheckService::HealthCheckServiceImpl::WatchReactor::
MaybeFinishLocked(Status status) { … }
}