Package org.apache.storm
Class LocalDRPC
java.lang.Object
org.apache.storm.LocalDRPC
- All Implemented Interfaces:
AutoCloseable,Shutdownable,DistributedRPC.Iface,DistributedRPCInvocations.Iface,ILocalDRPC
A Local way to test DRPC.
try (LocalDRPC drpc = new LocalDRPC()) { // Do tests }
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a LocalDRPC with a default metrics registry.LocalDRPC(StormMetricsRegistry metricsRegistry) Creates a LocalDRPC with the specified metrics registry. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidfailRequest(String id) voidfetchRequest(String functionName) Get the ID of the service.voidvoidshutdown()Shutdown.
-
Constructor Details
-
LocalDRPC
public LocalDRPC()Creates a LocalDRPC with a default metrics registry. -
LocalDRPC
Creates a LocalDRPC with the specified metrics registry.- Parameters:
metricsRegistry- The registry
-
-
Method Details
-
getServiceId
Description copied from interface:ILocalDRPCGet the ID of the service. This is used internally if multiple local DRPC clusters are in use at one time.- Specified by:
getServiceIdin interfaceILocalDRPC
-
result
public void result(String id, String result) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
resultin interfaceDistributedRPCInvocations.Iface- Throws:
AuthorizationExceptionorg.apache.storm.thrift.TException
-
execute
public String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.storm.thrift.TException - Specified by:
executein interfaceDistributedRPC.Iface- Throws:
DRPCExecutionExceptionAuthorizationExceptionorg.apache.storm.thrift.TException
-
failRequest
public void failRequest(String id) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
failRequestin interfaceDistributedRPCInvocations.Iface- Throws:
AuthorizationExceptionorg.apache.storm.thrift.TException
-
failRequestV2
public void failRequestV2(String id, DRPCExecutionException e) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
failRequestV2in interfaceDistributedRPCInvocations.Iface- Throws:
AuthorizationExceptionorg.apache.storm.thrift.TException
-
fetchRequest
public DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
fetchRequestin interfaceDistributedRPCInvocations.Iface- Throws:
AuthorizationExceptionorg.apache.storm.thrift.TException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()Description copied from interface:ILocalDRPCShutdown.- Specified by:
shutdownin interfaceILocalDRPC- Specified by:
shutdownin interfaceShutdownable
-