forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-33341][state] Refactoring: introduce common superclass for all…
… IncrementalKeyedStateHandle.
- Loading branch information
1 parent
98e4610
commit 2d74ee3
Showing
11 changed files
with
192 additions
and
266 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
106 changes: 106 additions & 0 deletions
106
...-runtime/src/main/java/org/apache/flink/runtime/state/AbstractIncrementalStateHandle.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,106 @@ | ||
/* | ||
* 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 | ||
* | ||
* http://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 javax.annotation.Nonnull; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
/** Abstract superclass for all {@link IncrementalKeyedStateHandle}. */ | ||
public abstract class AbstractIncrementalStateHandle implements IncrementalKeyedStateHandle { | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** The checkpoint Id. */ | ||
protected final long checkpointId; | ||
|
||
/** | ||
* UUID to identify the backend which created this state handle. This is in creating the key for | ||
* the {@link SharedStateRegistry}. | ||
*/ | ||
protected final UUID backendIdentifier; | ||
|
||
/** The key-group range covered by this state handle. */ | ||
protected final KeyGroupRange keyGroupRange; | ||
|
||
/** Shared state in the incremental checkpoint. */ | ||
protected final List<HandleAndLocalPath> sharedState; | ||
|
||
/** Primary meta data state of the incremental checkpoint. */ | ||
protected final StreamStateHandle metaStateHandle; | ||
|
||
/** Unique id for this state handle. */ | ||
protected final StateHandleID stateHandleId; | ||
|
||
public AbstractIncrementalStateHandle( | ||
UUID backendIdentifier, | ||
KeyGroupRange keyGroupRange, | ||
long checkpointId, | ||
List<HandleAndLocalPath> sharedState, | ||
StreamStateHandle metaStateHandle, | ||
StateHandleID stateHandleId) { | ||
this.checkpointId = checkpointId; | ||
this.keyGroupRange = keyGroupRange; | ||
this.backendIdentifier = backendIdentifier; | ||
this.sharedState = sharedState; | ||
this.metaStateHandle = metaStateHandle; | ||
this.stateHandleId = stateHandleId; | ||
} | ||
|
||
@Override | ||
public long getCheckpointId() { | ||
return checkpointId; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public UUID getBackendIdentifier() { | ||
return backendIdentifier; | ||
} | ||
|
||
@Override | ||
public KeyGroupRange getKeyGroupRange() { | ||
return keyGroupRange; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public List<HandleAndLocalPath> getSharedStateHandles() { | ||
return sharedState; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public StreamStateHandle getMetaDataStateHandle() { | ||
return metaStateHandle; | ||
} | ||
|
||
@Override | ||
public StateHandleID getStateHandleId() { | ||
return stateHandleId; | ||
} | ||
|
||
@Override | ||
public KeyedStateHandle getIntersection(KeyGroupRange keyGroupRange) { | ||
return KeyGroupRange.EMPTY_KEY_GROUP_RANGE.equals( | ||
getKeyGroupRange().getIntersection(keyGroupRange)) | ||
? null | ||
: this; | ||
} | ||
} |
124 changes: 0 additions & 124 deletions
124
flink-runtime/src/main/java/org/apache/flink/runtime/state/DirectoryKeyedStateHandle.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.