This is an automated email from the ASF dual-hosted git repository.
jangho 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 2da1647 [NEMO-429] SWPP TEAM16 Code Smell Fix (#278)
2da1647 is described below
commit 2da1647454eec500162a1649115897c4277e1779
Author: JooHyung Kim <[email protected]>
AuthorDate: Fri Jan 17 14:00:27 2020 +0900
[NEMO-429] SWPP TEAM16 Code Smell Fix (#278)
JIRA: [NEMO-429:
Team16](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-429)
**Major changes:**
- Fixed code smells (SWPP Code Smell session)
Co-authored-by: mss8087 <[email protected]>
Co-authored-by: Daewoong Kim <[email protected]>
Co-authored-by: Jangho Seo <[email protected]>
Co-authored-by: WooYeon Lee <[email protected]>
---
.../org/apache/nemo/runtime/executor/data/block/FileBlock.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/block/FileBlock.java
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/block/FileBlock.java
index a869e8d..05c310e 100644
---
a/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/block/FileBlock.java
+++
b/runtime/executor/src/main/java/org/apache/nemo/runtime/executor/data/block/FileBlock.java
@@ -69,6 +69,7 @@ public final class FileBlock<K extends Serializable>
implements Block<K> {
private final String filePath;
private final FileMetadata<K> metadata;
private final MemoryPoolAssigner memoryPoolAssigner;
+ private static final String ALREADY_COMMITED = "The partition is already
committed!";
/**
* Constructor.
@@ -128,7 +129,7 @@ public final class FileBlock<K extends Serializable>
implements Block<K> {
public void write(final K key,
final Object element) throws BlockWriteException {
if (metadata.isCommitted()) {
- throw new BlockWriteException(new Throwable("The partition is already
committed!"));
+ throw new BlockWriteException(new Throwable(ALREADY_COMMITED));
} else {
try {
SerializedPartition<K> partition = nonCommittedPartitionsMap.get(key);
@@ -154,7 +155,7 @@ public final class FileBlock<K extends Serializable>
implements Block<K> {
public void writePartitions(final Iterable<NonSerializedPartition<K>>
partitions)
throws BlockWriteException {
if (metadata.isCommitted()) {
- throw new BlockWriteException(new Throwable("The partition is already
committed!"));
+ throw new BlockWriteException(new Throwable(ALREADY_COMMITED));
} else {
try {
final Iterable<SerializedPartition<K>> convertedPartitions =
@@ -177,7 +178,7 @@ public final class FileBlock<K extends Serializable>
implements Block<K> {
public void writeSerializedPartitions(final Iterable<SerializedPartition<K>>
partitions)
throws BlockWriteException {
if (metadata.isCommitted()) {
- throw new BlockWriteException(new Throwable("The partition is already
committed!"));
+ throw new BlockWriteException(new Throwable(ALREADY_COMMITED));
} else {
try {
writeToFile(partitions);