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 <[email protected]>
- Loading branch information
Showing
10 changed files
with
282 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.
d462ea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
org.janusgraph.MgmtOlapJobBenchmark.runRemoveIndex
115.17078655949494
ms/op114.90347956363637
ms/op1.00
org.janusgraph.JanusGraphSpeedBenchmark.basicAddAndDelete
19126.715386662727
ms/op16912.67303256719
ms/op1.13
org.janusgraph.GraphCentricQueryBenchmark.getVertices
2142.737045892285
ms/op2244.533148796801
ms/op0.95
org.janusgraph.MgmtOlapJobBenchmark.runReindex
425.69987621999996
ms/op403.35688975634366
ms/op1.06
org.janusgraph.JanusGraphSpeedBenchmark.basicCount
323.7948557389643
ms/op369.41181090112127
ms/op0.88
org.janusgraph.CQLMultiQueryBenchmark.getNeighborNames
57422.8355778
ms/op46939.17807455001
ms/op1.22
org.janusgraph.CQLMultiQueryBenchmark.getNames
57784.456385749996
ms/op48136.52566508333
ms/op1.20
This comment was automatically generated by workflow using github-action-benchmark.