You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by sr...@apache.org on 2019/02/26 15:50:51 UTC

[flink] branch release-1.8 updated (f1a1b55 -> ecdf473)

This is an automated email from the ASF dual-hosted git repository.

srichter pushed a change to branch release-1.8
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from f1a1b55  [FLINK-11745][State TTL][E2E] Restore from the savepoint after the job cancellation.
     new aa55d58  [FLINK-11744][core]Provide stable/final toHexString-method in AbstractID
     new ecdf473  [hotfix] Revert overriding toString-method in AllocationID

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/flink/util/AbstractID.java     | 28 ++++++++++++++--------
 .../clusterframework/types/AllocationID.java       |  5 ----
 .../state/TaskExecutorLocalStateStoresManager.java |  4 ++--
 .../runtime/state/TaskLocalStateStoreImpl.java     |  2 +-
 4 files changed, 21 insertions(+), 18 deletions(-)


[flink] 01/02: [FLINK-11744][core]Provide stable/final toHexString-method in AbstractID

Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

srichter pushed a commit to branch release-1.8
in repository https://gitbox.apache.org/repos/asf/flink.git

commit aa55d58734184af7f2438e017f9df087e6308b3e
Author: Stefan Richter <s....@data-artisans.com>
AuthorDate: Mon Feb 25 13:05:37 2019 +0100

    [FLINK-11744][core]Provide stable/final toHexString-method in AbstractID
    
    This closes #7825.
    
    (cherry picked from commit 435807e51cec99e1114277ee28f7672dd4676588)
---
 .../java/org/apache/flink/util/AbstractID.java     | 28 ++++++++++++++--------
 .../state/TaskExecutorLocalStateStoresManager.java |  4 ++--
 .../runtime/state/TaskLocalStateStoreImpl.java     |  2 +-
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/flink-core/src/main/java/org/apache/flink/util/AbstractID.java b/flink-core/src/main/java/org/apache/flink/util/AbstractID.java
index b7be21a..dfb41ed 100644
--- a/flink-core/src/main/java/org/apache/flink/util/AbstractID.java
+++ b/flink-core/src/main/java/org/apache/flink/util/AbstractID.java
@@ -47,7 +47,7 @@ public class AbstractID implements Comparable<AbstractID>, java.io.Serializable
 	protected final long lowerPart;
 
 	/** The memoized value returned by toString(). */
-	private transient String toString;
+	private transient String hexString;
 
 	// --------------------------------------------------------------------------------------------
 
@@ -127,6 +127,22 @@ public class AbstractID implements Comparable<AbstractID>, java.io.Serializable
 		return bytes;
 	}
 
+	/**
+	 * Returns pure String representation of the ID in hexadecimal. This method should be used to construct things like
+	 * paths etc., that require a stable representation and is therefore final.
+	 */
+	public final String toHexString() {
+		if (this.hexString == null) {
+			final byte[] ba = new byte[SIZE];
+			longToByteArray(this.lowerPart, ba, 0);
+			longToByteArray(this.upperPart, ba, SIZE_OF_LONG);
+
+			this.hexString = StringUtils.byteToHexString(ba);
+		}
+
+		return this.hexString;
+	}
+
 	// --------------------------------------------------------------------------------------------
 	//  Standard Utilities
 	// --------------------------------------------------------------------------------------------
@@ -153,15 +169,7 @@ public class AbstractID implements Comparable<AbstractID>, java.io.Serializable
 
 	@Override
 	public String toString() {
-		if (this.toString == null) {
-			final byte[] ba = new byte[SIZE];
-			longToByteArray(this.lowerPart, ba, 0);
-			longToByteArray(this.upperPart, ba, SIZE_OF_LONG);
-
-			this.toString = StringUtils.byteToHexString(ba);
-		}
-
-		return this.toString;
+		return toHexString();
 	}
 
 	@Override
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskExecutorLocalStateStoresManager.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskExecutorLocalStateStoresManager.java
index 095dc86..dd3dc31 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskExecutorLocalStateStoresManager.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskExecutorLocalStateStoresManager.java
@@ -120,7 +120,7 @@ public class TaskExecutorLocalStateStoresManager {
 
 				if (LOG.isDebugEnabled()) {
 					LOG.debug("Registered new allocation id {} for local state stores for job {}.",
-						allocationID, jobId);
+						allocationID.toHexString(), jobId);
 				}
 			}
 
@@ -232,7 +232,7 @@ public class TaskExecutorLocalStateStoresManager {
 
 	@VisibleForTesting
 	String allocationSubDirString(AllocationID allocationID) {
-		return "aid_" + allocationID;
+		return "aid_" + allocationID.toHexString();
 	}
 
 	private File[] allocationBaseDirectories(AllocationID allocationID) {
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java b/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java
index df9147c..c90b4e1 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java
@@ -357,7 +357,7 @@ public class TaskLocalStateStoreImpl implements OwnedTaskLocalStateStore {
 		return "TaskLocalStateStore{" +
 			"jobID=" + jobID +
 			", jobVertexID=" + jobVertexID +
-			", allocationID=" + allocationID +
+			", allocationID=" + allocationID.toHexString() +
 			", subtaskIndex=" + subtaskIndex +
 			", localRecoveryConfig=" + localRecoveryConfig +
 			", storedCheckpointIDs=" + storedTaskStateByCheckpointID.keySet() +


[flink] 02/02: [hotfix] Revert overriding toString-method in AllocationID

Posted by sr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

srichter pushed a commit to branch release-1.8
in repository https://gitbox.apache.org/repos/asf/flink.git

commit ecdf4738280e0b6d4fcee8e6f1b9a4bdb12a660d
Author: Stefan Richter <s....@data-artisans.com>
AuthorDate: Mon Feb 25 13:06:43 2019 +0100

    [hotfix] Revert overriding toString-method in AllocationID
    
    (cherry picked from commit c0149ba98c00b5d4f0c0896135bc735e0579cb9e)
---
 .../apache/flink/runtime/clusterframework/types/AllocationID.java    | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/AllocationID.java b/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/AllocationID.java
index 7004eff..e722e9f 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/AllocationID.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/clusterframework/types/AllocationID.java
@@ -52,9 +52,4 @@ public class AllocationID extends AbstractID {
 	public AllocationID(long lowerPart, long upperPart) {
 		super(lowerPart, upperPart);
 	}
-
-	@Override
-	public String toString() {
-		return "AllocationID{" + super.toString() + '}';
-	}
 }