public class RingBufferBundlerLockless2 extends BaseBundler
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicLong |
accumulated_bytes |
protected Message[] |
buf |
protected Runner |
bundler_thread |
static Message |
NULL_MSG |
protected java.util.concurrent.atomic.AtomicInteger |
num_threads |
protected java.util.concurrent.atomic.AtomicInteger |
read_index |
protected int |
ri |
protected java.lang.Runnable |
run_function |
protected java.lang.Runnable |
stop_function |
protected static java.lang.String |
THREAD_NAME |
protected java.util.concurrent.atomic.AtomicBoolean |
unparking |
protected java.util.concurrent.atomic.AtomicInteger |
write_index |
Constructor and Description |
---|
RingBufferBundlerLockless2() |
RingBufferBundlerLockless2(int capacity) |
RingBufferBundlerLockless2(int capacity,
boolean padded) |
Modifier and Type | Method and Description |
---|---|
int |
_readMessages() |
protected int |
_size(int ri,
int wi) |
protected boolean |
advanceReadIndex(int wi) |
protected static int |
assertPositive(int value,
java.lang.String message) |
protected int |
getWriteIndex(int current_read_index) |
protected int |
increment(int index) |
protected int |
index(int idx) |
void |
init(TP transport)
Called after creation of the bundler
|
protected int |
marshalMessagesToSameDestination(Address dest,
Message[] buf,
int start_index,
int end_index,
int max_bundle_size) |
int |
readIndex() |
protected void |
readMessages() |
RingBufferBundlerLockless2 |
reset() |
void |
send(Message msg) |
protected int |
sendBundledMessages(Message[] buf,
int read_index,
int write_index)
Read and send messages in range [read-index+1 ..
|
int |
size()
The number of unsent messages in the bundler
|
void |
start()
Called after
Bundler.init(TP) |
void |
stop() |
java.lang.String |
toString() |
protected void |
unparkIfNeeded(long size) |
int |
writeIndex() |
addMessage, checkForSharedTransport, clearMessages, sendBundledMessages, sendMessageList, sendSingleMessage, viewChange
protected Message[] buf
protected final java.util.concurrent.atomic.AtomicInteger read_index
protected int ri
protected final java.util.concurrent.atomic.AtomicInteger write_index
protected final java.util.concurrent.atomic.AtomicLong accumulated_bytes
protected final java.util.concurrent.atomic.AtomicInteger num_threads
protected final java.util.concurrent.atomic.AtomicBoolean unparking
protected Runner bundler_thread
protected static final java.lang.String THREAD_NAME
public static final Message NULL_MSG
protected final java.lang.Runnable run_function
protected final java.lang.Runnable stop_function
public RingBufferBundlerLockless2()
public RingBufferBundlerLockless2(int capacity)
public RingBufferBundlerLockless2(int capacity, boolean padded)
public int readIndex()
public int writeIndex()
public RingBufferBundlerLockless2 reset()
public int size()
Bundler
size
in interface Bundler
size
in class BaseBundler
protected int _size(int ri, int wi)
public void init(TP transport)
Bundler
init
in interface Bundler
init
in class BaseBundler
transport
- the transport, for further referencepublic void start()
Bundler
Bundler.init(TP)
start
in interface Bundler
start
in class BaseBundler
public void stop()
stop
in interface Bundler
stop
in class BaseBundler
public void send(Message msg) throws java.lang.Exception
send
in interface Bundler
send
in class BaseBundler
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
protected void unparkIfNeeded(long size)
protected int getWriteIndex(int current_read_index)
public int _readMessages()
protected boolean advanceReadIndex(int wi)
protected void readMessages()
protected int sendBundledMessages(Message[] buf, int read_index, int write_index)
protected int marshalMessagesToSameDestination(Address dest, Message[] buf, int start_index, int end_index, int max_bundle_size) throws java.lang.Exception
java.lang.Exception
protected final int increment(int index)
protected final int index(int idx)
protected static int assertPositive(int value, java.lang.String message)
Copyright © 1998-2020 Red Hat. All Rights Reserved.