Package org.jgroups.util
Provides useful functionality which cannot be assigned to any particular other package.
-
Interface Summary Interface Description AgeOutCache.Handler<K> Buffer.Visitor<T> ProcessingQueue.Handler<T> RequestTable.Visitor<T> ResourceManager.IpAddressRep SizeStreamable Interface implementing Streamable and returning the size of the marshalled object.SocketFactory Factory to create various types of sockets.Streamable Implementations of Streamable can add their state directly to the output stream, enabling them to bypass costly serializationTable.Visitor<T> ThreadFactory TimeScheduler Timer-like interface which allows for execution of tasks.TimeScheduler.Task The interface that dynamic tasks (TimeScheduler.scheduleWithDynamicInterval(org.jgroups.util.TimeScheduler.Task)
) must implement -
Class Summary Class Description AckCollector Collects acks from a number of nodes, waits for all acks.AckTable Manages ACKs from receivers inNAKACK4
AgeOutCache<K> Cache which removes its elements after a certain timeArrayIterator<T> Iterator over an array of elements of type T.AsciiString Simple string implemented as a byte[] array.AsyncExecutor<T> Used to execute asynchronous tasks, e.g.AsyncExecutor.Task<T> Average Maintains an approximation of an average of positive values by keeping a number of values and overwriting values when new values are added.
This class uses lockless algorithms and is thread-safeAverageMinMax Measures min and max in addition to averageBase64 Encodes and decodes to and from Base64 notation.Base64.InputStream ABase64.InputStream
will read data from another java.io.InputStream, given in the constructor, and encode/decode to/from Base64 notation on the fly.Base64.OutputStream ABase64.OutputStream
will write data to another java.io.OutputStream, given in the constructor, and encode/decode to/from Base64 notation on the fly.BaseDataOutputStream ImplementsDataOutput
in a generic manner, so that subclasses can implement specific behavior.Bits Class (similar to (and partly copied from) java.nio.Bits) containing helper methods to encode variables (e.g.BlockingInputStream Bounded input stream.BoundedHashMap<K,V> Bounded linked hashmap; used by SEQUENCERBoundedList<T> A bounded subclass of LinkedList, oldest elements are removed once max capacity is exceeded.Buffer<T> Base class for message buffers.Buffer.Options ByteArray Byte array with an offset and length.
Note that the underlying byte array must not be changed as long as this instance is in use !ByteArrayDataInputStream ImplementsDataInput
over a byte[] buffer.ByteArrayDataOutputStream ImplementsDataOutput
over a byte[] buffer.ByteBufferInputStream Class usingByteBuffer
and implementingDataInput
.ByteBufferOutputStream Class usingByteBuffer
and implementingDataOutput
.ConcurrentLinkedBlockingQueue<T> Attempt at writing a fast transfer queue, which is bounded.ConcurrentLinkedBlockingQueue2<T> Attempt at writing a fast transfer queue, which is bounded.CondVar A condition variable with methods for (timed) waiting and signallingCredit Maintains credits for a unicast destination.CreditMap Maintains credits for senders, when credits fall below 0, a sender blocks until new credits have been received.CustomRejectionPolicy // TODO: Document thisDefaultSocketFactory Default implementation, ignores service namesDefaultThreadFactory Thread factory mainly responsible for naming of threads.Delayer<T> Collects actions by key and executes them - if a predicate is true - every N ms.Digest A message digest containing - for each member - the highest seqno delivered (hd) and the highest seqno received (hr).Digest.Entry Keeps track of one members plus its highest delivered and received seqnosDirectExecutor DynamicBuffer<T> Copy ofTable
.ExpiryCache<K> Cache which maintains timestamps for keys, and methods to remove/replace expired keys.ExtendedUUID Subclass ofUUID
accommodating additional data such as a flag and a small hashmap.FastArray<T> SimpleFileWatcher FixedBuffer<T> Ring buffer of fixed capacity.FixedSizeBitSet Class copied fromBitSet
.FlagsUUID Subclass ofUUID
accommodating additional data such as a flag.GenerateGettersAndSetters Given a class, generates code for getters and setters for all attributes and writes it to stdoutGenerateProfilingScript Takes a list of methods to profile and generates the Byteman script from them.GetNetworkInterfaces Lists all network interfaces on a systemHeaders Helper class providing functions to manipulate the headers array inBaseMessage
.InputStreamAdapter ExtendsInputStream
from aByteArrayDataInputStream
.IntHashMap<T> A hashmap where keys have to be ints.LazyThreadFactory Lazily names threads: whenever the address or cluster name is changed, all threads are renamedLongSizeStreamable LongTuple<V> A tuple with a long (primitive) first valueMaxOneThreadPerSender MessageProcessingPolicy
which processes regular messages and message batches by assigning a max of 1 thread per message from the same sender.MergeId ID to uniquely identify a mergeMessageBatch Represents a message batch; multiple messages from the same sender to the same receiver(s).MessageCache A cache associating members and messagesMetrics Extracts all attributes and methods annotated withManagedAttribute
and returns them as a map of names associated with [getter-method/description tuples].Metrics.Entry<T> MockTransport A dummy implementation ofTP
MutableDigest A mutable version of Digest.MyReceiver<T> Generic receiver for a JChannelNameCache Maintains the mappings between addresses and logical names (moved out of UUID.cache into a separate class)NonBlockingCredit Non-blocking credit for a unicast destination.
Instead of blocking when insufficient credits are available for sending a message, this class queues the message and sends it at a later time when enough credits have been received to send it.
JIRA: https://issues.redhat.com/browse/JGRP-2172NonBlockingCreditMap ObjectInputStreamWithClassloader OverrideObjectInputStream.resolveClass(java.io.ObjectStreamClass)
using the passed-in classloaderObjectWrapperPrimitive Wraps a primitive object (e.g.ObjectWrapperSerializable Wraps an object and its serialized form.OneTimeAddressGenerator Implementation ofAddressGenerator
which is configured with an initial value, and after that random values are generated.OutputStreamAdapter ExtendsOutputStream
from aByteArrayDataOutputStream
.Owner Represents an 'owner', which is an address and thread IDPaddedAtomicBoolean PaddedAtomicInteger PaddedAtomicLong Copied from http://mechanical-sympathy.blogspot.ch/2011/08/false-sharing-java-7.html.PartialOutputStream Decorates an output stream (DataOutput
) and writes only a subset [start..end] (both indices inclusive) of the original data to the underlying output stream.
Example:PassRegularMessagesUpDirectly MessageProcessingPolicy
which passes regular messages and message batches up directly (on the same thread), but passes OOB messages to the thread pool.ProcessingQueue<T> A queue with many producers and consumers.Profiler Maintains averages for time values measured betweenProfiler.start()
andProfiler.stop()
.ProgressCheckRejectionPolicy DetectsPromise<T> Allows a thread to submit an asynchronous request and to wait for the result.PropertiesToAsciidoc Iterates over all concrete Protocol classes and creates tables with Protocol's properties.Range Ref<T> Keeps a reference to another objectReloadingX509KeyManager AX509ExtendedKeyManager
which uses a @FileWatcher
to check for changes.ReloadingX509TrustManager AX509ExtendedTrustManager
which uses a @FileWatcher
to check for changes.RequestTable<T> Table for storing requests associated with monotonically increasing sequence numbers (seqnos).ResourceManager Manages resources such as multicast addresses and multicast ports, and TCP ports.ResponseCollector<T> Similar to AckCollector, but collects responses from cluster members, not just acks.ResponseCollectorTask<T> Task which is seeded with an initial membership.Responses Manages responses for the discovery protocol.Responses.PingDataIterator RingBuffer<T> Ring buffer of fixed capacity designed for multiple writers but only a single reader.RingBufferSeqnoLockless<T> Ring buffer, implemented with a circular array.RingBufferSeqnoOld<T> Ring buffer, implemented with a circular array.RpcStats Keeps track of stats for sync and async unicasts and multicastsRpcStats.Result RpcStats.RTTStat Rsp<T> Class that represents a response from a communicationRspList<T> Contains responses from all members.RTT Measures round-trip times (RTT) between nodesRunner Runs a given function in a loop (in a separate thread) until it is stoppedSeqnoList A bitset of missing messages with a fixed size.ShutdownRejectedExecutionHandler ShutdownRejectedExecutionHandler is a decorator RejectedExecutionHandler used in all JGroups ThreadPoolExecutor(s).SizeBoundedQueue<T> Blocking FIFO queue bounded by the max number of bytes of all elements.SizeBoundedQueue.El<T> SslContextFactory SslContextFactory.SslContextFactory.Context StateTransferResult Encapsulates the result of a state transfer.SubmitToThreadPool Default message processing policy.SuppressCache<T> Cache which keeps a timestamp and counter for every key.SuppressCache.Value SuppressLog<T> Log (usingSuppressCache
) which suppresses (certain) messages from the same member for a given timeTable<T> A store for elements (typically messages) to be retransmitted or delivered.Tests Common functions for all testsThreadCreator ThreadPool Thread pool based onThreadPoolExecutor
TimeScheduler3 Implementation ofTimeScheduler
.TimeScheduler3.Task TimeService Provides a coarse grained time service.TLS TLS.SniMatcherConverter Triple<V1,V2,V3> Holds 3 values, useful when we have a map with a key, but more than 1 value and we don't want to create a separate holder object for the values, and don't want to pass the values as a list or array.Tuple<V1,V2> Holds 2 values, useful when we have a map with a key, but more than 1 value and we don't want to create a separate holder object for the values, and don't want to pass the values as a list or array.UnbatchOOBBatches Same asMaxOneThreadPerSender
, but for OOB message batches, every message of the batch is passed to the thread pool separately (https://issues.redhat.com/browse/JGRP-2800).Util Collection of various utility routines that can not be assigned to other classes.UUID Logical address which is unique over space and time.WriteVersionTo Extracts version and codename from pom.xml and writes them to ./classes/JGROUPS_VERSION.propertiesXMLSchemaGenerator Iterates over all concrete Protocol classes and creates XML schema used for validation of configuration files. -
Enum Summary Enum Description CompletableFutures Utility class withCompletableFuture
andCompletionStage
useful methods.MessageBatch.Mode RpcStats.Type StackType SuppressLog.Level TimeScheduler3.TaskType TLSClientAuth Util.AddressScope -
Exception Summary Exception Description NoProgressException Exception raised when a threadpool rejects jobs but shows no progress.