|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.net.MessagingService
public class MessagingService
Field Summary | |
---|---|
static java.lang.String |
responseStage_
|
static java.lang.String |
responseVerbHandler_
|
Constructor Summary | |
---|---|
protected |
MessagingService()
|
Method Summary | |
---|---|
void |
addCallback(IAsyncCallback cb,
java.lang.String messageId)
|
static int |
byteArrayToInt(byte[] bytes)
|
static int |
byteArrayToInt(byte[] bytes,
int offset)
|
static short |
byteArrayToShort(byte[] bytes)
|
static short |
byteArrayToShort(byte[] bytes,
int offset)
|
java.lang.Object |
clone()
|
static java.nio.ByteBuffer |
constructStreamHeader(boolean compress,
boolean stream)
|
void |
convict(java.net.InetAddress ep)
called by failure detection code to notify that housekeeping should be performed on downed sockets. |
void |
deregisterAllVerbHandlers(java.net.InetAddress localEndPoint)
Deregister all verbhandlers corresponding to localEndPoint. |
void |
deregisterVerbHandlers(java.lang.String type)
Deregister a verbhandler corresponding to the verb from the Messaging Service. |
static IAsyncResult |
getAsyncResult(java.lang.String key)
|
static int |
getBits(int x,
int p,
int n)
|
static TcpConnection |
getConnection(java.net.InetAddress from,
java.net.InetAddress to,
Message msg)
|
static org.apache.cassandra.net.TcpConnectionManager |
getConnectionPool(java.net.InetAddress from,
java.net.InetAddress to)
|
static java.util.concurrent.ExecutorService |
getDeserializationExecutor()
|
static java.util.concurrent.ExecutorService |
getReadExecutor()
|
static IAsyncCallback |
getRegisteredCallback(java.lang.String key)
|
IVerbHandler |
getVerbHandler(java.lang.String type)
This method returns the verb handler associated with the registered verb. |
static int |
getVersion()
|
byte[] |
hash(java.lang.String type,
byte[] data)
|
static MessagingService |
instance()
|
static boolean |
isEqual(byte[] digestA,
byte[] digestB)
|
static boolean |
isProtocolValid(byte[] protocol)
|
void |
listen(java.net.InetAddress localEp)
Listen on the specified port. |
void |
listenUDP(java.net.InetAddress localEp)
Listen on the specified port. |
static java.nio.ByteBuffer |
packIt(byte[] bytes,
boolean compress,
boolean stream)
|
static void |
receive(Message message)
|
void |
registerVerbHandlers(java.lang.String type,
IVerbHandler verbHandler)
Register a verb and the corresponding verb handler with the Messaging Service. |
static void |
removeRegisteredCallback(java.lang.String key)
|
void |
sendOneWay(Message message,
java.net.InetAddress to)
Send a message to a given endpoint. |
java.lang.String |
sendRR(Message[] messages,
java.net.InetAddress[] to,
IAsyncCallback cb)
Send a message to a given endpoint. |
IAsyncResult |
sendRR(Message message,
java.net.InetAddress to)
|
java.lang.String |
sendRR(Message message,
java.net.InetAddress[] to,
IAsyncCallback cb)
Send a message to a given endpoint. |
java.lang.String |
sendRR(Message message,
java.net.InetAddress to,
IAsyncCallback cb)
Send a message to a given endpoint. |
void |
sendUdpOneWay(Message message,
java.net.InetAddress to)
Send a message to a given endpoint. |
static void |
shutdown()
|
void |
stream(java.lang.String file,
long startPosition,
long total,
java.net.InetAddress from,
java.net.InetAddress to)
Stream a file from source to destination. |
static byte[] |
toByteArray(int i)
|
static byte[] |
toByteArray(short s)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String responseVerbHandler_
public static final java.lang.String responseStage_
Constructor Detail |
---|
protected MessagingService()
Method Detail |
---|
public static int getVersion()
public static MessagingService instance()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public byte[] hash(java.lang.String type, byte[] data)
public void convict(java.net.InetAddress ep)
convict
in interface IFailureDetectionEventListener
ep
- endpoint to be convictedpublic void listen(java.net.InetAddress localEp) throws java.io.IOException
localEp
- InetAddress whose port to listen on.
java.io.IOException
public void listenUDP(java.net.InetAddress localEp)
localEp
- InetAddress whose port to listen on.public static org.apache.cassandra.net.TcpConnectionManager getConnectionPool(java.net.InetAddress from, java.net.InetAddress to)
public static TcpConnection getConnection(java.net.InetAddress from, java.net.InetAddress to, Message msg) throws java.io.IOException
java.io.IOException
public void registerVerbHandlers(java.lang.String type, IVerbHandler verbHandler)
type
- name of the verb.verbHandler
- handler for the specified verbpublic void deregisterAllVerbHandlers(java.net.InetAddress localEndPoint)
localEndPoint
- public void deregisterVerbHandlers(java.lang.String type)
type
- name of the verb.public IVerbHandler getVerbHandler(java.lang.String type)
type
- for which the verb handler is sought
public java.lang.String sendRR(Message message, java.net.InetAddress[] to, IAsyncCallback cb)
message
- message to be sent.to
- endpoint to which the message needs to be sent
public void addCallback(IAsyncCallback cb, java.lang.String messageId)
public java.lang.String sendRR(Message message, java.net.InetAddress to, IAsyncCallback cb)
message
- message to be sent.to
- endpoint to which the message needs to be sentcb
- callback interface which is used to pass the responses or
suggest that a timeout occurred to the invoker of the send().
suggest that a timeout occurred to the invoker of the send().
public java.lang.String sendRR(Message[] messages, java.net.InetAddress[] to, IAsyncCallback cb)
messages
array is sent to the ith element in the to
array.This method assumes
there is a one-one mapping between the messages
array and
the to
array. Otherwise an IllegalArgumentException will be thrown.
This method also informs the MessagingService to wait for at least
howManyResults
responses to determine success of failure.
messages
- messages to be sent.to
- endpoints to which the message needs to be sentcb
- callback interface which is used to pass the responses or
suggest that a timeout occured to the invoker of the send().
public void sendOneWay(Message message, java.net.InetAddress to)
message
- messages to be sent.to
- endpoint to which the message needs to be sentpublic IAsyncResult sendRR(Message message, java.net.InetAddress to)
public void sendUdpOneWay(Message message, java.net.InetAddress to)
message
- messages to be sent.to
- endpoint to which the message needs to be sentpublic void stream(java.lang.String file, long startPosition, long total, java.net.InetAddress from, java.net.InetAddress to)
file
- name of file to stream.startPosition
- position inside the filetotal
- number of bytes to streamto
- endpoint to which we need to stream the file.public static void shutdown()
public static void receive(Message message)
public static IAsyncCallback getRegisteredCallback(java.lang.String key)
public static void removeRegisteredCallback(java.lang.String key)
public static IAsyncResult getAsyncResult(java.lang.String key)
public static java.util.concurrent.ExecutorService getReadExecutor()
public static java.util.concurrent.ExecutorService getDeserializationExecutor()
public static boolean isProtocolValid(byte[] protocol)
public static boolean isEqual(byte[] digestA, byte[] digestB)
public static byte[] toByteArray(int i)
public static byte[] toByteArray(short s)
public static short byteArrayToShort(byte[] bytes)
public static short byteArrayToShort(byte[] bytes, int offset)
public static int getBits(int x, int p, int n)
public static int byteArrayToInt(byte[] bytes)
public static int byteArrayToInt(byte[] bytes, int offset)
public static java.nio.ByteBuffer packIt(byte[] bytes, boolean compress, boolean stream)
public static java.nio.ByteBuffer constructStreamHeader(boolean compress, boolean stream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |