Search in sources :

Example 36 with Formatter

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);
}
Also used : Formatter(java.util.Formatter) PreparedStatement(java.sql.PreparedStatement)

Example 37 with Formatter

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();
}
Also used : Formatter(java.util.Formatter)

Example 38 with Formatter

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);
}
Also used : Formatter(java.util.Formatter) Formatter(java.util.Formatter)

Example 39 with Formatter

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);
}
Also used : Formatter(java.util.Formatter)

Example 40 with Formatter

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())));
}
Also used : Formatter(java.util.Formatter)

Aggregations

Formatter (java.util.Formatter)335 File (java.io.File)20 AlertDialog (android.app.AlertDialog)14 DialogInterface (android.content.DialogInterface)14 Justif (aQute.lib.justif.Justif)12 Map (java.util.Map)12 IOException (java.io.IOException)11 ArrayList (java.util.ArrayList)11 HashMap (java.util.HashMap)11 Test (org.junit.Test)10 BigInteger (java.math.BigInteger)9 Locale (java.util.Locale)9 UnknownFormatConversionException (java.util.UnknownFormatConversionException)8 UnsupportedEncodingException (java.io.UnsupportedEncodingException)7 BigDecimal (java.math.BigDecimal)7 IllegalFormatException (java.util.IllegalFormatException)7 IllegalFormatFlagsException (java.util.IllegalFormatFlagsException)7 LayoutBuilder (android.text.StaticLayoutTest.LayoutBuilder)6 FileOutputStream (java.io.FileOutputStream)6 FormatFlagsConversionMismatchException (java.util.FormatFlagsConversionMismatchException)6