Class UPerf

  • All Implemented Interfaces:
    Receiver

    public class UPerf
    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

      • local_addr

        private Address local_addr
      • members

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

        protected volatile View view
      • looping

        protected volatile boolean looping
      • num_reads

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

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

        protected boolean print_invokers
      • print_details

        protected boolean print_details
      • rpc_timeout

        protected long rpc_timeout
      • METHODS

        private static final java.lang.reflect.Method[] METHODS
      • OOB

        protected static final java.lang.reflect.Field OOB
      • NUM_THREADS

        protected static final java.lang.reflect.Field NUM_THREADS
      • TIME

        protected static final java.lang.reflect.Field TIME
      • RPC_TIMEOUT

        protected static final java.lang.reflect.Field RPC_TIMEOUT
      • MSG_SIZE

        protected static final java.lang.reflect.Field MSG_SIZE
      • ANYCAST_COUNT

        protected static final java.lang.reflect.Field ANYCAST_COUNT
      • READ_PERCENTAGE

        protected static final java.lang.reflect.Field READ_PERCENTAGE
      • PRINT_INVOKERS

        protected static final java.lang.reflect.Field PRINT_INVOKERS
      • PRINT_DETAILS

        protected static final java.lang.reflect.Field PRINT_DETAILS
      • BUFFER

        private byte[] BUFFER
    • Constructor Detail

      • UPerf

        public UPerf()
    • Method Detail

      • init

        public void init​(java.lang.String props,
                         java.lang.String name,
                         AddressGenerator generator,
                         int bind_port,
                         boolean use_fibers)
                  throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • stop

        void stop()
      • stopEventLoop

        protected void stopEventLoop()
      • viewAccepted

        public void viewAccepted​(View new_view)
        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
      • startTest

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

        public void quitAll()
      • printAverage

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

        public void set​(java.lang.String field_name,
                        java.lang.Object value)
      • get

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

        public void put​(long key,
                        byte[] val)
      • eventLoop

        public void eventLoop()
      • startBenchmark

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

        static double getReadPercentage()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAnycastCount

        int getAnycastCount()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeFieldAcrossCluster

        protected void changeFieldAcrossCluster​(java.lang.reflect.Field field,
                                                java.lang.Object value)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • printView

        protected void printView()
      • print

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

        protected static java.util.List<java.lang.String> getSites​(JChannel channel)
      • getReceiver

        private Address getReceiver()
        Picks the next member in the view
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • help

        static void help()