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 1060055 [NEMO-429] SWPP TEAM18 Code Smell Fix (#271)
1060055 is described below
commit 1060055ebfa9b37139575efef074759d5bda51e5
Author: JungYunsoo <[email protected]>
AuthorDate: Sun Jan 19 14:09:26 2020 +0900
[NEMO-429] SWPP TEAM18 Code Smell Fix (#271)
* change private to transient
* fix lambda
Co-authored-by: lim8540 <[email protected]>
Co-authored-by: gywls00 <[email protected]>
Co-authored-by: Namkoong Hugh <[email protected]>
---
.../main/java/org/apache/nemo/client/JobLauncher.java | 16 +++++++---------
.../apache/nemo/common/coder/BytesEncoderFactory.java | 2 +-
.../src/main/java/org/apache/nemo/common/ir/IRDAG.java | 6 +++---
.../nemo/common/ir/vertex/InMemorySourceVertex.java | 4 ++--
4 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/client/src/main/java/org/apache/nemo/client/JobLauncher.java
b/client/src/main/java/org/apache/nemo/client/JobLauncher.java
index adafcd8..c349ecf 100644
--- a/client/src/main/java/org/apache/nemo/client/JobLauncher.java
+++ b/client/src/main/java/org/apache/nemo/client/JobLauncher.java
@@ -175,6 +175,7 @@ public final class JobLauncher {
/**
* Clean up everything.
*/
+ private static final String INTERRUPTED = "Interrupted: ";
public static void shutdown() {
// Trigger driver shutdown afterwards
driverRPCServer.send(ControlMessage.ClientToDriverMessage.newBuilder()
@@ -186,7 +187,7 @@ public final class JobLauncher {
LOG.info("Wait for the driver to finish");
driverLauncher.wait();
} catch (final InterruptedException e) {
- LOG.warn("Interrupted: ", e);
+ LOG.warn(INTERRUPTED, e);
// clean up state...
Thread.currentThread().interrupt();
}
@@ -247,7 +248,7 @@ public final class JobLauncher {
LOG.info("Waiting for the driver to be ready");
driverReadyLatch.await();
} catch (final InterruptedException e) {
- LOG.warn("Interrupted: ", e);
+ LOG.warn(INTERRUPTED, e);
// clean up state...
Thread.currentThread().interrupt();
}
@@ -269,7 +270,7 @@ public final class JobLauncher {
LOG.info("Waiting for the DAG to finish execution");
jobDoneLatch.await();
} catch (final InterruptedException e) {
- LOG.warn("Interrupted: ", e);
+ LOG.warn(INTERRUPTED, e);
// clean up state...
Thread.currentThread().interrupt();
throw new RuntimeException(e);
@@ -337,9 +338,8 @@ public final class JobLauncher {
* Get driver ncs configuration.
*
* @return driver ncs configuration.
- * @throws InjectionException exception while injection.
*/
- private static Configuration getDriverNcsConf() throws InjectionException {
+ private static Configuration getDriverNcsConf() {
return Configurations.merge(NameServerConfiguration.CONF.build(),
LocalNameResolverConfiguration.CONF.build(),
TANG.newConfigurationBuilder()
@@ -351,9 +351,8 @@ public final class JobLauncher {
* Get driver message configuration.
*
* @return driver message configuration.
- * @throws InjectionException exception while injection.
*/
- private static Configuration getDriverMessageConf() throws
InjectionException {
+ private static Configuration getDriverMessageConf() {
return TANG.newConfigurationBuilder()
.bindNamedParameter(MessageParameters.SenderId.class,
MessageEnvironment.MASTER_COMMUNICATION_ID)
.build();
@@ -389,10 +388,9 @@ public final class JobLauncher {
* @param args arguments to be processed as command line.
* @return job configuration.
* @throws IOException exception while processing command line.
- * @throws InjectionException exception while injection.
*/
@VisibleForTesting
- public static Configuration getJobConf(final String[] args) throws
IOException, InjectionException {
+ public static Configuration getJobConf(final String[] args) throws
IOException {
final JavaConfigurationBuilder confBuilder =
TANG.newConfigurationBuilder();
final CommandLine cl = new CommandLine(confBuilder);
cl.registerShortNameOfClass(JobConf.JobId.class);
diff --git
a/common/src/main/java/org/apache/nemo/common/coder/BytesEncoderFactory.java
b/common/src/main/java/org/apache/nemo/common/coder/BytesEncoderFactory.java
index 03f3694..7fe4047 100644
--- a/common/src/main/java/org/apache/nemo/common/coder/BytesEncoderFactory.java
+++ b/common/src/main/java/org/apache/nemo/common/coder/BytesEncoderFactory.java
@@ -58,7 +58,7 @@ public final class BytesEncoderFactory implements
EncoderFactory<byte[]> {
*/
private final class BytesEncoder implements Encoder<byte[]> {
- private final OutputStream outputStream;
+ private final transient OutputStream outputStream;
/**
* Constructor.
diff --git a/common/src/main/java/org/apache/nemo/common/ir/IRDAG.java
b/common/src/main/java/org/apache/nemo/common/ir/IRDAG.java
index 36ef6d0..37e2463 100644
--- a/common/src/main/java/org/apache/nemo/common/ir/IRDAG.java
+++ b/common/src/main/java/org/apache/nemo/common/ir/IRDAG.java
@@ -416,7 +416,7 @@ public final class IRDAG implements DAGInterface<IRVertex,
IREdge> {
////////////////////////////////// STEP 2: Annotate the MessageId on
optimization target edges
- modifiedDAG.topologicalDo(v -> {
+ modifiedDAG.topologicalDo(v ->
modifiedDAG.getIncomingEdgesOf(v).forEach(inEdge -> {
if (edgesToOptimize.contains(inEdge)) {
final HashSet<Integer> msgEdgeIds =
@@ -424,8 +424,8 @@ public final class IRDAG implements DAGInterface<IRVertex,
IREdge> {
msgEdgeIds.add(messageAggregatorVertex.getPropertyValue(MessageIdVertexProperty.class).get());
inEdge.setProperty(MessageIdEdgeProperty.of(msgEdgeIds));
}
- });
- });
+ })
+ );
final Set<IRVertex> insertedVertices = new HashSet<>();
insertedVertices.addAll(triggerList);
diff --git
a/common/src/main/java/org/apache/nemo/common/ir/vertex/InMemorySourceVertex.java
b/common/src/main/java/org/apache/nemo/common/ir/vertex/InMemorySourceVertex.java
index 1cf4e7d..72acaf9 100644
---
a/common/src/main/java/org/apache/nemo/common/ir/vertex/InMemorySourceVertex.java
+++
b/common/src/main/java/org/apache/nemo/common/ir/vertex/InMemorySourceVertex.java
@@ -33,7 +33,7 @@ import java.util.List;
* @param <T> type of data.
*/
public final class InMemorySourceVertex<T> extends SourceVertex<T> {
- private Iterable<T> initializedSourceData;
+ private transient Iterable<T> initializedSourceData;
/**
* Constructor for InMemorySourceVertex.
@@ -106,7 +106,7 @@ public final class InMemorySourceVertex<T> extends
SourceVertex<T> {
*/
private static final class InMemorySourceReadable<T> extends
BoundedIteratorReadable<T> {
- private final Iterable<T> initializedSourceData;
+ private final transient Iterable<T> initializedSourceData;
/**
* Constructor.