Class FlowDocuments


  • public class FlowDocuments
    extends Object
    Provides static methods for generating flows.
    • Constructor Detail

      • FlowDocuments

        public FlowDocuments()
    • Method Detail

      • stream

        public static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument> stream​(SourceConfig sourceConfig)
        Creates a length limited stream of flows. The length is calculated by maxIdx/idxInc of the given SourceConfig.
      • splittedStream

        public static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument> splittedStream​(SourceConfig sourceConfig)
        Creates a length limited stream of flows.

        The minSplits and maxSplits properties of the given SourceConfig must be equal.

        The stream is implemented by first splitting the SourceConfig according to the minimum/maximum number of splits and then returning flows from each split in a round-robing fashion.

        This tries to mimic how a source is processed by Flink. Flink also tries to split its input. However, Flink may process splits in parallel and the order of processed elements may not be the same. Yet, the collection of all returned flows should be the same.

      • stream

        public static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument> stream​(FlowConfig cfg,
                                                                                             long seed,
                                                                                             long maxIdx,
                                                                                             int idxInc,
                                                                                             int idxOffset)
      • getFlowDocument

        public static org.opennms.netmgt.flows.persistence.model.FlowDocument getFlowDocument​(FlowConfig cfg,
                                                                                              long idx,
                                                                                              FlowDocuments.FlowData fd)
      • ipAddress

        public static String ipAddress​(int ip)