You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2020/05/16 15:25:07 UTC
[flink] 03/14: [hotfix][state backends] Minor code-style cleanups
This is an automated email from the ASF dual-hosted git repository.
sewen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit fd0946af1057265ef6cbf7a4e8c1fcc04a935589
Author: Stephan Ewen <se...@apache.org>
AuthorDate: Fri May 15 13:13:26 2020 +0200
[hotfix][state backends] Minor code-style cleanups
---
.../runtime/state/filesystem/FileStateHandle.java | 4 ++--
.../state/filesystem/RelativeFileStateHandle.java | 27 ++++++++++------------
2 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
index 3d94709..18eb479 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FileStateHandle.java
@@ -37,10 +37,10 @@ public class FileStateHandle implements StreamStateHandle {
private static final long serialVersionUID = 350284443258002355L;
- /** The path to the file in the filesystem, fully describing the file system */
+ /** The path to the file in the filesystem, fully describing the file system. */
private final Path filePath;
- /** The size of the state in the file */
+ /** The size of the state in the file. */
private final long stateSize;
/**
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/RelativeFileStateHandle.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/RelativeFileStateHandle.java
index 96b79ef..2ac4969 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/RelativeFileStateHandle.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/RelativeFileStateHandle.java
@@ -23,9 +23,9 @@ import org.apache.flink.runtime.state.StreamStateHandle;
/**
- * {@link StreamStateHandle} for state that was written to a file stream.
- * The differences between {@link FileStateHandle} and {@link RelativeFileStateHandle} is that, {@link RelativeFileStateHandle}
- * contains relativePath for the given handle.
+ * A {@link StreamStateHandle} for state that was written to a file stream.
+ * The differences between {@link FileStateHandle} and {@link RelativeFileStateHandle} is that
+ * {@link RelativeFileStateHandle} contains relativePath for the given handle.
*/
public class RelativeFileStateHandle extends FileStateHandle {
private static final long serialVersionUID = 1L;
@@ -33,26 +33,18 @@ public class RelativeFileStateHandle extends FileStateHandle {
private final String relativePath;
public RelativeFileStateHandle(
- Path path,
- String relativePath,
- long stateSize) {
+ Path path,
+ String relativePath,
+ long stateSize) {
super(path, stateSize);
this.relativePath = relativePath;
}
- @Override
- public void discardState() throws Exception {
- super.discardState();
- }
-
public String getRelativePath() {
return relativePath;
}
- @Override
- public String toString() {
- return String.format("RelativeFileStateHandle State: %s, %s [%d bytes]", getFilePath(), relativePath, getStateSize());
- }
+ // ------------------------------------------------------------------------
@Override
public boolean equals(Object o) {
@@ -72,5 +64,10 @@ public class RelativeFileStateHandle extends FileStateHandle {
public int hashCode() {
return 17 * super.hashCode() + relativePath.hashCode();
}
+
+ @Override
+ public String toString() {
+ return String.format("RelativeFileStateHandle State: %s, %s [%d bytes]", getFilePath(), relativePath, getStateSize());
+ }
}