You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by jo...@apache.org on 2020/06/05 21:00:29 UTC
[incubator-heron] branch joshfischer/java-docs-java11 created (now
ae043e1)
This is an automated email from the ASF dual-hosted git repository.
joshfischer pushed a change to branch joshfischer/java-docs-java11
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git.
at ae043e1 fixing javadocs
This branch includes the following new commits:
new ae043e1 fixing javadocs
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-heron] 01/01: fixing javadocs
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joshfischer pushed a commit to branch joshfischer/java-docs-java11
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
commit ae043e13f53167acd68b3338e5eb302a9d66a605
Author: Josh Fischer <jo...@joshfischer.io>
AuthorDate: Fri Jun 5 15:59:24 2020 -0500
fixing javadocs
---
.../streamlet/SimplePulsarSourceTopology.java | 131 ---------------------
website2/website/scripts/javadocs.sh | 10 +-
2 files changed, 7 insertions(+), 134 deletions(-)
diff --git a/examples/src/java/org/apache/heron/examples/streamlet/SimplePulsarSourceTopology.java b/examples/src/java/org/apache/heron/examples/streamlet/SimplePulsarSourceTopology.java
deleted file mode 100644
index e2a852c..0000000
--- a/examples/src/java/org/apache/heron/examples/streamlet/SimplePulsarSourceTopology.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-
-package org.apache.heron.examples.streamlet;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.logging.Logger;
-
-import org.apache.heron.examples.streamlet.utils.StreamletUtils;
-import org.apache.heron.streamlet.Builder;
-import org.apache.heron.streamlet.Config;
-import org.apache.heron.streamlet.Context;
-import org.apache.heron.streamlet.Runner;
-import org.apache.heron.streamlet.Source;
-import org.apache.pulsar.client.api.Consumer;
-import org.apache.pulsar.client.api.PulsarClient;
-import org.apache.pulsar.client.api.PulsarClientException;
-
-/**
- * This topology demonstrates how sources work in the Heron Streamlet API
- * for Java. The example source here reads from an Apache Pulsar topic and
- * injects incoming messages into the processing graph.
- */
-public final class SimplePulsarSourceTopology {
- private SimplePulsarSourceTopology() {
- }
-
- private static final Logger LOG =
- Logger.getLogger(SimplePulsarSourceTopology.class.getName());
-
- private static class PulsarSource implements Source<String> {
- private static final long serialVersionUID = -3433804102901363106L;
- private PulsarClient client;
- private Consumer consumer;
- private String pulsarConnectionUrl;
- private String consumeTopic;
- private String subscription;
-
- PulsarSource(String url, String topic, String subscription) {
- this.pulsarConnectionUrl = url;
- this.consumeTopic = topic;
- this.subscription = subscription;
- }
-
- /**
- * The setup functions defines the instantiation logic for the source.
- * Here, a Pulsar client and consumer are created that will listen on
- * the Pulsar topic.
- */
- public void setup(Context context) {
- try {
- client = PulsarClient.create(pulsarConnectionUrl);
- consumer = client.subscribe(consumeTopic, subscription);
- } catch (PulsarClientException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * The get function defines how elements for the source streamlet are
- * "gotten." In this case, the Pulsar consumer for the specified topic
- * listens for incoming messages.
- */
- public Collection<String> get() {
- try {
- String retval = new String(consumer.receive().getData(), "utf-8");
- return Collections.singletonList(retval);
- } catch (PulsarClientException | UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
- }
-
- public void cleanup() {
- }
- }
-
- /**
- * All Heron topologies require a main function that defines the topology's behavior
- * at runtime
- */
- public static void main(String[] args) throws Exception {
- Builder processingGraphBuilder = Builder.newBuilder();
-
- /**
- * A Pulsar source is constructed for a specific Pulsar installation, topic, and
- * subsecription.
- */
- Source<String> pulsarSource = new PulsarSource(
- "pulsar://localhost:6650", // Pulsar connection URL
- "persistent://sample/standalone/ns1/heron-pulsar-test-topic", // Pulsar topic
- "subscription-1" // Subscription name for the Pulsar topic
- );
-
- /**
- * In this processing graph, the source streamlet consists of messages on a
- * Pulsar topic. Those messages are simply logged without any processing logic
- * applied to them.
- */
- processingGraphBuilder.newSource(pulsarSource)
- .setName("incoming-pulsar-messages")
- .consume(s -> LOG.info(String.format("Message received from Pulsar: \"%s\"", s)));
-
- Config config = Config.defaultConfig();
-
- // Fetches the topology name from the first command-line argument
- String topologyName = StreamletUtils.getTopologyName(args);
-
- // Finally, the processing graph and configuration are passed to the Runner, which converts
- // the graph into a Heron topology that can be run in a Heron cluster.
- new Runner().run(topologyName, config, processingGraphBuilder);
- }
-}
diff --git a/website2/website/scripts/javadocs.sh b/website2/website/scripts/javadocs.sh
index 0d0770d..8307eea 100755
--- a/website2/website/scripts/javadocs.sh
+++ b/website2/website/scripts/javadocs.sh
@@ -38,10 +38,13 @@ else
fi
(cd $HERON_ROOT_DIR && $BAZEL_CMD \
- `bazel query 'kind("java_library", "heron/...")'`\
+ `bazel query 'kind("java_library", "heron/...")'` \
+ `bazel query 'kind("java_library", "contrib/...")'` \
`bazel query 'kind("java_test", "heron/...")'` \
`bazel query 'kind("java_library", "integration_test/...")'`)
+
+
HERON_SRC_FILES=`find $HERON_ROOT_DIR -path "*/org/apache/*" -name "*.java" -not -path "$HERON_ROOT_DIR/tools/*"`
BACKTYPE_SRC_FILES=`find $HERON_ROOT_DIR -path "*/backtype/storm/*" -name "*.java"`
APACHE_SRC_FILES=`find $HERON_ROOT_DIR -path "*/org/apache/storm/*" -name "*.java"`
@@ -50,15 +53,15 @@ GEN_FILES=`find $GEN_PROTO_DIR -name "*.java"`
rm -rf $JAVADOC_OUTPUT_DIR
mkdir -p $JAVADOC_OUTPUT_DIR
-BIN_JARS=`find $HERON_ROOT_DIR/bazel-incubator-heron/_bin/. -name "*\.jar" | tr '\n' ':'`
GEN_JARS=`find $HERON_ROOT_DIR/bazel-bin/external/. -name "*\.jar" | tr '\n' ':'`
SCRIBE_JARS=`find $HERON_ROOT_DIR/bazel-bin/. -name "libthrift_scribe_java.jar" | tr '\n' ':'`
PROTO_JARS=`find $HERON_ROOT_DIR/bazel-bin/heron/proto/. -name "*\.jar" | tr '\n' ':'`
CLOSURE_CLASSES="$HERON_ROOT_DIR/bazel-bin/storm-compatibility/src/java/_javac/storm-compatibility-java/libstorm-compatibility-java_classes/."
CONTRIB_JARS=`find $HERON_ROOT_DIR/bazel-bin/contrib/. -name "*\.jar" | tr '\n' ':'`
-export CLASSPATH=$BIN_JARS:$GEN_JARS:$SCRIBE_JARS:$PROTO_JARS:$CLOSURE_CLASSES:$CONTRIB_JARS
+export CLASSPATH=$GEN_JARS:$SCRIBE_JARS:$PROTO_JARS:$CLOSURE_CLASSES:$CONTRIB_JARS
+echo "before java doc command"
$JAVADOC $FLAGS \
-encoding "UTF-8" \
-windowtitle "Heron Java API" \
@@ -77,4 +80,5 @@ $JAVADOC $FLAGS \
cp -r $JAVADOC_OUTPUT_DIR $JAVADOC_OUTPUT_LOCAL_DIR
echo "Javdocs generated at $JAVADOC_OUTPUT_DIR"
+echo "Javaodcs copied to: $JAVADOC_OUTPUT_LOCAL_DIR"
exit 0