cz.seznam.euphoria:euphoria-core

Euphoria's Core provides the API to isolate client side programs from specific execution engine implementations.

License

License

GroupId

GroupId

cz.seznam.euphoria
ArtifactId

ArtifactId

euphoria-core
Last Version

Last Version

0.8.0-rc1
Release Date

Release Date

Type

Type

jar
Description

Description

cz.seznam.euphoria:euphoria-core
Euphoria's Core provides the API to isolate client side programs from specific execution engine implementations.
Project Organization

Project Organization

Seznam.cz, a.s.
Source Code Management

Source Code Management

https://github.com/seznam/euphoria/tree/master/euphoria-core

Download euphoria-core

How to add to project

<!-- https://jarcasting.com/artifacts/cz.seznam.euphoria/euphoria-core/ -->
<dependency>
    <groupId>cz.seznam.euphoria</groupId>
    <artifactId>euphoria-core</artifactId>
    <version>0.8.0-rc1</version>
</dependency>
// https://jarcasting.com/artifacts/cz.seznam.euphoria/euphoria-core/
implementation 'cz.seznam.euphoria:euphoria-core:0.8.0-rc1'
// https://jarcasting.com/artifacts/cz.seznam.euphoria/euphoria-core/
implementation ("cz.seznam.euphoria:euphoria-core:0.8.0-rc1")
'cz.seznam.euphoria:euphoria-core:jar:0.8.0-rc1'
<dependency org="cz.seznam.euphoria" name="euphoria-core" rev="0.8.0-rc1">
  <artifact name="euphoria-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='cz.seznam.euphoria', module='euphoria-core', version='0.8.0-rc1')
)
libraryDependencies += "cz.seznam.euphoria" % "euphoria-core" % "0.8.0-rc1"
[cz.seznam.euphoria/euphoria-core "0.8.0-rc1"]

Dependencies

compile (3)

Group / Artifact Type Version
cz.seznam.euphoria : thirdparty-guava-23.0 jar 0.8.0-rc1
com.google.code.findbugs : jsr305 jar 1.3.9
org.slf4j : slf4j-api jar 1.6.6

test (3)

Group / Artifact Type Version
junit : junit jar 4.10
org.mockito : mockito-all jar 1.9.5
ch.qos.logback : logback-classic jar 1.1.2

Project Modules

There are no modules declared in this project.

Euphoria

Build Status

Euphoria is an open source Java API for creating unified big-data processing flows. It provides an engine independent programming model that can express both batch and stream transformations.

The main goal of the API is to ease the creation of programs with business logic independent of a specific runtime framework/engine and independent of the source or destination of the processed data. Such programs are then transferable with little effort to new environments and new data sources or destinations - idealy just by configuration.

Key features

  • Unified API that supports both batch and stream processing using the same code
  • Avoids vendor lock-in - migrating between different engines is matter of configuration
  • Declarative Java API using Java 8 Lambda expressions
  • Support for different notions of time (event time, ingestion time)
  • Flexible windowing (Time, TimeSliding, Session, Count)

Download

The best way to use Euphoria is by adding the following Maven dependency to your pom.xml:

<dependency>
  <groupId>cz.seznam.euphoria</groupId>
  <artifactId>euphoria-core</artifactId>
  <version>0.7.0</version>
</dependency>

You may want to add additional modules, such as support of various engines or I/O data sources/sinks. For more details read the Maven Dependencies wiki page.

WordCount example

// Define data source and data sinks
DataSource<String> dataSource = new SimpleHadoopTextFileSource(inputPath);
DataSink<String> dataSink = new SimpleHadoopTextFileSink<>(outputPath);

// Define a flow, i.e. a chain of transformations
Flow flow = Flow.create("WordCount");

Dataset<String> lines = flow.createInput(dataSource);

Dataset<String> words = FlatMap.named("TOKENIZER")
    .of(lines)
    .using((String line, Collector<String> context) -> {
      for (String word : line.split("\\s+")) {
        context.collect(word);
      }
    })
    .output();

Dataset<Pair<String, Long>> counted = ReduceByKey.named("COUNT")
    .of(words)
    .keyBy(w -> w)
    .valueBy(w -> 1L)
    .combineBy(Sums.ofLongs())
    .output();

MapElements.named("FORMAT")
    .of(counted)
    .using(p -> p.getFirst() + "\n" + p.getSecond())
    .output()
    .persist(dataSink);

// Initialize an executor and run the flow (using Apache Flink)
try {
  Executor executor = new FlinkExecutor();
  executor.submit(flow).get();
} catch (InterruptedException ex) {
  LOG.warn("Interrupted while waiting for the flow to finish.", ex);
} catch (IOException | ExecutionException ex) {
  throw new RuntimeException(ex);
}

Supported Engines

Euphoria translates flows, also known as data transformation pipelines, into the specific API of a chosen, supported big-data processing engine. Currently, the following are supported:

  • Apache Flink
  • Apache Spark
  • An independent, standalone, in-memory engine which is part of the Euphoria project suitable for running flows in unit tests.

In the WordCount example from above, to switch the execution engine from Apache Flink to Apache Spark, we'd merely need to replace FlinkExecutor with SparkExecutor.

Bugs / Features / Contributing

There's still a lot of room for improvements and extensions. Have a look into the issue tracker and feel free to contribute by reporting new problems, contributing to existing ones, or even open issues in case of questions. Any constructive feedback is warmly welcome!

As usually with open source, don't hesitate to fork the repo and submit a pull requests if you see something to be changed. We'll be happy see euphoria improving over time.

Building

To build the Euphoria artifacts, the following is required:

  • Git
  • Java 8

Building the project itself is a matter of:

git clone https://github.com/seznam/euphoria
cd euphoria
./gradlew publishToMavenLocal -xtest

Documentation

Contact us

License

Euphoria is licensed under the terms of the Apache License 2.0.

cz.seznam.euphoria

Seznam.cz a.s.

Versions

Version
0.8.0-rc1
0.7.0
0.6.0
0.5.0