|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cassandra.net.MessagingService
public final class MessagingService
| Field Summary | |
|---|---|
static int |
version_
|
static int |
VERSION_07
|
| Method Summary | |
|---|---|
void |
addLatency(java.net.InetAddress address,
double latency)
|
java.nio.ByteBuffer |
constructStreamHeader(StreamHeader streamHeader,
boolean compress,
int version)
|
void |
convict(java.net.InetAddress ep)
called from gossiper when it notices a node is not responding. |
static int |
getBits(int x,
int p,
int n)
|
java.util.Map<java.lang.String,java.lang.Long> |
getCommandCompletedTasks()
Completed tasks for Command(Mutations, Read etc) TCP Connections |
java.util.Map<java.lang.String,java.lang.Integer> |
getCommandPendingTasks()
Pending tasks for Command(Mutations, Read etc) TCP Connections |
OutboundTcpConnection |
getConnection(java.net.InetAddress to,
Message msg)
|
org.apache.cassandra.net.OutboundTcpConnectionPool |
getConnectionPool(java.net.InetAddress to)
|
static long |
getDefaultCallbackTimeout()
|
long |
getRegisteredCallbackAge(java.lang.String messageId)
|
java.util.Map<java.lang.String,java.lang.Long> |
getResponseCompletedTasks()
Completed tasks for Response(GOSSIP & RESPONSE) TCP Connections |
java.util.Map<java.lang.String,java.lang.Integer> |
getResponsePendingTasks()
Pending tasks for Response(GOSSIP & RESPONSE) TCP Connections |
IVerbHandler |
getVerbHandler(StorageService.Verb type)
This method returns the verb handler associated with the registered verb. |
int |
incrementDroppedMessages(StorageService.Verb verb)
|
static MessagingService |
instance()
|
void |
listen(java.net.InetAddress localEp)
Listen on the specified port. |
void |
maybeAddLatency(IMessageCallback cb,
java.net.InetAddress address,
double latency)
Track latency information for the dynamic snitch |
java.nio.ByteBuffer |
packIt(byte[] bytes,
boolean compress,
int version)
|
void |
receive(Message message,
java.lang.String id)
|
void |
register(ILatencySubscriber subcriber)
|
void |
registerVerbHandlers(StorageService.Verb verb,
IVerbHandler verbHandler)
Register a verb and the corresponding verb handler with the Messaging Service. |
Pair<java.net.InetAddress,IMessageCallback> |
removeRegisteredCallback(java.lang.String messageId)
|
void |
sendOneWay(Message message,
java.net.InetAddress to)
|
void |
sendReply(Message message,
java.lang.String id,
java.net.InetAddress to)
|
IAsyncResult |
sendRR(Message message,
java.net.InetAddress to)
|
java.lang.String |
sendRR(Message message,
java.net.InetAddress to,
IMessageCallback cb)
|
java.lang.String |
sendRR(Message message,
java.net.InetAddress to,
IMessageCallback cb,
long timeout)
Send a message to a given endpoint. |
java.lang.String |
sendRR(MessageProducer producer,
java.net.InetAddress to,
IAsyncCallback cb)
Send a message to a given endpoint. |
void |
shutdown()
|
void |
stream(StreamHeader header,
java.net.InetAddress to)
Stream a file from source to destination. |
static void |
validateMagic(int magic)
|
void |
waitFor()
blocks until the processing pools are empty and done. |
void |
waitUntilListening()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int VERSION_07
public static final int version_
| Method Detail |
|---|
public static MessagingService instance()
public void maybeAddLatency(IMessageCallback cb,
java.net.InetAddress address,
double latency)
cb: - the callback associated with this message -- this lets us know if it's a message type we're interested inaddress: - the host that replied to the messagelatency -
public void addLatency(java.net.InetAddress address,
double latency)
public void convict(java.net.InetAddress ep)
public void listen(java.net.InetAddress localEp)
throws java.io.IOException,
ConfigurationException
localEp - InetAddress whose port to listen on.
java.io.IOException
ConfigurationExceptionpublic void waitUntilListening()
public org.apache.cassandra.net.OutboundTcpConnectionPool getConnectionPool(java.net.InetAddress to)
public OutboundTcpConnection getConnection(java.net.InetAddress to,
Message msg)
public void registerVerbHandlers(StorageService.Verb verb,
IVerbHandler verbHandler)
verb - verbHandler - handler for the specified verbpublic IVerbHandler getVerbHandler(StorageService.Verb type)
type - for which the verb handler is sought
public java.lang.String sendRR(Message message,
java.net.InetAddress to,
IMessageCallback cb)
public java.lang.String sendRR(Message message,
java.net.InetAddress to,
IMessageCallback cb,
long timeout)
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().timeout - the timeout used for expiration
public void sendOneWay(Message message,
java.net.InetAddress to)
public void sendReply(Message message,
java.lang.String id,
java.net.InetAddress to)
public java.lang.String sendRR(MessageProducer producer,
java.net.InetAddress to,
IAsyncCallback cb)
producer - proto - endpoing to which the message needs to be sentcb - callback that processes responses.
public IAsyncResult sendRR(Message message,
java.net.InetAddress to)
public void stream(StreamHeader header,
java.net.InetAddress to)
header - Header contains file to stream and other metadata.to - endpoint to which we need to stream the file.public void register(ILatencySubscriber subcriber)
public void waitFor()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void shutdown()
public void receive(Message message,
java.lang.String id)
public Pair<java.net.InetAddress,IMessageCallback> removeRegisteredCallback(java.lang.String messageId)
public long getRegisteredCallbackAge(java.lang.String messageId)
public static void validateMagic(int magic)
throws java.io.IOException
java.io.IOException
public static int getBits(int x,
int p,
int n)
public java.nio.ByteBuffer packIt(byte[] bytes,
boolean compress,
int version)
public java.nio.ByteBuffer constructStreamHeader(StreamHeader streamHeader,
boolean compress,
int version)
public int incrementDroppedMessages(StorageService.Verb verb)
public java.util.Map<java.lang.String,java.lang.Integer> getCommandPendingTasks()
MessagingServiceMBean
getCommandPendingTasks in interface MessagingServiceMBeanpublic java.util.Map<java.lang.String,java.lang.Long> getCommandCompletedTasks()
MessagingServiceMBean
getCommandCompletedTasks in interface MessagingServiceMBeanpublic java.util.Map<java.lang.String,java.lang.Integer> getResponsePendingTasks()
MessagingServiceMBean
getResponsePendingTasks in interface MessagingServiceMBeanpublic java.util.Map<java.lang.String,java.lang.Long> getResponseCompletedTasks()
MessagingServiceMBean
getResponseCompletedTasks in interface MessagingServiceMBeanpublic static long getDefaultCallbackTimeout()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||