Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions storm-core/src/jvm/org/apache/storm/utils/DRPCClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,31 @@ public DRPCClient(Map conf, String host, int port, Integer timeout) throws TTran
this.client = new DistributedRPC.Client(_protocol);
_retryForever = true;
}


public static DistributedRPC.Client getConfiguredDRPCClient(String host, int port) {
return getConfiguredDRPCClient(null, host, port);
}

public static DistributedRPC.Client getConfiguredDRPCClient(Map conf, String host, int port) {
try {
Map fullConf = Utils.readStormConfig();
if (conf != null) {
fullConf.putAll(conf);
}
return new DRPCClient(fullConf, host, port).getClient();
} catch (TTransportException ex) {
throw new RuntimeException(ex);
}
}

public String getHost() {
return host;
}

public int getPort() {
return port;
}

public String execute(String func, String args) throws TException, DRPCExecutionException, AuthorizationException {
return client.execute(func, args);
}
Expand Down