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 SummaryConstructorsConstructorDescriptionCreates a LocalDRPC with a default metrics registry.LocalDRPC(StormMetricsRegistry metricsRegistry) Creates a LocalDRPC with the specified metrics registry.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()voidfailRequest(String id) voidfetchRequest(String functionName) Get the ID of the service.voidvoidshutdown()Shutdown.
- 
Constructor Details- 
LocalDRPCpublic LocalDRPC()Creates a LocalDRPC with a default metrics registry.
- 
LocalDRPCCreates a LocalDRPC with the specified metrics registry.- Parameters:
- metricsRegistry- The registry
 
 
- 
- 
Method Details- 
getServiceIdDescription 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 interface- ILocalDRPC
 
- 
resultpublic void result(String id, String result) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
- resultin interface- DistributedRPCInvocations.Iface
- Throws:
- AuthorizationException
- org.apache.storm.thrift.TException
 
- 
executepublic String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.storm.thrift.TException - Specified by:
- executein interface- DistributedRPC.Iface
- Throws:
- DRPCExecutionException
- AuthorizationException
- org.apache.storm.thrift.TException
 
- 
failRequestpublic void failRequest(String id) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
- failRequestin interface- DistributedRPCInvocations.Iface
- Throws:
- AuthorizationException
- org.apache.storm.thrift.TException
 
- 
failRequestV2public void failRequestV2(String id, DRPCExecutionException e) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
- failRequestV2in interface- DistributedRPCInvocations.Iface
- Throws:
- AuthorizationException
- org.apache.storm.thrift.TException
 
- 
fetchRequestpublic DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.storm.thrift.TException - Specified by:
- fetchRequestin interface- DistributedRPCInvocations.Iface
- Throws:
- AuthorizationException
- org.apache.storm.thrift.TException
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
- 
shutdownpublic void shutdown()Description copied from interface:ILocalDRPCShutdown.- Specified by:
- shutdownin interface- ILocalDRPC
- Specified by:
- shutdownin interface- Shutdownable
 
 
-