forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-10043] [State Backends] Refactor RocksDBKeyedStateBackend obje…
…ct construction/initialization/restore code This closes apache#7674.
- Loading branch information
1 parent
70107c4
commit 3bf06b9
Showing
49 changed files
with
2,662 additions
and
1,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
...untime/src/main/java/org/apache/flink/runtime/state/AbstractKeyedStateBackendBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.runtime.state; | ||
|
||
import org.apache.flink.api.common.ExecutionConfig; | ||
import org.apache.flink.api.common.typeutils.TypeSerializer; | ||
import org.apache.flink.runtime.query.TaskKvStateRegistry; | ||
import org.apache.flink.runtime.state.ttl.TtlTimeProvider; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* An abstract base implementation of the {@link StateBackendBuilder} interface. | ||
*/ | ||
public abstract class AbstractKeyedStateBackendBuilder<K> | ||
implements StateBackendBuilder<AbstractKeyedStateBackend, BackendBuildingException> { | ||
protected final TaskKvStateRegistry kvStateRegistry; | ||
protected final TypeSerializer<K> keySerializer; | ||
protected final StateSerializerProvider<K> keySerializerProvider; | ||
protected final ClassLoader userCodeClassLoader; | ||
protected final int numberOfKeyGroups; | ||
protected final KeyGroupRange keyGroupRange; | ||
protected final ExecutionConfig executionConfig; | ||
protected final TtlTimeProvider ttlTimeProvider; | ||
protected final StreamCompressionDecorator keyGroupCompressionDecorator; | ||
protected final Collection<KeyedStateHandle> restoreStateHandles; | ||
|
||
public AbstractKeyedStateBackendBuilder( | ||
TaskKvStateRegistry kvStateRegistry, | ||
TypeSerializer<K> keySerializer, | ||
ClassLoader userCodeClassLoader, | ||
int numberOfKeyGroups, | ||
KeyGroupRange keyGroupRange, | ||
ExecutionConfig executionConfig, | ||
TtlTimeProvider ttlTimeProvider, | ||
@Nonnull Collection<KeyedStateHandle> stateHandles, | ||
StreamCompressionDecorator keyGroupCompressionDecorator) { | ||
this.kvStateRegistry = kvStateRegistry; | ||
this.keySerializer = keySerializer; | ||
this.keySerializerProvider = StateSerializerProvider.fromNewRegisteredSerializer(keySerializer); | ||
this.userCodeClassLoader = userCodeClassLoader; | ||
this.numberOfKeyGroups = numberOfKeyGroups; | ||
this.keyGroupRange = keyGroupRange; | ||
this.executionConfig = executionConfig; | ||
this.ttlTimeProvider = ttlTimeProvider; | ||
this.keyGroupCompressionDecorator = keyGroupCompressionDecorator; | ||
this.restoreStateHandles = stateHandles; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
flink-runtime/src/main/java/org/apache/flink/runtime/state/BackendBuildingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.runtime.state; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Exceptions which indicate that a state backend building has failed. | ||
*/ | ||
public class BackendBuildingException extends IOException { | ||
public BackendBuildingException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
Oops, something went wrong.