Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 7th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import org.elasticsearch.client.transport.TransportClient;
  2. import org.elasticsearch.common.transport.InetSocketTransportAddress;
  3.  
  4. public class Test {
  5.  
  6.     public static void main(String[] args) {
  7.         TransportClient client = new TransportClient();
  8.         System.out.println(System.currentTimeMillis() + " BEFORE ");
  9.         client.addTransportAddress(new InetSocketTransportAddress("localhost", 9300));
  10.         System.out.println(System.currentTimeMillis() + " AFTER: " + client.connectedNodes().size());
  11.     }
  12. }