Anton Alfred
Anton Alfred

Reputation: 43

Storm 0.10.0 how to create the DRPC Remote client?

With the launch of Storm 0.10.0 the signature of DRPCClient is changed such that it includes a Map parameter

//conf map, drpc server, port no, timeout for the call
new DRPCClient(conf, "192.168.0.217", 3772, 5000);

The conf by default has the following

Config conf = new Config();
conf.setDebug(false);

This is creating an exception

java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at backtype.storm.security.auth.AuthUtils.GetTransportPlugin(AuthUtils.java:230)
at backtype.storm.security.auth.ThriftClient.reconnect(ThriftClient.java:91)

If I add the following to conf

conf.put("storm.thrift.transport", "backtype.storm.security.auth.SimpleTransportPlugin");

The exception is

Don't know how to convert null to int
java.lang.IllegalArgumentException: Don't know how to convert null to int
at backtype.storm.utils.Utils.getInt(Utils.java:420)
at backtype.storm.security.auth.ThriftClient.reconnect(ThriftClient.java:100)

The storm starter for DRPC namely the Storm Trident reach at https://github.com/nathanmarz/storm-starter/blob/master/src/jvm/storm/starter/trident/TridentReach.java only shows a DRPC client which is local.

The documentation on the site for tutorial is outdated with the new API signature http://storm.apache.org/documentation/Trident-tutorial.html which says

DRPCClient client = new DRPCClient("drpc.server.location", 3772);

I understand that there is some security involved in the call, but where do we find the documentation on how to call it.

Upvotes: 0

Views: 659

Answers (2)

Hongzhang Yan
Hongzhang Yan

Reputation: 21

Config conf = new Config();
Map defaultConfig = Utils.readDefaultConfig();
conf.putAll(defaultConfig);

Upvotes: 2

user5796243
user5796243

Reputation: 36

        Config conf = new Config();
        conf.setDebug(false);
        conf.put("storm.thrift.transport", "backtype.storm.security.auth.SimpleTransportPlugin");
        conf.put(Config.STORM_NIMBUS_RETRY_TIMES, 3);
        conf.put(Config.STORM_NIMBUS_RETRY_INTERVAL, 10);
        conf.put(Config.STORM_NIMBUS_RETRY_INTERVAL_CEILING, 20);
        conf.put(Config.DRPC_MAX_BUFFER_SIZE, 1048576);

Add all these, it works.

Upvotes: 2

Related Questions