Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public void setInformation(OperatorInformation info)
 {
     information         = info;
     informationUploaded = true;
 }
Exemplo n.º 3
0
 public ThreadOperator(OperatorInformation information, List <SourceOPs> sourceoperators)
 {
     this.information     = information;
     this.portnumber      = information.port;
     this.sourceoperators = sourceoperators;
 }
Exemplo n.º 4
0
 public FilterExecutor(OperatorInformation information)
 {
     this.information = information;
     this.input       = new List <Tuple>();
 }
Exemplo n.º 5
0
 public CountExecutor(OperatorInformation information)
 {
     this.information = information;
     this.input       = new List <Tuple>();
     this.counter     = 0;
 }
Exemplo n.º 6
0
 public UniqExecutor(OperatorInformation information)
 {
     this.information = information;
     this.input       = new List <Tuple>();
     this.passedItems = new List <string>();
 }