Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Simplified Streamlet interface (#2519)
Browse files Browse the repository at this point in the history
* Removed KVStreamlet

* Fix build

* Fixed checkstyle

* Fix bug in JoinTest

* Fixed jointest
  • Loading branch information
srkukarni authored Nov 6, 2017
1 parent 61e4aae commit 2acf4d1
Show file tree
Hide file tree
Showing 44 changed files with 461 additions and 2,652 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.twitter.heron.streamlet.Builder;
import com.twitter.heron.streamlet.Config;
import com.twitter.heron.streamlet.KeyValue;
import com.twitter.heron.streamlet.Runner;
import com.twitter.heron.streamlet.WindowConfig;

Expand Down Expand Up @@ -51,8 +50,7 @@ public static void main(String[] args) {
Builder builder = Builder.createBuilder();
builder.newSource(() -> "Mary had a little lamb")
.flatMap((sentence) -> Arrays.asList(sentence.split("\\s+")))
.mapToKV((word) -> new KeyValue<>(word, 1))
.reduceByKeyAndWindow(WindowConfig.TumblingCountWindow(10), (x, y) -> x + y)
.reduceByKeyAndWindow(x -> x, WindowConfig.TumblingCountWindow(10), 0, (x, y) -> x + 1)
.log();
Config conf = new Config();
conf.setNumContainers(parallelism);
Expand Down
50 changes: 0 additions & 50 deletions heron/api/src/java/com/twitter/heron/streamlet/BaseStreamlet.java

This file was deleted.

18 changes: 0 additions & 18 deletions heron/api/src/java/com/twitter/heron/streamlet/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,11 @@ static Builder createBuilder() {
*/
<R> Streamlet<R> newSource(SerializableSupplier<R> supplier);

/**
* Same as above except returns KVStreamlet
* @param supplier
* @param <K>
* @param <V>
* @return
*/
<K, V> KVStreamlet<K, V> newKVSource(SerializableSupplier<KeyValue<K, V>> supplier);

/**
* Creates a new Streamlet using the underlying generator
* @param generator The generator that generates the tuples of the streamlet
* @param <R>
* @return
*/
<R> Streamlet<R> newSource(Source<R> generator);

/**
* Same as above except returns a KVStreamlet
* @param generator The genertor that generates the tuples of the streamlet
* @param <K>
* @param <V>
* @return
*/
<K, V> KVStreamlet<K, V> newKVSource(Source<KeyValue<K, V>> generator);
}
168 changes: 0 additions & 168 deletions heron/api/src/java/com/twitter/heron/streamlet/KVStreamlet.java

This file was deleted.

Loading

0 comments on commit 2acf4d1

Please sign in to comment.