Package org.jgroups.tests.perf
Class ProgrammaticUPerf
java.lang.Object
org.jgroups.tests.perf.ProgrammaticUPerf
- All Implemented Interfaces:
MethodInvoker,Receiver
Tests the UNICAST by invoking unicast RPCs between a sender and a receiver. Mimicks the DIST mode in Infinispan
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprivate static final shortprotected intprivate byte[]private JChannelprivate final AtomicIntegerprivate RpcDispatcherprotected Threadprotected static final Stringprivate static final shortprivate static final short(package private) static final Stringprivate Addressprotected booleanprotected intprotected final LongAdderprotected intprotected final LongAdderprotected booleanprotected booleanprivate static final shortprotected booleanprivate static final shortprivate static final shortprivate static final shortprotected doubleprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprivate static final shortprotected booleanprotected intprotected View -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidallowLocalGets(boolean a) protected voidapplyConfig(PerfUtil.Config config) voidbyte[]get(int key) intintintbooleangetOOB()doublebooleangetSync()intgetTime()(package private) static voidhelp()voidinit(String name, AddressGenerator generator, String bind_addr, int bind_port, boolean udp, String mcast_addr, int mcast_port, String initial_hosts) (package private) voidAn implementation invokes a method associated with a given ID and the given args against a target objectstatic void(package private) int(package private) static doubleprotected static Stringprint(AverageMinMax avg, boolean details) protected StringprintAverage(long start_time) booleanvoidprintDetails(boolean p) booleanvoidprintInvokers(boolean p) protected voidvoidput(int key, byte[] val) voidquitAll()voidsetAnycastCount(int t) voidsetMsgSize(int t) voidsetNumThreads(int t) voidsetOOB(boolean oob) voidsetReadPercentage(double r) voidsetSync(boolean s) voidsetTime(int t) (package private) voidKicks off the benchmark on all cluster nodesprotected void(package private) voidstop()protected voidvoidviewAccepted(View new_view) Called when a change in membership has occurred.
-
Field Details
-
channel
-
local_addr
-
disp
-
groupname
- See Also:
-
members
-
view
-
looping
protected volatile boolean looping -
event_loop_thread
-
num_reads
-
num_writes
-
sync
protected boolean sync -
oob
protected boolean oob -
num_threads
protected int num_threads -
time
protected int time -
msg_size
protected int msg_size -
anycast_count
protected int anycast_count -
read_percentage
protected double read_percentage -
allow_local_gets
protected boolean allow_local_gets -
print_invokers
protected boolean print_invokers -
print_details
protected boolean print_details -
START
private static final short START- See Also:
-
GET
private static final short GET- See Also:
-
PUT
private static final short PUT- See Also:
-
GET_CONFIG
private static final short GET_CONFIG- See Also:
-
SET_SYNC
private static final short SET_SYNC- See Also:
-
SET_OOB
private static final short SET_OOB- See Also:
-
SET_NUM_THREADS
private static final short SET_NUM_THREADS- See Also:
-
SET_TIME
private static final short SET_TIME- See Also:
-
SET_MSG_SIZE
private static final short SET_MSG_SIZE- See Also:
-
SET_ANYCAST_COUNT
private static final short SET_ANYCAST_COUNT- See Also:
-
SET_READ_PERCENTAGE
private static final short SET_READ_PERCENTAGE- See Also:
-
ALLOW_LOCAL_GETS
private static final short ALLOW_LOCAL_GETS- See Also:
-
PRINT_INVOKERS
private static final short PRINT_INVOKERS- See Also:
-
PRINT_DETAILS
private static final short PRINT_DETAILS- See Also:
-
QUIT_ALL
private static final short QUIT_ALL- See Also:
-
COUNTER
-
BUFFER
private byte[] BUFFER -
format
- See Also:
-
-
Constructor Details
-
ProgrammaticUPerf
public ProgrammaticUPerf()
-
-
Method Details
-
getSync
public boolean getSync() -
setSync
public void setSync(boolean s) -
getOOB
public boolean getOOB() -
setOOB
public void setOOB(boolean oob) -
getNumThreads
public int getNumThreads() -
setNumThreads
public void setNumThreads(int t) -
getTime
public int getTime() -
setTime
public void setTime(int t) -
getMsgSize
public int getMsgSize() -
setMsgSize
public void setMsgSize(int t) -
getAnycastCount
public int getAnycastCount() -
setAnycastCount
public void setAnycastCount(int t) -
getReadPercentage
public double getReadPercentage() -
setReadPercentage
public void setReadPercentage(double r) -
allowLocalGets
public boolean allowLocalGets() -
allowLocalGets
public void allowLocalGets(boolean a) -
printInvokers
public boolean printInvokers() -
printInvokers
public void printInvokers(boolean p) -
printDetails
public boolean printDetails() -
printDetails
public void printDetails(boolean p) -
init
public void init(String name, AddressGenerator generator, String bind_addr, int bind_port, boolean udp, String mcast_addr, int mcast_port, String initial_hosts) throws Throwable - Throws:
Throwable
-
stop
void stop() -
startEventThread
protected void startEventThread() -
stopEventThread
protected void stopEventThread() -
viewAccepted
Description copied from interface:ReceiverCalled when a change in membership has occurred. No long running actions, sending of messages or anything that could block should be done in this callback. If some long running action needs to be performed, it should be done in a separate thread.Note that on reception of the first view (a new member just joined), the channel will not yet be in the connected state. This only happens when
JChannel.connect(String)returns.- Specified by:
viewAcceptedin interfaceReceiver
-
invoke
Description copied from interface:MethodInvokerAn implementation invokes a method associated with a given ID and the given args against a target object- Specified by:
invokein interfaceMethodInvoker- Parameters:
target- The object against which to invoke the methodmethod_id- The ID of the method. The implementation must assign unique IDs and associate them somehow with a method to invokeargs- The arguments of the invocation- Returns:
- The result. It may be null if a method returns void
- Throws:
Exception- Thrown if the invocation threw an exception. The real exception may be wrapped in anInvocationTargetException.
-
startTest
- Throws:
Exception
-
quitAll
public void quitAll() -
printAverage
-
get
public byte[] get(int key) -
put
public void put(int key, byte[] val) -
getConfig
-
applyConfig
-
eventLoop
public void eventLoop() -
invoke
- Throws:
Exception
-
startBenchmark
void startBenchmark()Kicks off the benchmark on all cluster nodes -
parseReadPercentage
- Throws:
Exception
-
parseAnycastCount
- Throws:
Exception
-
printView
protected void printView() -
print
-
main
- Throws:
Exception
-
help
static void help()
-