@Test @Ignore public void testEmit() throws Exception { internalSetUp(); Properties props = System.getProperties(); String host = props.getProperty( Config.TD_LOGGER_API_SERVER_HOST, Config.TD_LOGGER_API_SERVER_HOST_DEFAULT); int port = Integer.parseInt(props.getProperty( Config.TD_LOGGER_API_SERVER_PORT, Config.TD_LOGGER_API_SERVER_PORT_DEFAULT)); String apiKey = props.getProperty(Config.TD_LOGGER_API_KEY); HttpSender sender = new HttpSender(props, host, port, apiKey); Map<String, Object> data = new HashMap<String, Object>(); data.put("k1", "v1"); sender.emit("mugadb.loggertable", data); System.out.println("finished emit method"); Thread.sleep(10 * 1000); sender.close(); System.out.println("finished close method"); }
public boolean emit(String tag, Map<String, Object> record) { if (record.containsKey("time")) { return emit0(tag, record); } else { return emit(tag, System.currentTimeMillis() / 1000, record); } }
HttpSender implements Sender { public boolean emit(String tag, Map<String, Object> record) { if (record.containsKey("time")) { return emit0(tag, record); } else { return emit(tag, System.currentTimeMillis() / 1000, record); } } }
HttpSender implements Sender { public boolean emit(String tag, Map<String, Object> record) { if (record.containsKey("time")) { return emit0(tag, record); } else { return emit(tag, System.currentTimeMillis() / 1000, record); } } HttpSender(Properties props, final String host, final int port, final String apiKey); }
HttpSender implements Sender { public boolean emit(String tag, Map<String, Object> record) { if (record.containsKey("time")) { return emit0(tag, record); } else { return emit(tag, System.currentTimeMillis() / 1000, record); } } HttpSender(Properties props, final String host, final int port, final String apiKey); static boolean validateDatabaseName(String name); static boolean validateTableName(String name); static boolean validateColumnName(String name); void startBackgroundProcess(); boolean emit(String tag, Map<String, Object> record); boolean emit(String tag, long timestamp, Map<String, Object> record); byte[] getBuffer(); void flush(); void close(); @Override String getName(); @Override boolean isConnected(); @Override String toString(); }
HttpSender implements Sender { public boolean emit(String tag, Map<String, Object> record) { if (record.containsKey("time")) { return emit0(tag, record); } else { return emit(tag, System.currentTimeMillis() / 1000, record); } } HttpSender(Properties props, final String host, final int port, final String apiKey); static boolean validateDatabaseName(String name); static boolean validateTableName(String name); static boolean validateColumnName(String name); void startBackgroundProcess(); boolean emit(String tag, Map<String, Object> record); boolean emit(String tag, long timestamp, Map<String, Object> record); byte[] getBuffer(); void flush(); void close(); @Override String getName(); @Override boolean isConnected(); @Override String toString();  }