This is an automated email from the ASF dual-hosted git repository.
wylee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git
The following commit(s) were added to refs/heads/master by this push:
new a633e66 [Nemo-429] SWPP TEAM10 Code Smell Fix (#275)
a633e66 is described below
commit a633e669a4d58331c693ae3ea6d55d62a79b12c3
Author: ByungHeeCha <[email protected]>
AuthorDate: Mon Jan 13 10:39:03 2020 +0900
[Nemo-429] SWPP TEAM10 Code Smell Fix (#275)
* [Team 10 jyeok] changed assertion parameter in correct order
* add transient option to var [jaehonam]
* removed not needed exceptions
ByungHeeCha
* removed unused import
* Update LoopOptimizations.java
Co-authored-by: jyeokchoi <[email protected]>
Co-authored-by: JaehoNam <[email protected]>
Co-authored-by: th-snu <[email protected]>
Co-authored-by: WooYeon Lee <[email protected]>
---
common/src/main/java/org/apache/nemo/common/ir/Readable.java | 6 +-----
.../nemo/compiler/frontend/beam/coder/BeamDecoderFactory.java | 2 +-
.../optimizer/pass/compiletime/reshaping/LoopOptimizations.java | 4 +---
.../nemo/examples/beam/AlternatingLeastSquareInefficient.java | 7 +++----
.../org/apache/nemo/runtime/executor/data/BlockManagerWorker.java | 6 +++---
5 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/common/src/main/java/org/apache/nemo/common/ir/Readable.java
b/common/src/main/java/org/apache/nemo/common/ir/Readable.java
index 63a6b54..ff8fe07 100644
--- a/common/src/main/java/org/apache/nemo/common/ir/Readable.java
+++ b/common/src/main/java/org/apache/nemo/common/ir/Readable.java
@@ -21,7 +21,6 @@ package org.apache.nemo.common.ir;
import java.io.IOException;
import java.io.Serializable;
import java.util.List;
-import java.util.NoSuchElementException;
/**
* Interface for readable.
@@ -39,13 +38,10 @@ public interface Readable<O> extends Serializable {
* Method to read current data from the source.
* The caller should check whether the Readable is finished or not by using
isFinished() method
* before calling this method.
- * <p>
- * It can throw NoSuchElementException although it is not finished in
Unbounded source.
*
* @return a data read by the readable.
- * @throws NoSuchElementException when no element exists
*/
- O readCurrent() throws NoSuchElementException;
+ O readCurrent();
/**
* Read watermark.
diff --git
a/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/coder/BeamDecoderFactory.java
b/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/coder/BeamDecoderFactory.java
index 9302bf7..9573f7e 100644
---
a/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/coder/BeamDecoderFactory.java
+++
b/compiler/frontend/beam/src/main/java/org/apache/nemo/compiler/frontend/beam/coder/BeamDecoderFactory.java
@@ -69,7 +69,7 @@ public final class BeamDecoderFactory<T> implements
DecoderFactory<T> {
private abstract class BeamAbstractDecoder<T2> implements Decoder<T2> {
private final Coder<T2> beamCoder;
- private final InputStream inputStream;
+ private final transient InputStream inputStream;
/**
* Constructor.
diff --git
a/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/reshaping/LoopOptimizations.java
b/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/reshaping/LoopOptimizations.java
index 09de8a3..afa40f3 100644
---
a/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/reshaping/LoopOptimizations.java
+++
b/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/reshaping/LoopOptimizations.java
@@ -246,9 +246,7 @@ public final class LoopOptimizations {
@Override
public IRDAG apply(final IRDAG inputDAG) {
- inputDAG.reshapeUnsafely(dag -> {
- return recursivelyOptimize(dag);
- });
+ inputDAG.reshapeUnsafely(this::recursivelyOptimize);
return inputDAG;
}
diff --git
a/examples/beam/src/main/java/org/apache/nemo/examples/beam/AlternatingLeastSquareInefficient.java
b/examples/beam/src/main/java/org/apache/nemo/examples/beam/AlternatingLeastSquareInefficient.java
index 742be54..3aa95c4 100644
---
a/examples/beam/src/main/java/org/apache/nemo/examples/beam/AlternatingLeastSquareInefficient.java
+++
b/examples/beam/src/main/java/org/apache/nemo/examples/beam/AlternatingLeastSquareInefficient.java
@@ -57,8 +57,8 @@ public final class AlternatingLeastSquareInefficient {
PCollection<KV<Integer, float[]>>, PCollection<KV<Integer, float[]>>> {
private final Integer numFeatures;
private final Double lambda;
- private final PCollection<String> rawData;
- private final PCollection<KV<Integer, KV<int[], float[]>>> parsedItemData;
+ private final transient PCollection<String> rawData;
+ private final transient PCollection<KV<Integer, KV<int[], float[]>>>
parsedItemData;
/**
* Constructor of UpdateUserAndItemMatrix CompositeTransform.
@@ -102,9 +102,8 @@ public final class AlternatingLeastSquareInefficient {
* Main function for the ALS BEAM program.
*
* @param args arguments.
- * @throws ClassNotFoundException exception.
*/
- public static void main(final String[] args) throws ClassNotFoundException {
+ public static void main(final String[] args) {
final Long start = System.currentTimeMillis();
LOG.info(Arrays.toString(args));
final String inputFilePath = args[0];
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BlockManagerWorker.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BlockManagerWorker.java
index 8814121..4aed25d 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BlockManagerWorker.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/BlockManagerWorker.java
@@ -233,9 +233,9 @@ public final class BlockManagerWorker {
blockTransferThrottler.onTransferFinished(runtimeEdgeId);
} else {
// Connection is okay. Notify blockTransferThrottler when the
actual transfer is done, or fails.
-
connectionContext.getCompletedFuture().whenComplete((transferContext,
transferThrowable) -> {
- blockTransferThrottler.onTransferFinished(runtimeEdgeId);
- });
+
connectionContext.getCompletedFuture().whenComplete((transferContext,
transferThrowable) ->
+ blockTransferThrottler.onTransferFinished(runtimeEdgeId)
+ );
}
});