MCPcopy Create free account
hub / github.com/apache/impala / SetKeepAliveOptionsForSocket

Function SetKeepAliveOptionsForSocket

be/src/rpc/thrift-util.cc:220–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220Status SetKeepAliveOptionsForSocket(THRIFT_SOCKET socket, int32_t probe_period_s,
221 int32_t retry_period_s, int32_t retry_count) {
222 if (probe_period_s > 0) {
223 RETURN_IF_ERROR(SetSockOpt(socket, IPPROTO_TCP, TCP_KEEPIDLE,
224 "TCP_KEEPIDLE (keepalive probe period)", probe_period_s));
225 }
226 if (retry_period_s > 0) {
227 RETURN_IF_ERROR(SetSockOpt(socket, IPPROTO_TCP, TCP_KEEPINTVL,
228 "TCP_KEEPINTVL (keepalive retry period)", retry_period_s));
229 }
230 if (retry_count > 0) {
231 RETURN_IF_ERROR(SetSockOpt(socket, IPPROTO_TCP, TCP_KEEPCNT,
232 "TCP_KEEPCNT (keepalive retry count)", retry_count));
233 }
234 return Status::OK();
235}
236
237static void ThriftOutputFunction(const char* output) {
238 VLOG_QUERY << output;

Callers 1

createSocketMethod · 0.85

Calls 2

SetSockOptFunction · 0.85
OKFunction · 0.85

Tested by

no test coverage detected