public bool replicateTuples(List <DADTuple> replicatedTuples) { InputTuples.AddRange(replicatedTuples); replicateDepth++; /*if(replicateDepth == LISTA_NEVES.length)*/ return(true); }
public void filterThread() { checkNodeState(); int index = Convert.ToInt32(nodeData.OperationArgs[0]); OperationSymbol oper = StringToOperation(nodeData.OperationArgs[1]); string value = nodeData.OperationArgs[2]; OutputTuples = InputTuples.Where(i => { switch (oper) { case OperationSymbol.equals: return(i.getIndex(index - 1).Equals(value)); case OperationSymbol.lesser: return(i.getIndex(index - 1).CompareTo(value) < 0); case OperationSymbol.greater: return(i.getIndex(index - 1).CompareTo(value) > 0); default: return(false); } }).ToList(); replicationAndDownstreaming(); }
public void customThread() { checkNodeState(); byte[] code = Encoding.ASCII.GetBytes(nodeData.OperationArgs[0]); string className = nodeData.OperationArgs[1]; Assembly assembly = Assembly.Load(code); // Walk through each type in the assembly looking for our class foreach (Type type in assembly.GetTypes()) { if (type.IsClass == true) { if (type.FullName.EndsWith("." + className)) { // create an instance of the object object ClassObj = Activator.CreateInstance(type); // Dynamically Invoke the method object[] args = new object[] { InputTuples.Select(i => i.Items) }; object resultObject = type.InvokeMember("CustomOperation", BindingFlags.Default | BindingFlags.InvokeMethod, null, ClassObj, args); IList <IList <string> > result = (IList <IList <string> >)resultObject; OutputTuples = new List <DADTuple>(); foreach (var res in result) { OutputTuples.Add(new DADTuple(res.ToArray())); } //Console.WriteLine("Map call result was: "); //foreach (IList<string> tuple in result) //{ // Console.Write("tuple: "); // foreach (string s in tuple) // Console.Write(s + " ,"); // Console.WriteLine(); //} return; } } } throw (new System.Exception("could not invoke method")); }