com.sleepycat.je.rep.elections
Class Utils
java.lang.Object
com.sleepycat.je.rep.elections.Utils
public class Utils
- extends Object
Constructor Summary |
Utils()
|
Method Summary |
static List<Future<TextProtocol.MessageExchange>> |
broadcastMessage(Set<InetSocketAddress> targets,
String serviceName,
TextProtocol.RequestMessage requestMessage,
ExecutorService threadPool)
|
(package private) static void |
checkFutures(List<Future<TextProtocol.MessageExchange>> futures,
Logger logger,
EnvironmentImpl envImpl,
Formatter formatter)
Utility to wait for completion of futures. |
static void |
cleanup(Logger logger,
EnvironmentImpl envImpl,
Formatter formatter,
Socket socket,
BufferedReader in,
PrintWriter out)
Cleans up the socket and its related streams after a request/response
cycle. |
(package private) static void |
discardFutures(List<Future<TextProtocol.MessageExchange>> futures)
Discard futures computations, since we no longer care about their
outcomes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
cleanup
public static void cleanup(Logger logger,
EnvironmentImpl envImpl,
Formatter formatter,
Socket socket,
BufferedReader in,
PrintWriter out)
- Cleans up the socket and its related streams after a request/response
cycle.
- Parameters:
socket
- the socket to be closedin
- the request stream to be closedout
- the response stream to be closed
broadcastMessage
public static List<Future<TextProtocol.MessageExchange>> broadcastMessage(Set<InetSocketAddress> targets,
String serviceName,
TextProtocol.RequestMessage requestMessage,
ExecutorService threadPool)
- Parameters:
targets
- of the broadcastrequestMessage
- to be broadcastthreadPool
- used to issue message in parallel
- Returns:
- the list of futures representing the results of the broadcast
checkFutures
static void checkFutures(List<Future<TextProtocol.MessageExchange>> futures,
Logger logger,
EnvironmentImpl envImpl,
Formatter formatter)
- Utility to wait for completion of futures.
- Parameters:
futures
- the futures to wait forlogger
- used to report any error messages
discardFutures
static void discardFutures(List<Future<TextProtocol.MessageExchange>> futures)
- Discard futures computations, since we no longer care about their
outcomes.
- Parameters:
futures
- futures to be discarded.
Copyright (c) 2004-2010 Oracle. All rights reserved.