MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / messageReceived

Method messageReceived

src/tsd/RpcHandler.java:124–147  ·  view source on GitHub ↗
(final ChannelHandlerContext ctx,
                              final MessageEvent msgevent)

Source from the content-addressed store, hash-verified

122 }
123
124 @Override
125 public void messageReceived(final ChannelHandlerContext ctx,
126 final MessageEvent msgevent) {
127 try {
128 final Object message = msgevent.getMessage();
129 if (message instanceof String[]) {
130 handleTelnetRpc(msgevent.getChannel(), (String[]) message);
131 } else if (message instanceof HttpRequest) {
132 handleHttpQuery(tsdb, msgevent.getChannel(), (HttpRequest) message);
133 } else {
134 logError(msgevent.getChannel(), "Unexpected message type "
135 + message.getClass() + ": " + message);
136 exceptions_caught.incrementAndGet();
137 }
138 } catch (Exception e) {
139 Object pretty_message = msgevent.getMessage();
140 if (pretty_message instanceof String[]) {
141 pretty_message = Arrays.toString((String[]) pretty_message);
142 }
143 logError(msgevent.getChannel(), "Unexpected exception caught"
144 + " while serving " + pretty_message, e);
145 exceptions_caught.incrementAndGet();
146 }
147 }
148
149 /**
150 * Finds the right handler for a telnet-style RPC and executes it.

Callers 9

httpCORSIgnoredMethod · 0.95
httpCORSPublicSimpleMethod · 0.95
httpOptionsNoCORSMethod · 0.95
httpOptionsCORSPublicMethod · 0.95

Calls 5

handleTelnetRpcMethod · 0.95
handleHttpQueryMethod · 0.95
logErrorMethod · 0.95
getMessageMethod · 0.65
toStringMethod · 0.45

Tested by 9

httpCORSIgnoredMethod · 0.76
httpCORSPublicSimpleMethod · 0.76
httpOptionsNoCORSMethod · 0.76
httpOptionsCORSPublicMethod · 0.76