johnyangk closed pull request #136: [NEMO-246] Add javadoc generation to CI
URL: https://github.com/apache/incubator-nemo/pull/136
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.gitignore b/.gitignore
index 5def0cdfc..641eb9b0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ REEF_YARN_RUNTIME
target
generated
build
+docs/
#
# ----------------------------------------------------------------------
# Files generated by OutputService during runtime
diff --git a/.travis.yml b/.travis.yml
index b98a1834e..413b2acc5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,6 +28,7 @@ script:
# the following command line builds the project, runs the tests with
coverage and then execute the SonarCloud analysis
- if [ "$TRAVIS_PULL_REQUEST" == false ]; then travis_retry mvn clean
org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -B -q -ff
-Dsurefire.useFile=false -Dorg.slf4j.simpleLogger.defaultLogLevel=info; fi
- if [ "$TRAVIS_PULL_REQUEST" != false ]; then travis_retry mvn clean verify
-B -q -ff -Dsurefire.useFile=false
-Dorg.slf4j.simpleLogger.defaultLogLevel=info; fi
+ - mvn clean install -DskipTests && mvn javadoc:javadoc
notifications:
slack:
diff --git a/compiler/frontend/spark/pom.xml b/compiler/frontend/spark/pom.xml
index 93f9f4eb3..c79a8e152 100644
--- a/compiler/frontend/spark/pom.xml
+++ b/compiler/frontend/spark/pom.xml
@@ -115,6 +115,25 @@ under the License.
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.0.0</version>
+ <configuration>
+ <outputDirectory>docs/apidocs</outputDirectory>
+ <reportOutputDirectory>docs/apidocs</reportOutputDirectory>
+ <doclint>-missing</doclint>
+ </configuration>
+ <executions>
+ <execution>
+ <id>aggregate</id>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ <phase>site</phase>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git
a/examples/beam/src/main/java/org/apache/nemo/examples/beam/WriteOneFilePerWindow.java
b/examples/beam/src/main/java/org/apache/nemo/examples/beam/WriteOneFilePerWindow.java
index fe5d5f704..07a652e7c 100644
---
a/examples/beam/src/main/java/org/apache/nemo/examples/beam/WriteOneFilePerWindow.java
+++
b/examples/beam/src/main/java/org/apache/nemo/examples/beam/WriteOneFilePerWindow.java
@@ -60,7 +60,7 @@ public PDone expand(final PCollection<String> input) {
return input.apply(write);
}
/**
- * A {@link FilenamePolicy} produces a base file name for a write based on
metadata about the data
+ * A {@link FileBasedSink.FilenamePolicy} produces a base file name for a
write based on metadata about the data
* being written. This always includes the shard number and the total number
of shards. For
* windowed writes, it also includes the window and pane index (a sequence
number assigned to each
* trigger firing).
diff --git a/pom.xml b/pom.xml
index 2db16fe92..9d7e769f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -284,6 +284,8 @@ under the License.
<exclude>.editorconfig</exclude>
<!-- formatter.xml -->
<exclude>formatter.xml</exclude>
+ <!-- javadoc -->
+ <exclude>**/docs/**</exclude>
</excludes>
</configuration>
</plugin>
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/bytetransfer/ClosableBlockingQueue.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/bytetransfer/ClosableBlockingQueue.java
index c6a91690a..3d992e70f 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/bytetransfer/ClosableBlockingQueue.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/bytetransfer/ClosableBlockingQueue.java
@@ -80,6 +80,7 @@ public synchronized void close() {
/**
* Mark the input end of this queue as closed.
+ * @param throwableToSet a throwable to set as the cause
*/
public synchronized void closeExceptionally(final Throwable throwableToSet) {
this.throwable = throwableToSet;
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BroadcastManagerWorker.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BroadcastManagerWorker.java
index c8a87fcfe..17a62c5cd 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BroadcastManagerWorker.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BroadcastManagerWorker.java
@@ -115,7 +115,7 @@ public Object load(final Serializable id) throws Exception {
* (i.e., the variable is expressed as an IREdge, and reside in a executor
as a block)
*
* @param id of the broadcast variable.
- * @param inputReader
+ * @param inputReader the {@link InputReader} to register.
*/
public void registerInputReader(final Serializable id,
final InputReader inputReader) {
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/SerializerManager.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/SerializerManager.java
index 6a3c64702..dc46ccb89 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/SerializerManager.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/SerializerManager.java
@@ -48,7 +48,7 @@ private SerializerManager() {
/**
* Register a encoderFactory for runtime edge.
- * This method regards that compression & decompression property are empty.
+ * This method regards that compression and decompression property are empty.
*
* @param runtimeEdgeId id of the runtime edge.
* @param encoderFactory the corresponding encoder factory.
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/partitioner/DataSkewHashPartitioner.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/partitioner/DataSkewHashPartitioner.java
index cc3eddf8c..a79defc0d 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/partitioner/DataSkewHashPartitioner.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/partitioner/DataSkewHashPartitioner.java
@@ -58,9 +58,6 @@ public DataSkewHashPartitioner(final int hashRangeMultiplier,
LOG.info("hashRangeBase {} resulting hashRange {}", hashRangeBase,
hashRange);
}
- /**
- * @see Partitioner#partition(Object).
- */
@Override
public Integer partition(final Object element) {
return Math.abs(keyExtractor.extractKey(element).hashCode() % hashRange);
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/GlusterFileStore.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/GlusterFileStore.java
index 8fc1bbd9c..a47afeaf2 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/GlusterFileStore.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/GlusterFileStore.java
@@ -62,9 +62,6 @@ private
GlusterFileStore(@Parameter(JobConf.GlusterVolumeDirectory.class) final
new File(fileDirectory).mkdirs();
}
- /**
- * @see BlockStore#createBlock(String).
- */
@Override
public Block createBlock(final String blockId) {
deleteBlock(blockId);
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/LocalFileStore.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/LocalFileStore.java
index 7d9f2edb9..62758aa3f 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/LocalFileStore.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/stores/LocalFileStore.java
@@ -53,9 +53,6 @@ private
LocalFileStore(@Parameter(JobConf.FileDirectory.class) final String file
new File(fileDirectory).mkdirs();
}
- /**
- * @see BlockStore#createBlock(String).
- */
@Override
public Block createBlock(final String blockId) {
deleteBlock(blockId);
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
index 96004106a..a2da4bc00 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
@@ -92,7 +92,8 @@
* @param taskStateManager State manager for this Task.
* @param intermediateDataIOFactory For reading from/writing to data to
other tasks.
* @param broadcastManagerWorker For broadcasts.
- * @param metricMessageSender For sending metric with execution stats to
Master.
+ * @param metricMessageSender For sending metric with execution stats to
the master.
+ * @param persistentConnectionToMasterMap For sending messages to the master.
*/
public TaskExecutor(final Task task,
final DAG<IRVertex, RuntimeEdge<IRVertex>> irVertexDag,
diff --git
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/MetricStore.java
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/MetricStore.java
index 0fd549217..42f22aa09 100644
---
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/MetricStore.java
+++
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/MetricStore.java
@@ -150,6 +150,7 @@ private void generatePreprocessedJsonFromMetricEntry(final
Map.Entry<String, Obj
/**
* Dumps JSON-serialized string of specific metric.
* @param metricClass class of metric.
+ * @param <T> type of the metric to dump
* @return dumped JSON string of all metric.
* @throws IOException when failed to write json.
*/
@@ -223,6 +224,7 @@ public void dumpAllMetricToFile(final String filePath) {
* send changed metric data to the frontend client. Also this method is
synchronized.
* @param metricClass class of the metric.
* @param id id of the metric.
+ * @param <T> type of the metric to broadcast
*/
public synchronized <T extends Metric> void triggerBroadcast(final Class<T>
metricClass, final String id) {
final MetricBroadcaster metricBroadcaster =
MetricBroadcaster.getInstance();
diff --git
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/RuntimeMaster.java
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/RuntimeMaster.java
index 3f1dd3cc7..d20e8542f 100644
---
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/RuntimeMaster.java
+++
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/RuntimeMaster.java
@@ -164,6 +164,7 @@ private Server startRestMetricServer() {
*
* @param plan to execute
* @param maxScheduleAttempt the max number of times this plan/sub-part of
the plan should be attempted.
+ * @return pair of {@link PlanStateManager} and {@link
ScheduledExecutorService}
*/
public Pair<PlanStateManager, ScheduledExecutorService> execute(final
PhysicalPlan plan,
final int
maxScheduleAttempt) {
diff --git
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ExecutorRepresenter.java
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ExecutorRepresenter.java
index 351542a55..63d98d5b1 100644
---
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ExecutorRepresenter.java
+++
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ExecutorRepresenter.java
@@ -91,6 +91,8 @@ public ExecutorRepresenter(final String executorId,
/**
* Marks all Tasks which were running in this executor as failed.
+ *
+ * @return set of identifiers of tasks that were running in this executor.
*/
public Set<String> onExecutorFailed() {
failedTasks.addAll(runningComplyingTasks.values());
@@ -104,7 +106,7 @@ public ExecutorRepresenter(final String executorId,
/**
* Marks the Task as running, and sends scheduling message to the executor.
- * @param task
+ * @param task the task to run
*/
public void onTaskScheduled(final Task task) {
(task.getPropertyValue(ResourceSlotProperty.class).orElse(true)
@@ -136,7 +138,7 @@ public void sendControlMessage(final ControlMessage.Message
message) {
/**
* Marks the specified Task as completed.
- *
+ * @param taskId id of the completed task
*/
public void onTaskExecutionComplete(final String taskId) {
final Task completedTask = removeFromRunningTasks(taskId);
diff --git
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ResourceSpecification.java
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ResourceSpecification.java
index e320338e1..58fe251a6 100644
---
a/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ResourceSpecification.java
+++
b/runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ResourceSpecification.java
@@ -75,7 +75,7 @@ public String getResourceSpecId() {
/**
* @return -1 if this resource is not poisoned. (for all other normal
cases)
- * >= 0 the expected time to failure by poison. (for fault-handling
tests)
+ * >= 0 the expected time to failure by poison. (for
fault-handling tests)
*/
public int getPoisonSec() {
return poisonSec;
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services