MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / getFullConnections

Function getFullConnections

controller/Controller.h:103–127  ·  view source on GitHub ↗

* Lists connections which are full * @param socket socket ptr */

Source from the content-addressed store, hash-verified

101 * @param socket socket ptr
102 */
103int getFullConnections(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out) {
104 socket->initialize();
105 std::vector<uint8_t> data;
106 uint8_t op = minifi::c2::Operation::DESCRIBE;
107 minifi::io::BufferStream stream;
108 stream.write(&op, 1);
109 stream.write("getfull");
110 if (socket->write(const_cast<uint8_t*>(stream.getBuffer()), gsl::narrow<int>(stream.size())) < 0) {
111 return -1;
112 }
113 // read the response
114 uint8_t resp = 0;
115 socket->read(&resp, 1);
116 if (resp == minifi::c2::Operation::DESCRIBE) {
117 uint16_t connections = 0;
118 socket->read(connections);
119 out << connections << " are full" << std::endl;
120 for (int i = 0; i < connections; i++) {
121 std::string fullcomponent;
122 socket->read(fullcomponent);
123 out << fullcomponent << " is full" << std::endl;
124 }
125 }
126 return 0;
127}
128
129int getJstacks(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out) {
130 socket->initialize();

Callers 1

mainFunction · 0.85

Calls 5

initializeMethod · 0.45
writeMethod · 0.45
getBufferMethod · 0.45
sizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected