Skip to content

fillBlockCache query option #403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

- added support for `fillBlockCache` in AQL query options (ArangoDB v3.8.1)

## [6.12.3] - 2021-06-24

- fixed host handler failures count (#DEVSUP-805, #398)
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/arangodb/model/AqlQueryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class AqlQueryOptions implements Serializable {
private Integer ttl;
private Integer batchSize;
private Boolean cache;
private Boolean fillBlockCache;
private Long memoryLimit;
private VPackSlice bindVars;
private String query;
Expand Down Expand Up @@ -131,6 +132,26 @@ public AqlQueryOptions cache(final Boolean cache) {
return this;
}

public Boolean getFillBlockCache() {
return options != null ? options.fillBlockCache : null;
}

/**
* @param fillBlockCache if set to <code>true</code> or not specified, this will make the query store
* the data it reads via the RocksDB storage engine in the RocksDB block cache. This is
* usually the desired behavior. The option can be set to <code>false</code> for queries that
* are known to either read a lot of data that would thrash the block cache, or for queries
* that read data known to be outside of the hot set. By setting the option
* to <code>false</code>, data read by the query will not make it into the RocksDB block cache if
* it is not already in there, thus leaving more room for the actual hot set.
* @return options
* @since ArangoDB 3.8.1
*/
public AqlQueryOptions fillBlockCache(final Boolean fillBlockCache) {
getOptions().fillBlockCache = fillBlockCache;
return this;
}

protected VPackSlice getBindVars() {
return bindVars;
}
Expand Down Expand Up @@ -407,6 +428,7 @@ private static class Options implements Serializable {
private Boolean stream;
private Collection<String> shardIds;
private Double maxRuntime;
private Boolean fillBlockCache;

protected Optimizer getOptimizer() {
if (optimizer == null) {
Expand Down