Package org.jgroups.tests.perf
Class ProgrammaticUPerf2
java.lang.Object
org.jgroups.tests.perf.ProgrammaticUPerf2
- All Implemented Interfaces:
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 static booleanprivate static final shortprotected static intprivate static final Stringprivate byte[]private static final JChannelprivate final AtomicIntegerprivate static final RpcDispatcherprotected Threadprotected static final Stringprivate static final shortprivate static final shortprivate static final Stringprotected static NonReflectiveProbeHandlerprivate static Addressprotected booleanprivate static final Stringprotected static intprotected final LongAdderprotected static intprotected final LongAdderprotected static booleanprotected static booleanprivate static final shortprotected static booleanprivate static final shortprivate static final shortprivate static final shortprotected static 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 static booleanprotected static intprotected static View -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic voidallowLocalGets(boolean a) protected static voidapplyConfig(PerfUtil.Config config) voidbyte[]get(int key) static intstatic PerfUtil.Configstatic intstatic intstatic booleangetOOB()static doublestatic booleangetSync()static intgetTime()(package private) static voidhelp()voidprotected static voidstatic Objectstatic voidprotected static int(package private) static doubleprotected static Stringprint(AverageMinMax avg, boolean details) protected StringprintAverage(long start_time) static booleanstatic voidprintDetails(boolean p) static booleanstatic voidprintInvokers(boolean p) protected static voidvoidput(int key, byte[] val) voidquitAll()static voidsetAnycastCount(int t) static voidsetMsgSize(int t) static voidsetNumThreads(int t) static voidsetOOB(boolean o) static voidsetReadPercentage(double r) static voidsetSync(boolean s) static voidsetTime(int t) protected voidKicks off the benchmark on all cluster nodesprotected void(package private) static voidstop()protected voidvoidviewAccepted(View v) Called when a change in membership has occurred.
-
Field Details
-
groupname
- See Also:
-
channel
-
disp
-
BIND_ADDR
- See Also:
-
MCAST_ADDR
- See Also:
-
local_addr
-
members
-
view
-
h
-
looping
protected volatile boolean looping -
event_loop_thread
-
num_reads
-
num_writes
-
sync
protected static boolean sync -
oob
protected static boolean oob -
num_threads
protected static int num_threads -
time
protected static int time -
msg_size
protected static int msg_size -
anycast_count
protected static int anycast_count -
read_percentage
protected static double read_percentage -
allow_local_gets
protected static boolean allow_local_gets -
print_invokers
protected static boolean print_invokers -
print_details
protected static 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
-
ProgrammaticUPerf2
public ProgrammaticUPerf2()
-
-
Method Details
-
getSync
public static boolean getSync() -
setSync
public static void setSync(boolean s) -
getOOB
public static boolean getOOB() -
setOOB
public static void setOOB(boolean o) -
getNumThreads
public static int getNumThreads() -
setNumThreads
public static void setNumThreads(int t) -
getTime
public static int getTime() -
setTime
public static void setTime(int t) -
getMsgSize
public static int getMsgSize() -
setMsgSize
public static void setMsgSize(int t) -
getAnycastCount
public static int getAnycastCount() -
setAnycastCount
public static void setAnycastCount(int t) -
getReadPercentage
public static double getReadPercentage() -
setReadPercentage
public static void setReadPercentage(double r) -
allowLocalGets
public static boolean allowLocalGets() -
allowLocalGets
public static void allowLocalGets(boolean a) -
printInvokers
public static boolean printInvokers() -
printInvokers
public static void printInvokers(boolean p) -
printDetails
public static boolean printDetails() -
printDetails
public static void printDetails(boolean p) -
init
- Throws:
Exception
-
stop
static 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
- Throws:
Exception
-
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
protected void startBenchmark()Kicks off the benchmark on all cluster nodes -
parseReadPercentage
- Throws:
Exception
-
parseAnycastCount
- Throws:
Exception
-
printView
protected static void printView() -
print
-
main
-
help
static void help()
-