private void doSaslReply(Exception ioe) throws IOException { setupResponse(authFailedResponse, authFailedCall, RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_UNAUTHORIZED, null, ioe.getClass().getName(), ioe.getLocalizedMessage()); authFailedCall.sendResponse(); }
private void doSaslReply(Exception ioe) throws IOException { setupResponse(authFailedResponse, authFailedCall, RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_UNAUTHORIZED, null, ioe.getClass().getName(), ioe.getLocalizedMessage()); authFailedCall.sendResponse(); }
private void doSaslReply(Message message) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Sending sasl message "+message); } final Call saslCall = new Call(AuthProtocol.SASL.callId, RpcConstants.INVALID_RETRY_COUNT, null, this); final ByteArrayOutputStream saslResponse = new ByteArrayOutputStream(); setupResponse(saslResponse, saslCall, RpcStatusProto.SUCCESS, null, new RpcResponseWrapper(message), null, null); saslCall.sendResponse(); }
waitingCalls[0].sendResponse(); waitingCalls[1].sendResponse(); try { int val = future1.get(1, TimeUnit.SECONDS); waitingCalls[1].sendResponse(); try { int val = future2.get(1, TimeUnit.SECONDS);
buf = new ByteArrayOutputStream(INITIAL_RESP_BUF_SIZE); call.sendResponse();
buf = new ByteArrayOutputStream(INITIAL_RESP_BUF_SIZE); call.sendResponse();
RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_VERSION_MISMATCH, null, VersionMismatch.class.getName(), errMsg); fakeCall.sendResponse(); } else if (clientVersion >= 3) { Call fakeCall = new Call(-1, RpcConstants.INVALID_RETRY_COUNT, null, null, VersionMismatch.class.getName(), errMsg); fakeCall.sendResponse(); } else if (clientVersion == 2) { // Hadoop 0.18.3 Call fakeCall = new Call(0, RpcConstants.INVALID_RETRY_COUNT, null, WritableUtils.writeString(out, errMsg); fakeCall.setResponse(ByteBuffer.wrap(buffer.toByteArray())); fakeCall.sendResponse();
RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_VERSION_MISMATCH, null, VersionMismatch.class.getName(), errMsg); fakeCall.sendResponse(); } else if (clientVersion >= 3) { Call fakeCall = new Call(-1, RpcConstants.INVALID_RETRY_COUNT, null, null, VersionMismatch.class.getName(), errMsg); fakeCall.sendResponse(); } else if (clientVersion == 2) { // Hadoop 0.18.3 Call fakeCall = new Call(0, RpcConstants.INVALID_RETRY_COUNT, null, WritableUtils.writeString(out, errMsg); fakeCall.setResponse(ByteBuffer.wrap(buffer.toByteArray())); fakeCall.sendResponse();
RpcStatusProto.FATAL, wrse.getRpcErrorCodeProto(), null, ioe.getClass().getName(), ioe.getMessage()); call.sendResponse(); throw wrse;
RpcStatusProto.FATAL, wrse.getRpcErrorCodeProto(), null, ioe.getClass().getName(), ioe.getMessage()); call.sendResponse(); throw wrse;
@InterfaceStability.Unstable @InterfaceAudience.LimitedPrivate({"HDFS"}) public void abortResponse(Throwable t) throws IOException { // don't send response if the call was already sent or aborted. if (responseWaitCount.getAndSet(-1) > 0) { // clone the call to prevent a race with the other thread stomping // on the response while being sent. the original call is // effectively discarded since the wait count won't hit zero Call call = new Call(this); setupResponse(new ByteArrayOutputStream(), call, RpcStatusProto.FATAL, RpcErrorCodeProto.ERROR_RPC_SERVER, null, t.getClass().getName(), StringUtils.stringifyException(t)); call.sendResponse(); } }
@InterfaceStability.Unstable @InterfaceAudience.LimitedPrivate({"HDFS"}) public void abortResponse(Throwable t) throws IOException { // don't send response if the call was already sent or aborted. if (responseWaitCount.getAndSet(-1) > 0) { // clone the call to prevent a race with the other thread stomping // on the response while being sent. the original call is // effectively discarded since the wait count won't hit zero Call call = new Call(this); setupResponse(new ByteArrayOutputStream(), call, RpcStatusProto.FATAL, RpcErrorCodeProto.ERROR_RPC_SERVER, null, t.getClass().getName(), StringUtils.stringifyException(t)); call.sendResponse(); } }
private void setupHttpRequestOnIpcPortResponse() throws IOException { Call fakeCall = new Call(0, RpcConstants.INVALID_RETRY_COUNT, null, this); fakeCall.setResponse(ByteBuffer.wrap( RECEIVED_HTTP_REQ_RESPONSE.getBytes(Charsets.UTF_8))); fakeCall.sendResponse(); }
@InterfaceStability.Unstable @InterfaceAudience.LimitedPrivate({"HDFS"}) public void sendResponse() throws IOException { int count = responseWaitCount.decrementAndGet(); assert count >= 0 : "response has already been sent"; if (count == 0) { connection.sendResponse(this); } }
@Override public void sendPostponed() throws IOException { Collections.shuffle(postponedCalls); for (Call call : postponedCalls) { call.sendResponse(); } postponedCalls.clear(); } }
private void setupHttpRequestOnIpcPortResponse() throws IOException { Call fakeCall = new Call(0, RpcConstants.INVALID_RETRY_COUNT, null, this); fakeCall.setResponse(ByteBuffer.wrap( RECEIVED_HTTP_REQ_RESPONSE.getBytes(Charsets.UTF_8))); fakeCall.sendResponse(); }
private void doSaslReply(Message message) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Sending sasl message "+message); } final Call saslCall = new Call(AuthProtocol.SASL.callId, RpcConstants.INVALID_RETRY_COUNT, null, this); final ByteArrayOutputStream saslResponse = new ByteArrayOutputStream(); setupResponse(saslResponse, saslCall, RpcStatusProto.SUCCESS, null, new RpcResponseWrapper(message), null, null); saslCall.sendResponse(); }
@InterfaceStability.Unstable @InterfaceAudience.LimitedPrivate({"HDFS"}) public void sendResponse() throws IOException { int count = responseWaitCount.decrementAndGet(); assert count >= 0 : "response has already been sent"; if (count == 0) { connection.sendResponse(this); } }
@Override public void logSyncNotify(RuntimeException syncEx) { try { if (syncEx == null) { call.sendResponse(); } else { call.abortResponse(syncEx); } } catch (Exception e) {} // don't care if not sent. }