forked from JanusGraph/janusgraph
-
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.
Add possibility to manual db-cache invalidation
Related to JanusGraph#3155 Signed-off-by: Oleksandr Porunov <alexandr.porunov@gmail.com>
- Loading branch information
Showing
10 changed files
with
278 additions
and
17 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
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
53 changes: 53 additions & 0 deletions
53
...ph-core/src/main/java/org/janusgraph/graphdb/database/cache/CacheInvalidationService.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,53 @@ | ||
// Copyright 2022 JanusGraph Authors | ||
// | ||
// Licensed 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.janusgraph.graphdb.database.cache; | ||
|
||
import org.janusgraph.diskstorage.StaticBuffer; | ||
|
||
public interface CacheInvalidationService { | ||
|
||
/** | ||
* Marks specific vertex as expired. | ||
* It will make sure that any executed query associated with this vertex will be invalidated. | ||
* @param vertexId vertex id to expire | ||
*/ | ||
void markVertexAsExpired(Long vertexId); | ||
|
||
/** | ||
* Marks specific key as expired. | ||
* It will make sure that any executed query associated with this key will be invalidated. | ||
* @param key key to expire | ||
*/ | ||
void markKeyAsExpired(StaticBuffer key); | ||
|
||
/** | ||
* Instead of waiting for a probabilistic invalidation it triggers all cached queries scan and invalidation. | ||
* This will remove any cached expired data. | ||
*/ | ||
void forceClearExpiredCache(); | ||
|
||
/** | ||
* Marks a vertex as expired and triggers force clear of expired cache (i.e. {@link #forceClearExpiredCache()}) | ||
* @param vertexId vertex id to invalidate | ||
*/ | ||
void forceInvalidateVertex(Long vertexId); | ||
|
||
/** | ||
* Marks vertices as expired and triggers force clear of expired cache (i.e. {@link #forceClearExpiredCache()}) | ||
* @param vertexIds vertex ids to invalidate | ||
*/ | ||
void forceInvalidateVertices(Iterable<Long> vertexIds); | ||
|
||
} |
Oops, something went wrong.