Skip to content

Commit 115bcfc

Browse files
authored
added support for fillBlockCache in AQL query options (#403)
1 parent 8da53fa commit 115bcfc

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
- added support for `fillBlockCache` in AQL query options (ArangoDB v3.8.1)
10+
911
## [6.12.3] - 2021-06-24
1012

1113
- fixed host handler failures count (#DEVSUP-805, #398)

src/main/java/com/arangodb/model/AqlQueryOptions.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class AqlQueryOptions implements Serializable {
4242
private Integer ttl;
4343
private Integer batchSize;
4444
private Boolean cache;
45+
private Boolean fillBlockCache;
4546
private Long memoryLimit;
4647
private VPackSlice bindVars;
4748
private String query;
@@ -131,6 +132,26 @@ public AqlQueryOptions cache(final Boolean cache) {
131132
return this;
132133
}
133134

135+
public Boolean getFillBlockCache() {
136+
return options != null ? options.fillBlockCache : null;
137+
}
138+
139+
/**
140+
* @param fillBlockCache if set to <code>true</code> or not specified, this will make the query store
141+
* the data it reads via the RocksDB storage engine in the RocksDB block cache. This is
142+
* usually the desired behavior. The option can be set to <code>false</code> for queries that
143+
* are known to either read a lot of data that would thrash the block cache, or for queries
144+
* that read data known to be outside of the hot set. By setting the option
145+
* to <code>false</code>, data read by the query will not make it into the RocksDB block cache if
146+
* it is not already in there, thus leaving more room for the actual hot set.
147+
* @return options
148+
* @since ArangoDB 3.8.1
149+
*/
150+
public AqlQueryOptions fillBlockCache(final Boolean fillBlockCache) {
151+
getOptions().fillBlockCache = fillBlockCache;
152+
return this;
153+
}
154+
134155
protected VPackSlice getBindVars() {
135156
return bindVars;
136157
}
@@ -407,6 +428,7 @@ private static class Options implements Serializable {
407428
private Boolean stream;
408429
private Collection<String> shardIds;
409430
private Double maxRuntime;
431+
private Boolean fillBlockCache;
410432

411433
protected Optimizer getOptimizer() {
412434
if (optimizer == null) {

0 commit comments

Comments
 (0)