/** * {@inheritDoc} */ @Override public void setup() throws TException { final TSocket socket = new TSocket(host, port); socket.setTimeout(timeout); transport = new TFramedTransport(socket); final TProtocol protocol = new TBinaryProtocol(transport); client = new Client(protocol); transport.open(); }
private boolean log(final Client client, final List<LogEntry> logEntries) { try { client.Log(logEntries); return true; } catch (final TException e) { LOGGER.fine(format("Exception when trying to log Span. Will retry: %s", e.getMessage())); final Client newClient = clientProvider.exception(e); if (newClient != null) { LOGGER.fine("Got new client with new connection. Logging with new client."); try { newClient.Log(logEntries); return true; } catch (final TException e2) { LOGGER.log(Level.WARNING, "Logging spans failed. " + logEntries.size() + " spans are lost!", e2); } } else { LOGGER.warning("Logging spans failed (couldn't establish connection). " + logEntries.size() + " spans are lost!"); } } metricsHandler.incrementDroppedSpans(logEntries.size()); return false; }
public ResultCode getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_Log(); } }
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } }
public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
public ResultCode recv_Log() throws org.apache.thrift.TException { Log_result result = new Log_result(); receiveBase(result, "Log"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "Log failed: unknown result"); }
public void send_Log(List<LogEntry> messages) throws org.apache.thrift.TException { Log_args args = new Log_args(); args.setMessages(messages); sendBase("Log", args); }