public abstract class Requestor extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
Requestor.TransceiverCallback<T>
Handles callbacks from transceiver invocations.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<RPCPlugin> |
rpcMetaPlugins |
| Modifier | Constructor and Description |
|---|---|
protected |
Requestor(org.apache.avro.Protocol local,
Transceiver transceiver) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRPCPlugin(RPCPlugin plugin)
Adds a new plugin to manipulate RPC metadata.
|
org.apache.avro.Protocol |
getLocal() |
org.apache.avro.Protocol |
getRemote()
Return the remote protocol.
|
Transceiver |
getTransceiver() |
Object |
readError(org.apache.avro.Schema schema,
org.apache.avro.io.Decoder in)
Deprecated.
|
abstract Exception |
readError(org.apache.avro.Schema writer,
org.apache.avro.Schema reader,
org.apache.avro.io.Decoder in)
Reads an error message.
|
Object |
readResponse(org.apache.avro.Schema schema,
org.apache.avro.io.Decoder in)
Deprecated.
|
abstract Object |
readResponse(org.apache.avro.Schema writer,
org.apache.avro.Schema reader,
org.apache.avro.io.Decoder in)
Reads a response message.
|
Object |
request(String messageName,
Object request)
Writes a request message and reads a response or error message.
|
<T> void |
request(String messageName,
Object request,
Callback<T> callback)
Writes a request message and returns the result through a Callback.
|
abstract void |
writeRequest(org.apache.avro.Schema schema,
Object request,
org.apache.avro.io.Encoder out)
Writes a request message.
|
protected Requestor(org.apache.avro.Protocol local,
Transceiver transceiver)
throws IOException
IOExceptionpublic org.apache.avro.Protocol getLocal()
public Transceiver getTransceiver()
public void addRPCPlugin(RPCPlugin plugin)
plugin - a plugin that will manipulate RPC metadatapublic Object request(String messageName, Object request) throws Exception
Exceptionpublic <T> void request(String messageName, Object request, Callback<T> callback) throws org.apache.avro.AvroRemoteException, IOException
T - the return type of the message.messageName - the name of the message to invoke.request - the request data to send.callback - the callback which will be invoked when the response is
returned or an error occurs.org.apache.avro.AvroRemoteException - if an exception is thrown to client by server.IOException - if an I/O error occurs while sending the
message.org.apache.avro.AvroRuntimeException - for another undeclared error while sending the
message.public org.apache.avro.Protocol getRemote()
throws IOException
IOExceptionpublic abstract void writeRequest(org.apache.avro.Schema schema,
Object request,
org.apache.avro.io.Encoder out)
throws IOException
IOException@Deprecated public Object readResponse(org.apache.avro.Schema schema, org.apache.avro.io.Decoder in) throws IOException
IOExceptionpublic abstract Object readResponse(org.apache.avro.Schema writer, org.apache.avro.Schema reader, org.apache.avro.io.Decoder in) throws IOException
IOException@Deprecated public Object readError(org.apache.avro.Schema schema, org.apache.avro.io.Decoder in) throws IOException
IOExceptionpublic abstract Exception readError(org.apache.avro.Schema writer, org.apache.avro.Schema reader, org.apache.avro.io.Decoder in) throws IOException
IOExceptionCopyright © 2009–2025 The Apache Software Foundation. All rights reserved.