You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/11/26 06:36:20 UTC
[GitHub] imamitsehgal closed pull request #7171: FLINK-10918 Fix error while checkpointing on window keyed state rock …
imamitsehgal closed pull request #7171: FLINK-10918 Fix error while checkpointing on window keyed state rock …
URL: https://github.com/apache/flink/pull/7171
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java b/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
index 17ba985f883..1ee831407d0 100644
--- a/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
+++ b/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
@@ -557,6 +557,14 @@ private void createDB() throws IOException {
this.defaultColumnFamily = columnFamilyHandles.get(0);
}
+ private String getPathAsString(Path path) {
+ String pathString = path.getPath();
+ if (path.hasWindowsDrive() && pathString.startsWith("/")) {
+ pathString = pathString.substring(1);
+ }
+ return pathString;
+ }
+
private RocksDB openDB(
String path,
List<ColumnFamilyDescriptor> stateColumnFamilyDescriptors,
@@ -575,7 +583,7 @@ private RocksDB openDB(
try {
dbRef = RocksDB.open(
Preconditions.checkNotNull(dbOptions),
- Preconditions.checkNotNull(path),
+ Preconditions.checkNotNull(getPathAsString(new Path(path))),
columnFamilyDescriptors,
stateColumnFamilyHandles);
} catch (RocksDBException e) {
@@ -2546,7 +2554,9 @@ void takeSnapshot() throws Exception {
// create hard links of living files in the snapshot path
try (Checkpoint checkpoint = Checkpoint.create(stateBackend.db)) {
- checkpoint.createCheckpoint(localBackupDirectory.getDirectory().getPath());
+ String path = stateBackend.getPathAsString(localBackupDirectory.getDirectory());
+ LOG.trace("Checkpoint directory is {}.", path);
+ checkpoint.createCheckpoint(path);
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services