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

Commit

Permalink
Clean up remaining dead references to Twitter (#2930)
Browse files Browse the repository at this point in the history
* update repository URL in release script
 * update remaining Java import paths in docs from com.twitter to org.apache
  • Loading branch information
Code0x58 authored and kramasamy committed Jun 23, 2018
1 parent a80c9c5 commit 99a85ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions scripts/release/release.sh
Expand Up @@ -19,10 +19,10 @@
set -eu

# Repositories to push the release branch and the release tag.
: ${RELEASE_REPOSITORIES:="git@github.com:twitter/heron"}
: ${RELEASE_REPOSITORIES:="git@github.com:apache/incubator-heron"}

# Repositories to push the master branch
: ${MASTER_REPOSITORIES:="git@github.com:twitter/heron"}
: ${MASTER_REPOSITORIES:="git@github.com:apache/incubator-heron"}

# Name of the default editor
: ${EDITOR=vi}
Expand Down
24 changes: 12 additions & 12 deletions website/content/docs/developers/scala/streamlet-api.mmark
Expand Up @@ -17,7 +17,7 @@ In order to use the `heron-api` library, add this to the `dependencies` block of

```xml
<dependency>
<groupId>com.twitter.heron</groupId>
<groupId>org.apache.heron</groupId>
<artifactId>heron-api</artifactId>
<version>{{< heronVersion >}}</version>
</dependency>
Expand Down Expand Up @@ -73,8 +73,8 @@ $ heron submit local \
Every Streamlet API topology needs to be configured using a `Config` object. Here's an example default configuration:

```scala
import com.twitter.heron.streamlet.Config
import com.twitter.heron.streamlet.scala.Runner
import org.apache.heron.streamlet.Config
import org.apache.heron.streamlet.scala.Runner

val topologyConfig = Config.defaultConfig()

Expand Down Expand Up @@ -230,8 +230,8 @@ The context object available to a transform operation provides access to:
Here's a Scala example of a transform operation in a topology where a stateful record is kept of the number of items processed:

```scala
import com.twitter.heron.streamlet.Context
import com.twitter.heron.streamlet.scala.SerializableTransformer
import org.apache.heron.streamlet.Context
import org.apache.heron.streamlet.scala.SerializableTransformer

class CountNumberOfItems extends SerializableTransformer[String, String] {
private val numberOfItems = new AtomicLong()
Expand All @@ -253,7 +253,7 @@ class CountNumberOfItems extends SerializableTransformer[String, String] {

This operation does a few things:

* In the `setup` method, the [`Context`](/api/java/com/twitter/heron/streamlet/Context.html) object is used to access the current state (which has the semantics of a Java `Map`). The current number of items processed is incremented by one and then saved as the new state.
* In the `setup` method, the [`Context`](/api/java/org/apache/heron/streamlet/Context.html) object is used to access the current state (which has the semantics of a Java `Map`). The current number of items processed is incremented by one and then saved as the new state.
* In the `transform` method, the incoming string is transformed as UpperCase in some way and then "accepted" as the new value.
* In the `cleanup` step, the current count of items processed is logged.

Expand All @@ -272,8 +272,8 @@ builder.newSource(() => "Some string over and over");
Join operations unify two streamlets *on a key* (join operations thus require KV streamlets). Each `KeyValue` object in a streamlet has, by definition, a key. When a `join` operation is added to a processing graph,

```scala
import com.twitter.heron.streamlet.{Config, KeyValue, WindowConfig}
import com.twitter.heron.streamlet.scala.Builder
import org.apache.heron.streamlet.{Config, KeyValue, WindowConfig}
import org.apache.heron.streamlet.scala.Builder

val builder = Builder.newBuilder()

Expand Down Expand Up @@ -313,7 +313,7 @@ You can apply [reduce](https://docs.oracle.com/javase/tutorial/collections/strea
Reduce by key and window operations produce a new streamlet of key-value window objects (which include a key-value pair including the extracted key and calculated value, as well as information about the window in which the operation took place). Here's an example:

```scala
import com.twitter.heron.streamlet.WindowConfig;
import org.apache.heron.streamlet.WindowConfig;

val builder = Builder.newBuilder()

Expand Down Expand Up @@ -361,8 +361,8 @@ In this example, the supplier streamlet emits random integers between 1 and 10.
In processing graphs like the ones you build using the Heron Streamlet API, **sinks** are essentially the terminal points in your graph, where your processing logic comes to an end. A processing graph can end with writing to a database, publishing to a topic in a pub-sub messaging system, and so on. With the Streamlet API, you can implement your own custom sinks. Here's an example:

```scala
import com.twitter.heron.streamlet.Context
import com.twitter.heron.streamlet.scala.Sink
import org.apache.heron.streamlet.Context
import org.apache.heron.streamlet.scala.Sink

class FormattedLogSink extends Sink[String] {
private var streamName: Option[String] = None
Expand Down Expand Up @@ -405,4 +405,4 @@ val builder = Builder.newBuilder
.newSource(() => Random.nextInt(10))
.filter(i => i % 2 == 0)
.consume(i => println(s"Even number found: $i"))
```
```

0 comments on commit 99a85ab

Please sign in to comment.