Package com.mapr.fs
Class Rpc
- java.lang.Object
-
- com.mapr.fs.jni.RpcNative
-
- com.mapr.fs.Rpc
-
public class Rpc extends RpcNative
Class to export RPC layer functionality to Java Layers.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_RPC_THREADS_PER_INSTANCE
-
Constructor Summary
Constructors Constructor Description Rpc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseBinding(RpcCallContext c)static voidexportProgram(int programId, RpcProgram program)static voidexportProgram(int programId, RpcProgram program, int serverIdx)static com.mapr.fs.proto.Security.TicketgetAuthenticatedTicket(RpcCallContext c)static intinitialize(int port, int numThreads, java.lang.String clusterName)static intinitialize(int listenPort, int numThreads, java.lang.String clusterName, RpcExport[] rpcPrograms, ThreadPoolFinder poolFinder)Spawns and starts the RPC Listener Thread.static intinitializeGuts(long shmAddr)static intinitializeRpcServer(java.lang.String processName, int listenPort, int numThreads, java.lang.String clusterName, RpcExport[] rpcPrograms, ThreadPoolFinder poolFinder, int serverIdx, long ipStatsAddr, int ipStatsMemSize)Spawns and starts the RPC Listener Thread.static voidrejectCall(RpcCallContext c)static voidsendReply(RpcCallContext c, com.google.protobuf.MessageLite reply)static voidsendReplyAsync(RpcCallContext c, com.google.protobuf.MessageLite reply)static voidsendReplyAsync(RpcCallContext c, com.google.protobuf.MessageLite reply, boolean replyWithEBusy)static byte[]sendRequest(long binding, int programId, int procedureId, com.google.protobuf.MessageLite request)-
Methods inherited from class com.mapr.fs.jni.RpcNative
closeBinding, copyRpcSlabInfo, createBindingFor, createBindingFor2, createBindingForIps, createBindingForIps2, createBindingForIpsWithSrcPort, createBindingForIpsWithSrcPort2, createBindingOnServerFor, doNotTimeout, getIpPortFromBinding, getIPStatSize, getTicketFromContext, init, initAndExport, initAndExportServer, initializeRpcGuts, initServer, registerProgramId, rejectCall, sendReply, sendReplyAsync, sendRequest, setAllowImpersonation, shrinkSlabs, waitForRequest
-
-
-
-
Method Detail
-
initialize
public static int initialize(int port, int numThreads, java.lang.String clusterName) throws java.lang.Exception- Throws:
java.lang.Exception
-
initialize
public static int initialize(int listenPort, int numThreads, java.lang.String clusterName, RpcExport[] rpcPrograms, ThreadPoolFinder poolFinder) throws java.lang.ExceptionSpawns and starts the RPC Listener Thread.- Parameters:
port-numThreads-clusterName-exports-threadPoolFinder-- Returns:
- Throws:
java.lang.Exception
-
initializeRpcServer
public static int initializeRpcServer(java.lang.String processName, int listenPort, int numThreads, java.lang.String clusterName, RpcExport[] rpcPrograms, ThreadPoolFinder poolFinder, int serverIdx, long ipStatsAddr, int ipStatsMemSize) throws java.lang.ExceptionSpawns and starts the RPC Listener Thread.- Parameters:
port-numThreads-clusterName-exports-threadPoolFinder-ServerIdx-- Returns:
- Throws:
java.lang.Exception
-
sendRequest
public static byte[] sendRequest(long binding, int programId, int procedureId, com.google.protobuf.MessageLite request) throws java.lang.Exception- Throws:
java.lang.Exception
-
exportProgram
public static void exportProgram(int programId, RpcProgram program) throws java.lang.Exception- Throws:
java.lang.Exception
-
exportProgram
public static void exportProgram(int programId, RpcProgram program, int serverIdx) throws java.lang.Exception- Throws:
java.lang.Exception
-
sendReply
public static void sendReply(RpcCallContext c, com.google.protobuf.MessageLite reply) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendReplyAsync
public static void sendReplyAsync(RpcCallContext c, com.google.protobuf.MessageLite reply) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sendReplyAsync
public static void sendReplyAsync(RpcCallContext c, com.google.protobuf.MessageLite reply, boolean replyWithEBusy) throws java.lang.Exception
- Throws:
java.lang.Exception
-
rejectCall
public static void rejectCall(RpcCallContext c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
closeBinding
public static void closeBinding(RpcCallContext c) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getAuthenticatedTicket
public static com.mapr.fs.proto.Security.Ticket getAuthenticatedTicket(RpcCallContext c)
-
initializeGuts
public static int initializeGuts(long shmAddr)
-
-