Class ProgrammaticUPerf2

  • All Implemented Interfaces:
    Receiver

    public class ProgrammaticUPerf2
    extends java.lang.Object
    implements Receiver
    Tests the UNICAST by invoking unicast RPCs between a sender and a receiver. Mimicks the DIST mode in Infinispan
    • Field Detail

      • channel

        private static final JChannel channel
      • local_addr

        private static Address local_addr
      • members

        protected static final java.util.List<Address> members
      • view

        protected static volatile View view
      • looping

        protected volatile boolean looping
      • event_loop_thread

        protected java.lang.Thread event_loop_thread
      • num_reads

        protected final java.util.concurrent.atomic.LongAdder num_reads
      • num_writes

        protected final java.util.concurrent.atomic.LongAdder 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
      • COUNTER

        private final java.util.concurrent.atomic.AtomicInteger COUNTER
      • BUFFER

        private byte[] BUFFER
    • Constructor Detail

      • ProgrammaticUPerf2

        public ProgrammaticUPerf2()
    • Method Detail

      • 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

        public void init​(java.lang.String name,
                         java.lang.String bind_addr,
                         int bind_port)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stop

        static void stop()
      • startEventThread

        protected void startEventThread()
      • stopEventThread

        protected void stopEventThread()
      • viewAccepted

        public void viewAccepted​(View v)
        Description copied from interface: Receiver
        Called 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:
        viewAccepted in interface Receiver
      • invoke

        public static java.lang.Object invoke​(java.lang.Object target,
                                              short method_id,
                                              java.lang.Object[] args)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • startTest

        public PerfUtil.Results startTest()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • quitAll

        public void quitAll()
      • printAverage

        protected java.lang.String printAverage​(long start_time)
      • get

        public byte[] get​(int key)
      • put

        public void put​(int key,
                        byte[] val)
      • applyConfig

        protected static void applyConfig​(PerfUtil.Config config)
      • eventLoop

        public void eventLoop()
      • invoke

        protected static void invoke​(short method_id,
                                     java.lang.Object... args)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • startBenchmark

        protected void startBenchmark()
        Kicks off the benchmark on all cluster nodes
      • parseReadPercentage

        static double parseReadPercentage()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseAnycastCount

        protected static int parseAnycastCount()
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • printView

        protected static void printView()
      • print

        protected static java.lang.String print​(AverageMinMax avg,
                                                boolean details)
      • main

        public static void main​(java.lang.String[] args)
      • help

        static void help()