MicrosoftResearch / Naiad

The Naiad system provides fast incremental and iterative computation for data-parallel workloads

Home Page:http://microsoftresearch.github.io/Naiad/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Examples project does not build on Mono

mrry opened this issue · comments

Due to a difference in the type inference implementation between .NET and Mono, the Mono build crashes with the following error:

        Naiad/ConnectedComponents.cs(77,49): error CS0315: The type `Microsoft.Research.Naiad.Dataflow.IterationIn<TTime>' cannot be used as type parameter `TTime' in the generic type or method `Microsoft.Research.Naiad.Dataflow.StandardVertices.UnaryVertex<TInput,TOutput,TTime>'. There is no boxing conversion from `Microsoft.Research.Naiad.Dataflow.IterationIn<TTime>' to `Microsoft.Research.Naiad.Time<Microsoft.Research.Naiad.Dataflow.IterationIn<TTime>>'

The corresponding code looks like this:

        public static Stream<Pair<TKey, TValue>, IterationIn<TTime>> StreamingAggregate<TKey, TValue, TTime>(this Stream<Pair<TKey, TValue>, IterationIn<TTime>> input, Func<TValu
e, TValue, TValue> aggregate)
            where TTime : Time<TTime>
            where TValue : IEquatable<TValue>
        {
            return Foundry.NewUnaryStage(input, (i, s) => new StreamingAggregateVertex<TKey, TValue, IterationIn<TTime>>(i, s, aggregate), x => x.First.GetHashCode(), x => x.First.GetHashCode(), "StreamingAggregate");
        }

Although this (somewhat exotic) type constraint is appropriately specific, it can be relaxed in the interests of compatibility (either to working on streams of any time type, or streams of the specific IterationIn<Epoch> time type).