Skip to content

Commit

Permalink
[FLINK-9751] [filesystem] Add fixes and tests for Persistent Resumabl…
Browse files Browse the repository at this point in the history
…e Writers
  • Loading branch information
StephanEwen committed Jul 15, 2018
1 parent e296094 commit 9d238e1
Show file tree
Hide file tree
Showing 7 changed files with 572 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class LocalRecoverableFsDataOutputStream extends RecoverableFsDataOutputStream {
this.tempFile = checkNotNull(resumable.tempFile());

if (!tempFile.exists()) {
throw new FileNotFoundException("File Not Found: " + tempFile.getName());
throw new FileNotFoundException("File Not Found: " + tempFile);
}

if (tempFile.length() < resumable.offset()) {
throw new IOException("Missing data in tmp file: " + tempFile.getName());
throw new IOException("Missing data in tmp file: " + tempFile);
}

this.fos = new FileOutputStream(this.tempFile, true);
Expand Down Expand Up @@ -165,6 +165,8 @@ public void commitAfterRecovery() throws IOException {
try (FileOutputStream fos = new FileOutputStream(src, true)) {
fos.getChannel().truncate(expectedLength);
}
} else if (src.length() < expectedLength) {
throw new IOException("Missing data in tmp file: " + src);
}

// source still exists, so no renaming happened yet. do it!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package org.apache.flink.core.io;

import org.apache.flink.annotation.Internal;

import java.io.IOException;

/**
Expand All @@ -44,6 +46,7 @@
*
* @param <E> The data type serialized / deserialized by this serializer.
*/
@Internal
public interface SimpleVersionedSerializer<E> extends Versioned {

/**
Expand Down
Loading

0 comments on commit 9d238e1

Please sign in to comment.