Exemplo n.º 1
0
        public void DoFinishAllActiveTx()
        {
            FwkInfo("Inside DoFinishActiveTx ActiveMap count is {0}", activeTxns.Count);
            Dictionary <TKey, TVal> tempmap = new Dictionary <TKey, TVal>();
            IRegion <TKey, TVal>    region  = GetRegion();
            int timedInterval = GetTimeValue(TimedInterval) * 1000;
            int maxTime       = 10 * timedInterval;

            // Loop over key set sizes
            ResetKey(DistinctKeys);
            int numKeys = GetUIntValue(DistinctKeys);

            ResetKey(COMMITTX);
            bool isCommitTx = GetBoolValue(COMMITTX);

            //bool Finish=true;
            ResetKey(NumThreads);
            int numThreads;

            while ((numThreads = GetUIntValue(NumThreads)) > 0)
            {
                EntryTxTask <TKey, TVal> entrytask = new EntryTxTask <TKey, TVal>(region, numKeys / numThreads, activeTxns, OpMap, true, false, isCommitTx);
                FwkInfo("Running timed task ");
                try
                {
                    RunTask(entrytask, numThreads, -1, timedInterval, maxTime, null);
                }
                catch (ClientTimeoutException)
                {
                    FwkException("In DoFinishAllActiveTx()  Timed run timed out.");
                }
                Thread.Sleep(3000);
                //entrytask.dumpToBB();
            }
        }
Exemplo n.º 2
0
        public void DoBeginTx()
        {
            IRegion <TKey, TVal> region = GetRegion();

            activeTxns = new Dictionary <TransactionId, object>();
            int timedInterval = GetTimeValue(TimedInterval) * 1000;
            int maxTime       = 10 * timedInterval;

            ResetKey(DistinctKeys);

            ResetKey(BEGINTX);
            bool isBeginTx = GetBoolValue(BEGINTX);

            int numKeys = GetUIntValue(DistinctKeys);

            ResetKey(NumThreads);
            int numThreads;

            while ((numThreads = GetUIntValue(NumThreads)) > 0)
            {
                EntryTxTask <TKey, TVal> entrytask = new EntryTxTask <TKey, TVal>(region, numKeys / numThreads, activeTxns, OpMap, false, isBeginTx, false);
                FwkInfo("Running timed task ");
                try
                {
                    RunTask(entrytask, numThreads, -1, timedInterval, maxTime, null);
                }
                catch (ClientTimeoutException)
                {
                    FwkException("In DoBeginTx()  Timed run timed out.");
                }
                Thread.Sleep(3000);
                //entrytask.dumpToBB();
            }
        }
Exemplo n.º 3
0
        public void DoConcTxWithOps()
        {
            FwkInfo("Inside ResumableTx:DoConcTxWithOps()");
            IRegion <TKey, TVal> region = GetRegion();

            activeTxns = new Dictionary <TransactionId, object>();
            OpMap      = new Dictionary <IRegion <TKey, TVal>, Dictionary <TKey, TVal> >();
            int entryCount = GetUIntValue(EntryCount);

            entryCount = (entryCount < 1) ? 10000 : entryCount;

            int secondsToRun = GetTimeValue(WorkTime);

            secondsToRun = (secondsToRun < 1) ? 10 : secondsToRun;

            DateTime now = DateTime.Now;
            DateTime end = now.AddSeconds(secondsToRun);

            int timedInterval = GetTimeValue(TimedInterval) * 1000;
            int maxTime       = 10 * timedInterval;

            // Loop over key set sizes
            ResetKey(DistinctKeys);
            int numKeys = GetUIntValue(DistinctKeys);

            ResetKey(NumThreads);
            int numThreads;

            while ((numThreads = GetUIntValue(NumThreads)) > 0)
            {
                EntryTxTask <TKey, TVal> entrytask = new EntryTxTask <TKey, TVal>(region, numKeys / numThreads, activeTxns, OpMap, false, false, false);
                FwkInfo("Running timed task ");
                try
                {
                    RunTask(entrytask, numThreads, -1, timedInterval, maxTime, null);
                }
                catch (ClientTimeoutException)
                {
                    FwkException("In DoConcTxWithOps()  Timed run timed out.");
                }
                Thread.Sleep(3000);
                //entrytask.dumpToBB();
            }
            FwkInfo("Completed timed task ");
        }
Exemplo n.º 4
0
        public void DoSerialTxWithOps()
        {
            FwkInfo("Inside DoSerialTxWithOps ActiveMap count is {0}", activeTxns.Count);
            IRegion <TKey, TVal> region = GetRegion();
            int entryCount = GetUIntValue(EntryCount);

            entryCount = (entryCount < 1) ? 10000 : entryCount;
            OpMap      = new Dictionary <IRegion <TKey, TVal>, Dictionary <TKey, TVal> >();

            int timedInterval = GetTimeValue("timedInterval") * 1000;
            int maxTime       = 10 * timedInterval;

            // Loop over key set sizes
            ResetKey("distinctKeys");
            int numKeys = GetUIntValue("distinctKeys");

            ResetKey(NumThreads);
            int numThreads;

            while ((numThreads = GetUIntValue(NumThreads)) > 0)
            {
                EntryTxTask <TKey, TVal> entrytask = new EntryTxTask <TKey, TVal>(region, numKeys / numThreads, activeTxns, OpMap, false, false, false);
                FwkInfo("Running timed task ");
                try
                {
                    RunTask(entrytask, numThreads, -1, timedInterval, maxTime, null);
                }
                catch (ClientTimeoutException)
                {
                    FwkException("In DoSerialTxWithOps()  Timed run timed out.");
                }
                FwkInfo("Completed timed task ");
                Thread.Sleep(3000);
                //entrytask.dumpToBB();
            }
        }