Esempio n. 1
0
        public DirectorNodeService(string TAG, IEnumerable <NodeName> allNodeNames, INodeProxyProvider proxyProvider, DCEPSettings settings)
        {
            this.TAG                   = TAG + "[DirectorNodeService] ";
            this.allNodeNames          = allNodeNames;
            this.settings              = settings;
            this.localNodeCanTerminate = false;
            if (settings.duration != 0)
            {
                this.durationMS = settings.timeUnit.GetTimeSpanFromDuration(settings.duration).TotalMilliseconds;
            }

            experimentRunMessageQueue = new SerializableQueue <ExperimentRunNodeDataMessage>();

            nodesToWaitWithStartingFor = new HashSet <NodeName>(allNodeNames);
            systemState = NodeExecutionState.WaitForStart;

            lastReadyToTerminateSignalTime = new Dictionary <NodeName, double>();
            experimentRunDataByNodeName    = new Dictionary <NodeName, ExperimentRunData>();

            foreach (var nodeName in allNodeNames)
            {
                lastReadyToTerminateSignalTime[nodeName] = -1;
                experimentRunDataByNodeName[nodeName]    = null;
            }

            this.proxyProvider = proxyProvider;

            Thread t = new Thread(new ThreadStart(threadStartMethod));

            t.Start();
        }
        public DatasetPrimitiveEventInputService(INodeProxyProvider proxyProvider, string tag, string filePath,
                                                 NodeName nodeName, DCEPSettings settings) : base(proxyProvider, nodeName)
        {
            TAG = tag + "[DatasetPrimitiveEventInputService] ";
            var inputfilepath = new FileInfo(settings.InputFilePath).Directory.FullName;

            filePath  = filePath.Replace("%NodeName%", nodeName.ToString());
            _filePath = Path.Combine(inputfilepath, Path.GetFileName(filePath));
            _settings = settings;
        }
Esempio n. 3
0
 public DCEPNode(NodeName name, string[] inputlines, DCEPSettings settings)
 {
     TAG = "[" + name + "] ";
     Console.WriteLine(TAG + "DCEPNode Constructor called.");
     state = NodeExecutionState.WaitForStart;
     receivedEventCount      = 0;
     sentReadyToStartMessage = false;
     nodeName            = name;
     externalEventQueue  = new SerializableQueue <AbstractEvent>();
     internalEventQueue  = new SerializableQueue <AbstractEvent>();
     controlMessageQueue = new SerializableQueue <DCEPControlMessage>();
     queryProcessors     = new List <QueryProcessor>();
     this.settings       = settings;
     executionPlan       = new ExecutionPlan(inputlines);
     benchmarkMeter      = new BenchmarkMeter(settings, nodeName);
     createQueryProcessors(executionPlan.queriesByNodeName[nodeName]);
 }
        public RandomPrimitiveEventGenerationService(NodeName nodeName, NodeParams nodeparams, INodeProxyProvider proxyProvider, DCEPSettings settings) : base(proxyProvider, nodeName)
        {
            this.nodeName   = nodeName;
            eventGenerators = new List <PrimitiveEventGenerator>();


            foreach (var e in nodeparams.primitiveEventNames.Zip(nodeparams.primitiveEventRates, (e, r) => new { Name = e, Rate = r }))
            {
                if (e.Rate > 0)
                {
                    eventGenerators.Add(new PrimitiveEventGenerator(e.Rate, settings.timeUnit, e.Name));
                }
            }
        }