Class LocalStreamingContext

    • Constructor Detail

      • LocalStreamingContext

        public LocalStreamingContext()
    • Method Detail

      • close

        public void close()
      • doubleAccumulator

        public MDoubleAccumulator doubleAccumulator​(double initialValue,
                                                    String name)
        Description copied from class: StreamingContext
        Creates a new double accumulator with the given initial value.
        Specified by:
        doubleAccumulator in class StreamingContext
        Parameters:
        initialValue - the initial value of the accumulator
        name - The name of the accumulator
        Returns:
        the double accumulator
      • doubleStream

        public MDoubleStream doubleStream​(double... values)
        Description copied from class: StreamingContext
        Creates a MDoubleStream from a variable list of doubles
        Overrides:
        doubleStream in class StreamingContext
        Parameters:
        values - the values making up the double stream
        Returns:
        the MDoubleStream
      • empty

        public <T> MStream<T> empty()
        Description copied from class: StreamingContext
        Creates a new empty stream
        Specified by:
        empty in class StreamingContext
        Type Parameters:
        T - the component type of the stream
        Returns:
        the empty MStream
      • listAccumulator

        public <E> MAccumulator<E,​List<E>> listAccumulator​(String name)
        Description copied from class: StreamingContext
        Creates a list accumulator
        Specified by:
        listAccumulator in class StreamingContext
        Type Parameters:
        E - the component type of the list
        Parameters:
        name - the name of the accumulator
        Returns:
        the list accumulator
      • longAccumulator

        public MLongAccumulator longAccumulator​(long initialValue,
                                                String name)
        Description copied from class: StreamingContext
        Creates a new long accumulator with the given initial value.
        Specified by:
        longAccumulator in class StreamingContext
        Parameters:
        initialValue - the initial value of the accumulator
        name - the name of the accumulator
        Returns:
        the long accumulator
      • mapAccumulator

        public <K,​V> MMapAccumulator<K,​V> mapAccumulator​(String name)
        Description copied from class: StreamingContext
        Creates a new map accumulator
        Specified by:
        mapAccumulator in class StreamingContext
        Type Parameters:
        K - the key type parameter
        V - the value type parameter
        Parameters:
        name - the name of the accumulator
        Returns:
        the map accumulator
      • multiCounterAccumulator

        public <K1,​K2> MMultiCounterAccumulator<K1,​K2> multiCounterAccumulator​(String name)
        Description copied from class: StreamingContext
        Creates a new MultiCounter accumulator
        Specified by:
        multiCounterAccumulator in class StreamingContext
        Type Parameters:
        K1 - the first key type parameter
        K2 - the second key type parameter
        Parameters:
        name - the name of the accumulator
        Returns:
        the MultiCounter accumulator
      • pairStream

        public <K,​V> MPairStream<K,​V> pairStream​(@NonNull
                                                             @NonNull Map<? extends K,​? extends V> map)
        Description copied from class: StreamingContext
        Creates a new pair stream from the given map.
        Specified by:
        pairStream in class StreamingContext
        Type Parameters:
        K - the key type parameter
        V - the value type parameter
        Parameters:
        map - the map to stream
        Returns:
        the pair stream
      • pairStream

        public <K,​V> MPairStream<K,​V> pairStream​(@NonNull
                                                             @NonNull Collection<Map.Entry<? extends K,​? extends V>> tuples)
        Description copied from class: StreamingContext
        Creates a new pair stream from the given collection of entries.
        Specified by:
        pairStream in class StreamingContext
        Type Parameters:
        K - the key type parameter
        V - the value type parameter
        Parameters:
        tuples - the collection of entries to use to create the pair stream
        Returns:
        the pair stream
      • range

        public MStream<Integer> range​(int startInclusive,
                                      int endExclusive)
        Description copied from class: StreamingContext
        Creates a ranged based integer stream starting at startInclusive and ending before endExclusive.
        Specified by:
        range in class StreamingContext
        Parameters:
        startInclusive - the starting number in the range (inclusive)
        endExclusive - the ending number in the range (exclusive)
        Returns:
        the integer stream
      • setAccumulator

        public <E> MAccumulator<E,​Set<E>> setAccumulator​(String name)
        Description copied from class: StreamingContext
        Creates a set accumulator
        Specified by:
        setAccumulator in class StreamingContext
        Type Parameters:
        E - the component type of the set
        Parameters:
        name - the name of the accumulator
        Returns:
        the set accumulator
      • stream

        public <T> MStream<T> stream​(Stream<T> stream)
        Description copied from class: StreamingContext
        Creates a new MStream from Java Stream
        Specified by:
        stream in class StreamingContext
        Type Parameters:
        T - the component type parameter of the stream
        Parameters:
        stream - the Java stream to wrap / consume
        Returns:
        the new MStream
      • stream

        public <T> MStream<T> stream​(Iterable<? extends T> iterable)
        Description copied from class: StreamingContext
        Creates a new MStream from the given iterable
        Specified by:
        stream in class StreamingContext
        Type Parameters:
        T - the component type parameter of the stream
        Parameters:
        iterable - the iterable to wrap / consume
        Returns:
        the new MStream
      • textFile

        public MStream<String> textFile​(String location)
        Description copied from class: StreamingContext
        Creates a new MStream where each element is a line in the resources (recursive) at the given location.
        Specified by:
        textFile in class StreamingContext
        Parameters:
        location - the location to read
        Returns:
        the new MStream backed by the lines of the files in the given location.
      • textFile

        public MStream<String> textFile​(Resource resource)
        Description copied from class: StreamingContext
        Creates a new MStream where each element is a line in the resources (recursive) at the given location.
        Specified by:
        textFile in class StreamingContext
        Parameters:
        resource - the location to read
        Returns:
        the new MStream backed by the lines of the files in the given location.
      • textFile

        public MStream<String> textFile​(Resource location,
                                        boolean wholeFile)
        Description copied from class: StreamingContext

        Creates a new MStream where each element is the entire content of a resource (wholeFile = true) or a single line of the resource (wholeFile = False) and resources are gathered recursively from the given location.

        Specified by:
        textFile in class StreamingContext
        Parameters:
        location - the location
        wholeFile - the whole file
        Returns:
        the m stream