All Projects → ottogroup → Flink Spector

ottogroup / Flink Spector

Licence: apache-2.0
Framework for Apache Flink unit tests

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Flink Spector

Streaming Readings
Streaming System 相关的论文读物
Stars: ✭ 554 (+191.58%)
Mutual labels:  flink, streaming
df data service
DataFibers Data Service
Stars: ✭ 31 (-83.68%)
Mutual labels:  streaming, flink
Flink Training Course
Flink 中文视频课程(持续更新...)
Stars: ✭ 3,963 (+1985.79%)
Mutual labels:  flink, streaming
Athenax
SQL-based streaming analytics platform at scale
Stars: ✭ 1,178 (+520%)
Mutual labels:  flink, streaming
Bigdata Notebook
Stars: ✭ 100 (-47.37%)
Mutual labels:  flink, streaming
Flink Learning
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
Stars: ✭ 11,378 (+5888.42%)
Mutual labels:  flink, streaming
Fiflow
flink-sql 在 flink 上运行 sql 和 构建数据流的平台 基于 apache flink 1.10.0
Stars: ✭ 100 (-47.37%)
Mutual labels:  flink, streaming
Streamline
StreamLine - Streaming Analytics
Stars: ✭ 151 (-20.53%)
Mutual labels:  flink, streaming
Sparkstreaming
💥 🚀 封装sparkstreaming动态调节batch time(有数据就执行计算);🚀 支持运行过程中增删topic;🚀 封装sparkstreaming 1.6 - kafka 010 用以支持 SSL。
Stars: ✭ 179 (-5.79%)
Mutual labels:  flink
Nussknacker
Process authoring tool for Apache Flink
Stars: ✭ 182 (-4.21%)
Mutual labels:  flink
Redux Actions Assertions
Simplify testing of redux action and async action creators
Stars: ✭ 177 (-6.84%)
Mutual labels:  unit-testing
Node Csv Stringify
CSV stringifier implementing the Node.js `stream.Transform` API
Stars: ✭ 179 (-5.79%)
Mutual labels:  streaming
Mockedstreams
Scala DSL for Unit-Testing Processing Topologies in Kafka Streams
Stars: ✭ 184 (-3.16%)
Mutual labels:  unit-testing
Mocktopus
Mocking framework for Rust
Stars: ✭ 179 (-5.79%)
Mutual labels:  unit-testing
Registry
Schema Registry
Stars: ✭ 184 (-3.16%)
Mutual labels:  flink
Storybook Addon Jest
REPO/PACKAGE MOVED - React storybook addon that show component jest report
Stars: ✭ 177 (-6.84%)
Mutual labels:  unit-testing
Haishinkit.swift
Camera and Microphone streaming library via RTMP, HLS for iOS, macOS, tvOS.
Stars: ✭ 2,237 (+1077.37%)
Mutual labels:  streaming
Supysonic
Supysonic is a Python implementation of the Subsonic server API.
Stars: ✭ 187 (-1.58%)
Mutual labels:  streaming
Mockbukkit
MockBukkit is a mocking framework for bukkit to allow the easy unit testing of Bukkit plugins.
Stars: ✭ 186 (-2.11%)
Mutual labels:  unit-testing
Fast
A framework for GPU based high-performance medical image processing and visualization
Stars: ✭ 179 (-5.79%)
Mutual labels:  streaming

Flinkspector

This project provides a framework to define unit tests for Apache Flink data flows. The framework executes data flows locally and verifies the output using predefined expectations.

Features include:

  • Concise DSL to define test scenarios.
  • Powerful matchers to express expectations.
  • Test base for JUnit.
  • Test stream windowing with timestamped input.

Check out the wiki to learn how Flinkspector can assist you in developing Flink jobs.

Examples

Minimal:

class Test extends DataSetTestBase {
    
    @org.junit.Test
    public myTest() {
		DataSet<Integer> dataSet = createTestDataSet(asList(1,2,3))
		    .map((MapFunction<Integer,Integer>) (value) -> {return value + 1});

		ExpectedRecords<Integer> expected = 
		    new ExpectedRecords<Integer>().expectAll(asList(2,3,4))

		assertDataSet(dataSet, expected);
    }

}

Streaming:

@org.junit.Test
public void testWindowing() {

	// Define the input DataStream:	
	DataStream<Tuple2<Integer, String>> testStream =
			createTimedTestStreamWith(Tuple2.of(1, "fritz"))
					.emit(Tuple2.of(1, "hans"))
					.emit(Tuple2.of(1, "heidi"), intoWindow(30, seconds)
					.emit(Tuple2.of(3, "peter"), intoWindow(1, minutes)
					.repeatAll(times(2))
					.close();

		
	// Lets you query the output tuples like a table:
	OutputMatcher<Tuple2<Integer, String>> matcher =
			//define keys for the values in your tuple:
			new MatchTuples<Tuple2<Integer, String>>("value", "name")
					.assertThat("value", is(3))
					.assertThat("name", either(is("fritz")).or(is("peter")))
					.onEachRecord();
	
	assertStream(someWindowAggregation(testStream), matcher);
}

You can find more extensive examples here:

Getting started

Get the Latest Release:

Note: The current build works with Flink version 1.8.0. There is no Flink 1.4.0 release for scala 2.10 so this has been dropped by flinkspector as well.

Include in your project's pom.xml:

<dependency>
   <groupId>io.flinkspector</groupId>
   <artifactId>flinkspector-dataset_2.11</artifactId>
   <version>0.9.4</version>
</dependency>

or for the Flink DataStream API:

<dependency>
    <groupId>io.flinkspector</groupId>
    <artifactId>flinkspector-datastream_2.11</artifactId>
    <version>0.9.4</version>
</dependency>

If you want to use assertions you should also include hamcrest:

<dependency>
    <groupId>org.hamcrest</groupId>
    <artifactId>hamcrest-all</artifactId>
    <version>1.3</version>
    <type>jar</type>
    <scope>test</scope>
</dependency>

Manual Build:

  1. Clone this repo: git clone https://github.com/ottogroup/flink-spector.
  2. Build with maven: maven install.
  3. Include in your project's pom.xml:
<dependency>
    <groupId>io.flinkspector</groupId>
    <artifactId>flinkspector-dataset</artifactId>
    <version>0.9.5-SNAPSHOT</version>
</dependency>

or for the Flink DataStream API:

<dependency>
    <groupId>io.flinkspector</groupId>
    <artifactId>flinkspector-datastream</artifactId>
    <version>0.9.5-SNAPSHOT</version>
</dependency>

Origins

The project was conceived at the Business Intelligence department of Otto Group.

Build Status

Build Status

License

Licensed under the Apache License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].