Java Code Examples for backtype.storm.utils.DRPCClient

The following examples show how to use backtype.storm.utils.DRPCClient. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: storm-benchmark   Source File: DRPCMetricsCollector.java    License: Apache License 2.0 5 votes vote down vote up
private long execute(String arg, PrintWriter writer) throws TException, DRPCExecutionException {
  LOG.debug(String.format("executing %s('%s')", function, arg));
  DRPCClient client = new DRPCClient(server, port);
  long start = System.currentTimeMillis();
  String result = client.execute(function, arg);
  long end = System.currentTimeMillis();
  long latency = end - start;
  writer.println(String.format("%s('%s') = %s, latency = %d ms", function, arg, result, latency));
  writer.flush();
  return latency;
}
 
Example 2
Source Project: trident-tutorial   Source File: DrpcTestClient.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) throws TException, DRPCExecutionException {
    DRPCClient cl = new DRPCClient("localhost",3772, 9000);
    if (args.length != 2){
        System.err.println("<functionName> <arguments>");
    }else{
        String func = args[0];
        String argument = args[1];
        System.out.println(cl.execute(func, argument));
    }

}
 
Example 3
Source Project: jstorm   Source File: TestReachTopology.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @param args
 * @throws DRPCExecutionException
 * @throws TException
 */
public static void main(String[] args) throws Exception {
    
    if (args.length < 1) {
        throw new IllegalArgumentException("Invalid parameter");
    }
    Map conf = Utils.readStormConfig();
    // "foo.com/blog/1" "engineering.twitter.com/blog/5"
    DRPCClient client = new DRPCClient(conf, args[0], 4772);
    String result = client.execute(ReachTopology.TOPOLOGY_NAME, "tech.backtype.com/blog/123");
    
    System.out.println("\n!!! Drpc result:" + result);
}
 
Example 4
Source Project: jea   Source File: RemoteClient.java    License: Apache License 2.0 4 votes vote down vote up
protected void init(String host, int port, int timeout){
	client = new DRPCClient(host, port, timeout);
}