MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / executeFourLetterCommand

Method executeFourLetterCommand

programs/keeper-client/KeeperClient.cpp:92–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92String KeeperClient::executeFourLetterCommand(const String & command)
93{
94 /// We need to create a new socket every time because ZooKeeper forcefully shuts down the connection after a four-letter-word command.
95 Poco::Net::StreamSocket socket;
96 socket.connect(Poco::Net::SocketAddress{zk_args.hosts[0]}, zk_args.connection_timeout_ms * 1000);
97
98 socket.setReceiveTimeout(zk_args.operation_timeout_ms * 1000);
99 socket.setSendTimeout(zk_args.operation_timeout_ms * 1000);
100 socket.setNoDelay(true);
101
102 ReadBufferFromPocoSocket in(socket);
103 WriteBufferFromPocoSocket out(socket);
104
105 out.write(command.data(), command.size());
106 out.next();
107 out.finalize();
108
109 String result;
110 readStringUntilEOF(result, in);
111 in.next();
112 return result;
113}
114
115
116/// `prefix` is the full input line up to the cursor position, as provided by replxx.

Callers

nothing calls this directly

Calls 10

readStringUntilEOFFunction · 0.85
connectMethod · 0.45
setReceiveTimeoutMethod · 0.45
setSendTimeoutMethod · 0.45
setNoDelayMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
nextMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected