Class FlowDocuments
- java.lang.Object
-
- org.opennms.nephron.testing.flowgen.FlowDocuments
-
public class FlowDocuments extends Object
Provides static methods for generating flows.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlowDocuments.FlowDatastatic classFlowDocuments.FlowData1static classFlowDocuments.FlowData2
-
Constructor Summary
Constructors Constructor Description FlowDocuments()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static net.jqwik.api.Arbitrary<FlowDocuments.FlowData>getFlowDataArbitrary(FlowConfig cfg)static org.opennms.netmgt.flows.persistence.model.FlowDocumentgetFlowDocument(FlowConfig cfg, long idx, FlowDocuments.FlowData fd)static StringipAddress(int ip)static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument>splittedStream(SourceConfig sourceConfig)Creates a length limited stream of flows.static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument>stream(FlowConfig cfg, long seed, long maxIdx, int idxInc, int idxOffset)static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument>stream(SourceConfig sourceConfig)Creates a length limited stream of flows.
-
-
-
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 bymaxIdx/idxIncof the givenSourceConfig.
-
splittedStream
public static Stream<org.opennms.netmgt.flows.persistence.model.FlowDocument> splittedStream(SourceConfig sourceConfig)
Creates a length limited stream of flows.The
minSplitsandmaxSplitsproperties of the givenSourceConfigmust 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)
-
getFlowDataArbitrary
public static net.jqwik.api.Arbitrary<FlowDocuments.FlowData> getFlowDataArbitrary(FlowConfig cfg)
-
-