public class LocalDRPC extends Object implements ILocalDRPC
A Local way to test DRPC.
try (LocalDRPC drpc = new LocalDRPC()) { // Do tests }
| Constructor and Description |
|---|
LocalDRPC()
Creates a LocalDRPC with a default metrics registry.
|
LocalDRPC(StormMetricsRegistry metricsRegistry)
Creates a LocalDRPC with the specified metrics registry.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
execute(String functionName,
String funcArgs) |
void |
failRequest(String id) |
void |
failRequestV2(String id,
DRPCExecutionException e) |
DRPCRequest |
fetchRequest(String functionName) |
String |
getServiceId()
Get the ID of the service.
|
void |
result(String id,
String result) |
void |
shutdown()
Shutdown.
|
public LocalDRPC()
Creates a LocalDRPC with a default metrics registry.
public LocalDRPC(StormMetricsRegistry metricsRegistry)
Creates a LocalDRPC with the specified metrics registry.
metricsRegistry - The registrypublic String getServiceId()
ILocalDRPCGet the ID of the service. This is used internally if multiple local DRPC clusters are in use at one time.
getServiceId in interface ILocalDRPCpublic void result(String id, String result) throws AuthorizationException, org.apache.storm.thrift.TException
result in interface DistributedRPCInvocations.IfaceAuthorizationExceptionorg.apache.storm.thrift.TExceptionpublic String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.storm.thrift.TException
execute in interface DistributedRPC.IfaceDRPCExecutionExceptionAuthorizationExceptionorg.apache.storm.thrift.TExceptionpublic void failRequest(String id) throws AuthorizationException, org.apache.storm.thrift.TException
failRequest in interface DistributedRPCInvocations.IfaceAuthorizationExceptionorg.apache.storm.thrift.TExceptionpublic void failRequestV2(String id, DRPCExecutionException e) throws AuthorizationException, org.apache.storm.thrift.TException
failRequestV2 in interface DistributedRPCInvocations.IfaceAuthorizationExceptionorg.apache.storm.thrift.TExceptionpublic DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.storm.thrift.TException
fetchRequest in interface DistributedRPCInvocations.IfaceAuthorizationExceptionorg.apache.storm.thrift.TExceptionpublic void close()
close in interface AutoCloseablepublic void shutdown()
ILocalDRPCShutdown.
shutdown in interface Shutdownableshutdown in interface ILocalDRPCCopyright © 2021 The Apache Software Foundation. All rights reserved.