MCPcopy Create free account
hub / github.com/apache/cloudberry / InitRemoteLog

Function InitRemoteLog

gpcontrib/gpcloud/src/s3log.cpp:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48static bool loginited = false;
49
50void InitRemoteLog() {
51 if (loginited) {
52 return;
53 }
54
55 s3ext_logsock_udp = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
56 S3_CHECK_OR_DIE(s3ext_logsock_udp != -1, S3RuntimeError,
57 string("Failed to create socket: ") + strerror(errno));
58
59 memset(&s3ext_logserveraddr, 0, sizeof(struct sockaddr_in));
60 s3ext_logserveraddr.sin_family = AF_INET;
61 s3ext_logserveraddr.sin_port = htons(s3ext_logserverport);
62 inet_aton(s3ext_logserverhost.c_str(), &s3ext_logserveraddr.sin_addr);
63
64 loginited = true;
65}
66
67LOGTYPE getLogType(const char* v) {
68 if (!v) return STDERR_LOG;

Callers 3

TESTFunction · 0.85
reader_initFunction · 0.85
writer_initFunction · 0.85

Calls 1

inet_atonFunction · 0.85

Tested by 1

TESTFunction · 0.68