public class RingBufferBundlerLockless extends BaseBundler
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
accumulated_bytes |
protected Message[] |
buf |
protected Runner |
bundler_thread |
protected AtomicInteger |
num_threads |
protected int |
read_index |
protected Runnable |
run_function |
protected AtomicInteger |
size |
protected Runnable |
stop_function |
protected static String |
THREAD_NAME |
protected AtomicInteger |
tmp_write_index |
protected AtomicBoolean |
unparking |
protected int |
write_index |
protected AtomicInteger |
write_permits |
Constructor and Description |
---|
RingBufferBundlerLockless() |
RingBufferBundlerLockless(int capacity) |
Modifier and Type | Method and Description |
---|---|
int |
_readMessages() |
protected int |
advanceWriteIndex() |
protected static int |
assertPositive(int value,
String message) |
protected int |
getPermitToWrite() |
protected int |
getWriteIndex() |
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 available_msgs,
int max_bundle_size) |
int |
readIndex() |
protected void |
readMessages() |
void |
reset() |
void |
send(Message msg) |
protected int |
sendBundledMessages(Message[] buf,
int read_index,
int available_msgs)
Read and send messages in range [read-index ..
|
int |
size()
The number of unsent messages in the bundler
|
void |
start()
Called after
Bundler.init(TP) |
void |
stop() |
String |
toString() |
int |
writeIndex() |
addMessage, checkForSharedTransport, clearMessages, sendBundledMessages, sendMessageList, sendSingleMessage, viewChange
protected Message[] buf
protected int read_index
protected volatile int write_index
protected final AtomicInteger tmp_write_index
protected final AtomicInteger write_permits
protected final AtomicInteger size
protected final AtomicInteger num_threads
protected final AtomicLong accumulated_bytes
protected final AtomicBoolean unparking
protected Runner bundler_thread
protected static final String THREAD_NAME
protected final Runnable run_function
protected final Runnable stop_function
public RingBufferBundlerLockless()
public RingBufferBundlerLockless(int capacity)
public int readIndex()
public int writeIndex()
public int size()
Bundler
size
in interface Bundler
size
in class BaseBundler
public void init(TP transport)
Bundler
init
in interface Bundler
init
in class BaseBundler
transport
- the transport, for further referencepublic void reset()
public 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 int getWriteIndex()
protected int getPermitToWrite()
protected int advanceWriteIndex()
protected void readMessages()
protected int sendBundledMessages(Message[] buf, int read_index, int available_msgs)
public int _readMessages()
protected int marshalMessagesToSameDestination(Address dest, Message[] buf, int start_index, int available_msgs, 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 © 2017 JBoss, a division of Red Hat. All rights reserved.