Пример #1
0
        /*
         * For every Operator, set itself as outputOperator at all of its inputOperators.
         */
        public static void setOperatorOutputs()
        {
            foreach (OperatorInformation info in operatorsArray)
            {
                foreach (string input in info.inputsource)
                {
                    foreach (OperatorInformation info2 in operatorsArray.FindAll(x => x.name.Equals(input)))
                    {
                        info2.outputs.Add(sourceoperators.Find(x => x.name.Equals(info.name) && x.portnumber == info.port));
                    }
                }
            }

            List <OperatorInformation> outputOps = new List <OperatorInformation>();

            foreach (OperatorInformation info in operatorsArray)
            {
                if (info.outputs.Count == 0 && operatorsArray.FindAll(x => x.name.Equals("Out" + info.name)).Count == 0)
                {
                    OperatorInformation outinfo = new OperatorInformation();
                    int operatorCount           = ConfigFile.operatorCount;
                    outinfo.id   = operatorCount;
                    outinfo.name = "Out" + info.name;
                    outinfo.type = OperatorSpec.OUT;
                    outinfo.port = portnumber;
                    string ip = info.address.Split(':')[0] + ":" + info.address.Split(':')[1];
                    outinfo.address     = ip + ":" + (12500 + outinfo.id);
                    outinfo.path        = "..\\..\\doc\\output.txt";
                    outinfo.inputsource = new List <string>()
                    {
                        info.name
                    };
                    outinfo.outputs = new List <SourceOPs>();
                    outputOps.Add(outinfo);
                    sourceoperators.Add(new SourceOPs(outinfo.name, outinfo.port));
                    int id = machines.Find(x => x.machineURL.Equals(ip)).replicas.Count;
                    machines.Find(x => x.machineURL.Equals(ip)).addReplica(new Replica(outinfo.address + "/op", id, outinfo.port));
                    portnumber++;
                    foreach (OperatorInformation info2 in operatorsArray.FindAll(x => x.name.Equals(info.name)))
                    {
                        info2.outputs.Add(new SourceOPs(outinfo.name, outinfo.port));
                    }
                }
            }
            operatorsArray.AddRange(outputOps);
        }
Пример #2
0
 public void setInformation(OperatorInformation info)
 {
     information         = info;
     informationUploaded = true;
 }
Пример #3
0
 public ThreadOperator(OperatorInformation information, List <SourceOPs> sourceoperators)
 {
     this.information     = information;
     this.portnumber      = information.port;
     this.sourceoperators = sourceoperators;
 }
Пример #4
0
 public FilterExecutor(OperatorInformation information)
 {
     this.information = information;
     this.input       = new List <Tuple>();
 }
Пример #5
0
 public CountExecutor(OperatorInformation information)
 {
     this.information = information;
     this.input       = new List <Tuple>();
     this.counter     = 0;
 }
Пример #6
0
 public UniqExecutor(OperatorInformation information)
 {
     this.information = information;
     this.input       = new List <Tuple>();
     this.passedItems = new List <string>();
 }