| # Copyright 2017 Twitter. All rights reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http:#www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| --- |
| |
| # topology definition |
| # name to be used when submitting |
| name: "simple-wordcount-topology" |
| |
| # topology configuration |
| # this will be passed to the submitter as a map of config options |
| # |
| config: |
| topology.workers: 2 |
| topology.component.resourcemap: |
| |
| - id: "spout-1" |
| ram: 256MB # The minimum value for a component's specified ram is 256MB |
| cpu: 0.5 |
| disk: 4GB |
| |
| - id: "bolt-1" |
| ram: 256MB # The minimum value for a component's specified ram is 256MB |
| cpu: 0.5 |
| disk: 2GB |
| |
| topology.component.jvmoptions: |
| |
| - id: "spout-1" |
| options: ["-XX:NewSize=300m", "-Xms2g"] |
| |
| # spout definitions |
| spouts: |
| - id: "spout-1" |
| className: "com.twitter.heron.examples.eco.TestNameSpout" |
| parallelism: 1 |
| |
| # bolt definitions |
| bolts: |
| - id: "bolt-1" |
| className: "com.twitter.heron.examples.eco.TestNameCounter" |
| parallelism: 1 |
| |
| - id: "bolt-2" |
| className: "com.twitter.heron.examples.eco.LogInfoBolt" |
| parallelism: 1 |
| |
| #stream definitions |
| # stream definitions define connections between spouts and bolts. |
| # note that such connections can be cyclical |
| streams: |
| - from: "spout-1" |
| to: "bolt-1" |
| grouping: |
| type: FIELDS |
| args: ["word"] |
| |
| - from: "bolt-1" |
| to: "bolt-2" |
| grouping: |
| type: SHUFFLE |