nemo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeongy...@apache.org
Subject [incubator-nemo] 20/40: fix unit test bug
Date Fri, 06 Apr 2018 02:36:00 GMT
This is an automated email from the ASF dual-hosted git repository.

jeongyoon pushed a commit to branch skew_exp
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git

commit 446b16589bd40be399ba9d36aa0bfabd34acc832
Author: sanha <sanhaleehana@naver.com>
AuthorDate: Sun Mar 18 13:53:00 2018 +0900

    fix unit test bug
---
 .../main/java/edu/snu/nemo/runtime/executor/data/block/FileBlock.java   | 2 +-
 .../snu/nemo/runtime/executor/data/block/NonSerializedMemoryBlock.java  | 2 +-
 .../edu/snu/nemo/runtime/executor/data/block/SerializedMemoryBlock.java | 2 +-
 .../java/edu/snu/nemo/runtime/executor/datatransfer/OutputWriter.java   | 1 +
 .../snu/nemo/tests/runtime/executor/datatransfer/DataTransferTest.java  | 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/FileBlock.java
b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/FileBlock.java
index 2e22eb0..6d44b5d 100644
--- a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/FileBlock.java
+++ b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/FileBlock.java
@@ -99,7 +99,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("The block is already committed!"));
     } else {
       final Serializer serializerToUse = metadata.isWriteAsBytes()
           ? SerializerManager.getAsBytesSerializer() : serializer;
diff --git a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/NonSerializedMemoryBlock.java
b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/NonSerializedMemoryBlock.java
index 1694e19..ed35284 100644
--- a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/NonSerializedMemoryBlock.java
+++ b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/NonSerializedMemoryBlock.java
@@ -72,7 +72,7 @@ public final class NonSerializedMemoryBlock<K extends Serializable>
implements B
   public void write(final K key,
                     final Object element) throws BlockWriteException {
     if (committed) {
-      throw new BlockWriteException(new Throwable("The partition is already committed!"));
+      throw new BlockWriteException(new Throwable("The block is already committed!"));
     } else {
       try {
         final NonSerializedPartition<K> partition =
diff --git a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/SerializedMemoryBlock.java
b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/SerializedMemoryBlock.java
index 21926ed..5d817ad 100644
--- a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/SerializedMemoryBlock.java
+++ b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/data/block/SerializedMemoryBlock.java
@@ -81,7 +81,7 @@ public final class SerializedMemoryBlock<K extends Serializable> implements
Bloc
   public void write(final K key,
                     final Object element) throws BlockWriteException {
     if (committed) {
-      throw new BlockWriteException(new Throwable("The partition is already committed!"));
+      throw new BlockWriteException(new Throwable("The block is already committed!"));
     } else {
       try {
         final Serializer serializerToUse = writeAsBytes
diff --git a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/datatransfer/OutputWriter.java
b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/datatransfer/OutputWriter.java
index 3313ef2..344cbcd 100644
--- a/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/datatransfer/OutputWriter.java
+++ b/runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/datatransfer/OutputWriter.java
@@ -127,6 +127,7 @@ public final class OutputWriter extends DataTransfer implements AutoCloseable
{
    * Notifies that all writes for a block is end.
    * Further write about a committed block will throw an exception.
    */
+  @Override
   public void close() {
     // Commit block.
     final UsedDataHandlingProperty.Value usedDataHandling =
diff --git a/tests/src/test/java/edu/snu/nemo/tests/runtime/executor/datatransfer/DataTransferTest.java
b/tests/src/test/java/edu/snu/nemo/tests/runtime/executor/datatransfer/DataTransferTest.java
index 7a2ec36..008950c 100644
--- a/tests/src/test/java/edu/snu/nemo/tests/runtime/executor/datatransfer/DataTransferTest.java
+++ b/tests/src/test/java/edu/snu/nemo/tests/runtime/executor/datatransfer/DataTransferTest.java
@@ -444,7 +444,7 @@ public final class DataTransferTest {
 
       final OutputWriter writer2 = new OutputWriter(HASH_RANGE_MULTIPLIER, srcTaskIndex,
srcVertex.getId(), dstVertex,
           dummyEdge2, sender);
-      dataWritten.iterator().forEachRemaining(writer::writeElement);
+      dataWritten.iterator().forEachRemaining(writer2::writeElement);
       writer2.close();
     });
 

-- 
To stop receiving notification emails like this one, please contact
jeongyoon@apache.org.

Mime
View raw message