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()
ILocalDRPC
Get the ID of the service. This is used internally if multiple local DRPC clusters are in use at one time.
getServiceId
in interface ILocalDRPC
public void result(String id, String result) throws AuthorizationException, org.apache.storm.thrift.TException
result
in interface DistributedRPCInvocations.Iface
AuthorizationException
org.apache.storm.thrift.TException
public String execute(String functionName, String funcArgs) throws DRPCExecutionException, AuthorizationException, org.apache.storm.thrift.TException
execute
in interface DistributedRPC.Iface
DRPCExecutionException
AuthorizationException
org.apache.storm.thrift.TException
public void failRequest(String id) throws AuthorizationException, org.apache.storm.thrift.TException
failRequest
in interface DistributedRPCInvocations.Iface
AuthorizationException
org.apache.storm.thrift.TException
public void failRequestV2(String id, DRPCExecutionException e) throws AuthorizationException, org.apache.storm.thrift.TException
failRequestV2
in interface DistributedRPCInvocations.Iface
AuthorizationException
org.apache.storm.thrift.TException
public DRPCRequest fetchRequest(String functionName) throws AuthorizationException, org.apache.storm.thrift.TException
fetchRequest
in interface DistributedRPCInvocations.Iface
AuthorizationException
org.apache.storm.thrift.TException
public void close()
close
in interface AutoCloseable
public void shutdown()
ILocalDRPC
Shutdown.
shutdown
in interface Shutdownable
shutdown
in interface ILocalDRPC
Copyright © 2022 The Apache Software Foundation. All rights reserved.