Пример #1
0
        private List <TransactionExecutor> MockFillYCSBWorkload(int offset = 0, int limit = -1)
        {
            int appendCount = limit == -1 ? this.executorCount : limit;
            List <TransactionExecutor> executors = new List <TransactionExecutor>();

            IDataGenerator generator      = this.BuildDataGenerator();
            var            workloadAction = this.BuildWorkloadAction(generator);

            StoredProcedureWorkload.Reload = workloadAction;
            StoredProcedureType spType = this.GetStoredProcedureType(config.Type);

            for (int i = offset; i < offset + appendCount; i++)
            {
                Queue <TransactionRequest> reqQueue = new Queue <TransactionRequest>();
                StoredProcedureWorkload    workload = GetStoredProcedureWorkload(config.Type, config.QueryCount);

                this.totalTasks += this.txCountPerExecutor;
                int partition_index = i % this.versionDb.PartitionCount;

                int txRangeStart = i;
                if (config.MultiProcessMode)
                {
                    txRangeStart = i + config.ProcessOffset * RANGE_OFFSET_PER_PROCESS;
                }
                executors.Add(new TransactionExecutor(this.versionDb, null, reqQueue, partition_index, txRangeStart, 0,
                                                      null, tables, null, null, this.recordCount, this.txCountPerExecutor, null, workload, spType, config.PipelineSize));

                Console.WriteLine("Filled {0}-th executors", i + 1);
            }

            return(executors);
        }
Пример #2
0
        private List <TransactionExecutor> fillYCSBWorkLoad()
        {
            List <TransactionExecutor> executorList = new List <TransactionExecutor>();

            IDataGenerator generator      = this.BuildDataGenerator();
            var            workloadAction = this.BuildWorkloadAction(generator);

            StoredProcedureWorkload.Reload = workloadAction;
            StoredProcedureType type = this.GetStoredProcedureType(config.Type);

            this.totalTasks = this.txCountPerExecutor * executorCount;

            for (int i = 0; i < executorCount; i++)
            {
                int partition_index = i % this.versionDb.PartitionCount;
                Queue <TransactionRequest> requestQueue = new Queue <TransactionRequest>();
                for (int j = 0; j < this.txCountPerExecutor; j++)
                {
                    StoredProcedureWorkload workload = GetStoredProcedureWorkload(config.Type, config.QueryCount);
                    StoredProcedureWorkload.Reload(workload);
                    string             sessionId = (i * this.txCountPerExecutor + j + 1).ToString();
                    TransactionRequest request   = new TransactionRequest(sessionId, workload, StoredProcedureType.YCSBStordProcedure);
                    requestQueue.Enqueue(request);
                }
                executorList.Add(new TransactionExecutor(this.versionDb, null, requestQueue, partition_index,
                                                         i, 0, null, tables, null, null, this.recordCount, this.txCountPerExecutor, null, null,
                                                         type, config.PipelineSize));
            }
            return(executorList);
        }
Пример #3
0
        public override void Set(StoredProcedureWorkload baseWorkload)
        {
            YCSBWorkload workload = baseWorkload as YCSBWorkload;

            this.Type    = workload.Type;
            this.Key     = workload.Key;
            this.Value   = workload.Value;
            this.TableId = workload.TableId;
        }
Пример #4
0
 public TransactionRequest(
     string sessionId,
     StoredProcedureWorkload workload,
     StoredProcedureType type)
 {
     this.SessionId         = sessionId;
     this.Workload          = workload;
     this.OperationType     = OperationType.Open;
     this.IsStoredProcedure = true;
     this.ProcedureType     = type;
 }
Пример #5
0
        public override void Start(
            string sessionId,
            StoredProcedureWorkload workload)
        {
            this.sessionId = sessionId;
            if (this.workload == null)
            {
                this.workload = new YCSBWorkload(null, null, null, null);
            }
            YCSBWorkload ycsbWorkload = workload as YCSBWorkload;

            this.workload.Set(ycsbWorkload);

            this.Start();
        }