public static void testTSDBConnection() throws Exception {
Socket sock = null;
PrintWriter pw = null;
String hostname = "10.10.10.220"; //replace with the node where tsd runs
int port = 4242; //replace with your port
sock = new Socket(hostname, port);
pw = new PrintWriter(sock.getOutputStream(), true);
File dir = new File(".");
File fin = new File(dir.getCanonicalPath() + File.separator + "tmp_input");
BufferedReader br = new BufferedReader(new FileReader(fin));
String line = null;
while ((line = br.readLine()) != null) {
System.out.println(line);
pw.println(line);
pw.flush();
}
br.close();
}