|
||||||||||
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 java.util.EnumSet<StorageService.Verb> |
DROPPABLE_VERBS
Verbs it's okay to drop if the request has been queued longer than RPC_TIMEOUT. |
static java.lang.String |
MBEAN_NAME
|
static int |
version_
|
static int |
VERSION_07
|
static int |
VERSION_080
|
static int |
VERSION_10
|
Method Summary | |
---|---|
void |
addLatency(java.net.InetAddress address,
double latency)
|
void |
clearCallbacksUnsafe()
|
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. |
int |
getActiveStreamsOutbound()
The count of active outbound stream tasks. |
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)
|
OutboundTcpConnectionPool |
getConnectionPool(java.net.InetAddress to)
|
static long |
getDefaultCallbackTimeout()
|
java.util.Map<java.lang.String,java.lang.Integer> |
getDroppedMessages()
dropped message counts for server lifetime |
java.util.Map<java.lang.String,java.lang.Integer> |
getRecentlyDroppedMessages()
dropped message counts since last called |
java.util.Map<java.lang.String,java.lang.Long> |
getRecentTimeoutsPerHost()
Number of timeouts since last check per host. |
long |
getRecentTotalTimouts()
Number of timeouts since last check. |
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 |
java.util.Map<java.lang.String,java.lang.Long> |
getTimeoutsPerHost()
Number of timeouts per host |
long |
getTotalTimeouts()
Total number of timeouts happened on this node |
IVerbHandler |
getVerbHandler(StorageService.Verb type)
This method returns the verb handler associated with the registered verb. |
void |
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 |
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. |
org.apache.cassandra.net.CallbackInfo |
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 |
waitForStreaming()
|
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 java.lang.String MBEAN_NAME
public static final int VERSION_07
public static final int VERSION_080
public static final int VERSION_10
public static final int version_
public static final java.util.EnumSet<StorageService.Verb> DROPPABLE_VERBS
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
ConfigurationException
public void waitUntilListening()
public 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 int getActiveStreamsOutbound()
public void register(ILatencySubscriber subcriber)
public void waitForStreaming() throws java.lang.InterruptedException
java.lang.InterruptedException
public void clearCallbacksUnsafe()
public void shutdown()
public void receive(Message message, java.lang.String id)
public org.apache.cassandra.net.CallbackInfo 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 constructStreamHeader(StreamHeader streamHeader, boolean compress, int version)
public void incrementDroppedMessages(StorageService.Verb verb)
public java.util.Map<java.lang.String,java.lang.Integer> getCommandPendingTasks()
MessagingServiceMBean
getCommandPendingTasks
in interface MessagingServiceMBean
public java.util.Map<java.lang.String,java.lang.Long> getCommandCompletedTasks()
MessagingServiceMBean
getCommandCompletedTasks
in interface MessagingServiceMBean
public java.util.Map<java.lang.String,java.lang.Integer> getResponsePendingTasks()
MessagingServiceMBean
getResponsePendingTasks
in interface MessagingServiceMBean
public java.util.Map<java.lang.String,java.lang.Long> getResponseCompletedTasks()
MessagingServiceMBean
getResponseCompletedTasks
in interface MessagingServiceMBean
public static long getDefaultCallbackTimeout()
public java.util.Map<java.lang.String,java.lang.Integer> getDroppedMessages()
MessagingServiceMBean
getDroppedMessages
in interface MessagingServiceMBean
public java.util.Map<java.lang.String,java.lang.Integer> getRecentlyDroppedMessages()
MessagingServiceMBean
getRecentlyDroppedMessages
in interface MessagingServiceMBean
public long getTotalTimeouts()
MessagingServiceMBean
getTotalTimeouts
in interface MessagingServiceMBean
public long getRecentTotalTimouts()
MessagingServiceMBean
getRecentTotalTimouts
in interface MessagingServiceMBean
public java.util.Map<java.lang.String,java.lang.Long> getTimeoutsPerHost()
MessagingServiceMBean
getTimeoutsPerHost
in interface MessagingServiceMBean
public java.util.Map<java.lang.String,java.lang.Long> getRecentTimeoutsPerHost()
MessagingServiceMBean
getRecentTimeoutsPerHost
in interface MessagingServiceMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |