public class RingBufferBundlerLockless extends BaseBundler
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicLong |
accumulated_bytes |
protected Message[] |
buf |
protected Runner |
bundler_thread |
protected java.util.concurrent.atomic.AtomicInteger |
num_threads |
protected int |
read_index |
protected java.lang.Runnable |
run_function |
protected java.util.concurrent.atomic.AtomicInteger |
size |
protected java.lang.Runnable |
stop_function |
protected static java.lang.String |
THREAD_NAME |
protected java.util.concurrent.atomic.AtomicInteger |
tmp_write_index |
protected java.util.concurrent.atomic.AtomicBoolean |
unparking |
protected int |
write_index |
protected java.util.concurrent.atomic.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,
java.lang.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() |
java.lang.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 java.util.concurrent.atomic.AtomicInteger tmp_write_index
protected final java.util.concurrent.atomic.AtomicInteger write_permits
protected final java.util.concurrent.atomic.AtomicInteger size
protected final java.util.concurrent.atomic.AtomicInteger num_threads
protected final java.util.concurrent.atomic.AtomicLong accumulated_bytes
protected final java.util.concurrent.atomic.AtomicBoolean unparking
protected Runner bundler_thread
protected static final java.lang.String THREAD_NAME
protected final java.lang.Runnable run_function
protected final java.lang.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 java.lang.Exception
send
in interface Bundler
send
in class BaseBundler
java.lang.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 java.lang.String toString()
toString
in class java.lang.Object
public int _readMessages()
protected int marshalMessagesToSameDestination(Address dest, Message[] buf, int start_index, int available_msgs, 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.