public class RingBufferBundlerLockless2 extends BaseBundler
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
accumulated_bytes |
protected Message[] |
buf |
protected Runner |
bundler_thread |
static Message |
NULL_MSG |
protected AtomicInteger |
num_threads |
protected AtomicInteger |
read_index |
protected int |
ri |
protected Runnable |
run_function |
protected static String |
THREAD_NAME |
protected AtomicBoolean |
unparking |
protected 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,
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() |
String |
toString() |
protected void |
unparkIfNeeded(long size) |
int |
writeIndex() |
addMessage, clearMessages, sendBundledMessages, sendMessageList, sendSingleMessage, viewChange
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getStats, resetStats
protected Message[] buf
protected final AtomicInteger read_index
protected int ri
protected final AtomicInteger write_index
protected final AtomicLong accumulated_bytes
protected final AtomicInteger num_threads
protected final AtomicBoolean unparking
protected Runner bundler_thread
protected final Runnable run_function
protected static final String THREAD_NAME
public static final Message NULL_MSG
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 Exception
send
in interface Bundler
send
in class BaseBundler
Exception
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 Exception
Exception
protected final int increment(int index)
protected final int index(int idx)
protected static int assertPositive(int value, String message)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.