Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TPayload"></typeparam>
 /// <param name="observable"></param>
 /// <param name="startEdgeSelector"></param>
 /// <param name="endEdgeSelector"></param>
 /// <param name="disorderPolicy"></param>
 /// <param name="partitionPolicy"></param>
 /// <returns></returns>
 public IQStreamable <TPayload> RegisterStream <TPayload>(
     IObservable <TPayload> observable,
     Expression <Func <TPayload, long> > startEdgeSelector,
     Expression <Func <TPayload, long> > endEdgeSelector,
     DisorderPolicy disorderPolicy,
     PartitionPolicy partitionPolicy)
 => throw new NotImplementedException();
Ejemplo n.º 2
0
 /// <summary>
 /// Only used when adding source operator, because it cannot be paralelized.
 /// </summary>
 /// <param name="t"></param>
 /// <param name="mgr">Topology manager reference for saving new operators</param>
 internal OperatorNode(TopologyManager mgr, Type t, int outputStreamCount, PartitionPolicy partitionPolicy)
 {
     OperatorGUIDs.Add(Guid.NewGuid());
     OperatorType = t;
     StreamGUID   = Guid.NewGuid();
     SetPartitioner(partitionPolicy);
     OutputStreamCount = outputStreamCount;
     _mgr = mgr;
     mgr.Operators.Add(this);
 }
Ejemplo n.º 3
0
        private void SetPartitioner(PartitionPolicy partitionPolicy)
        {
            switch (partitionPolicy)
            {
            case PartitionPolicy.RoundRobin:
                Partitioner = typeof(RoundRobinPartitioner);
                break;

            case PartitionPolicy.Random:
                Partitioner = typeof(RandomPartitioner);
                break;

            case PartitionPolicy.Key:
                Partitioner = typeof(KeyPartitioner);
                break;

            default: throw new ArgumentOutOfRangeException("Not supported partitioning function");
            }
        }
Ejemplo n.º 4
0
        public OperatorNode Map(Type t, int parallelism = 1, int outputStreamCount = 1, PartitionPolicy partitionPolicy = PartitionPolicy.RoundRobin)
        {
            if (!DataStreamValidator.ValidateType <IMap>(t))
            {
                new OperatorMismatchException("Operator is not of type IMap");
            }

            return(new OperatorNode(_mgr, this, t, parallelism, outputStreamCount, partitionPolicy));
        }
Ejemplo n.º 5
0
 internal OperatorNode(TopologyManager mgr, OperatorNode previous, Type t, int parallelism, int outputStreamCount, PartitionPolicy partitionPolicy, OperatorNode sourceB)
 {
     for (int i = 0; i < parallelism; i++)
     {
         OperatorGUIDs.Add(Guid.NewGuid());
     }
     Prev.Add(previous);
     OperatorType = t;
     StreamGUID   = Guid.NewGuid();
     Parallelism  = parallelism;
     SetPartitioner(partitionPolicy);
     OutputStreamCount = outputStreamCount;
     _mgr = mgr;
     SourceBPrev.Add(sourceB);
     mgr.Operators.Add(this);
 }
Ejemplo n.º 6
0
 public OperatorNode WindowJoin(Type t, OperatorNode sourceB, int parallelism = 1, int outputStreamCount = 1, PartitionPolicy partitionPolicy = PartitionPolicy.RoundRobin)
 {
     if (!DataStreamValidator.ValidateType <IWindowJoin>(t))
     {
         new OperatorMismatchException("Operator is not of type IWindowJoin");
     }
     return(new OperatorNode(_mgr, this, t, parallelism, outputStreamCount, partitionPolicy, sourceB));
 }
Ejemplo n.º 7
0
        public OperatorNode AddSource(Type source, int outputStreamCount = 1, PartitionPolicy partitionPolicy = PartitionPolicy.RoundRobin)
        {
            var ds = new OperatorNode(this, source, outputStreamCount, partitionPolicy);

            return(ds);
        }