use of java.util.Formatter in project databus by linkedin.
the class BootstrapApplierThread method setTabPosition.
private void setTabPosition(int srcid, int logid, int tabRid, long windowScn) throws SQLException {
PreparedStatement stmt = getTabPositionUpdateStmt();
stmt.setInt(1, logid);
stmt.setInt(2, tabRid);
stmt.setLong(3, windowScn);
stmt.setInt(4, srcid);
stmt.executeUpdate();
StringBuilder logLineBuilder = new StringBuilder(1024);
Formatter logFormatter = new Formatter(logLineBuilder);
logFormatter.format(APPLIER_STATE_LINE_FORMAT, srcid, logid, tabRid, windowScn);
log(srcid, logFormatter);
}
use of java.util.Formatter in project databus by linkedin.
the class LoggingConsumer method endSourceStats.
private void endSourceStats(Schema sourceSchema) {
Formatter fmt = new Formatter(_perSourceMsgBuilder);
fmt.format("%s=%d (%.3f ms) ", sourceSchema.getName(), _curSourceEvents, (System.nanoTime() - _curSourceStartTs) / NANOS_PER_MS);
fmt.flush();
fmt.close();
}
use of java.util.Formatter in project databus by linkedin.
the class HttpRequestLoggingHandler method logConnectionStart.
private void logConnectionStart() {
StringBuilder logLineBuilder = new StringBuilder(10000);
boolean outbound = _connRequestNano > -1;
java.util.Formatter logFormatter = new Formatter(logLineBuilder);
logFormatter.format(CONNECT_LINE_FORMAT, outbound ? OUTBOUND_DIR : INBOUND_DIR, _peerId, "CONNECT", "/START", 0, 200, 0.0, outbound ? (System.nanoTime() - _connRequestNano) * 1.0 / 1000000.0 : 0.0, 0);
log(outbound, logFormatter);
}
use of java.util.Formatter in project databus by linkedin.
the class HttpRequestLoggingHandler method logConnectionEnd.
private void logConnectionEnd() {
StringBuilder logLineBuilder = new StringBuilder(10000);
boolean outbound = _connRequestNano > -1;
Formatter logFormatter = new Formatter(logLineBuilder);
logFormatter.format(CONNECT_LINE_FORMAT, outbound ? OUTBOUND_DIR : INBOUND_DIR, _peerId, "CONNECT", "/END", 0, 200, 0.0, outbound ? (System.nanoTime() - _connStartNano) * 1.0 / 1000000.0 : 0.0, _connBytes);
log(outbound, logFormatter);
}
use of java.util.Formatter in project databus by linkedin.
the class ContainerAdminRequestProcessor method returnComponentStatus.
private void returnComponentStatus(DatabusRequest request) throws IOException {
Formatter fmt = new Formatter();
fmt.format("{\"status\":\"%s\",\"message\":\"%s\"}\n", _status.getStatus().toString(), _status.getMessage());
fmt.flush();
request.getResponseContent().write(ByteBuffer.wrap(fmt.toString().getBytes(Charset.defaultCharset())));
}
Aggregations