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/10/22 06:52:52 UTC

[GitHub] tzulitai commented on a change in pull request #6875: [FLINK-9808] [state backends] Migrate state when necessary in state backends

tzulitai commented on a change in pull request #6875: [FLINK-9808] [state backends] Migrate state when necessary in state backends
URL: https://github.com/apache/flink/pull/6875#discussion_r226911417
 
 

 ##########
 File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/AbstractRocksDBState.java
 ##########
 @@ -154,6 +159,29 @@ public void setCurrentNamespace(N namespace) {
 		return backend.db.get(columnFamily, tmpKeySerializationView.getCopyOfBuffer());
 	}
 
+	public byte[] migrateSerializedValue(
+			byte[] serializedOldValue,
+			TypeSerializer<V> priorSerializer,
+			TypeSerializer<V> newSerializer) throws StateMigrationException {
+
+		try {
+			V value = priorSerializer.deserialize(new DataInputViewStreamWrapper(new ByteArrayInputStream(serializedOldValue)));
+
+			ByteArrayOutputStream baos = new ByteArrayOutputStream();
+			DataOutputViewStreamWrapper out = new DataOutputViewStreamWrapper(baos);
 
 Review comment:
   Good idea, will address this.

----------------------------------------------------------------
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