Skip to content
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

Expose Setting for prefetch thresholds #742

Merged
merged 6 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public class AppProperties {

private final List<String> custom_provider_classes = new ArrayList<>();

private List<Integer> search_prefetch_thresholds = new ArrayList<>();


public List<String> getCustomInterceptorClasses() {
return custom_interceptor_classes;
Expand Down Expand Up @@ -643,7 +645,16 @@ public void setLanguage_search_parameter_enabled(Boolean language_search_paramet
this.language_search_parameter_enabled = language_search_parameter_enabled;
}

public static class Cors {
public List<Integer> getSearch_prefetch_thresholds() {
return this.search_prefetch_thresholds;
}

public void setSearch_prefetch_thresholds(List<Integer> thePrefetchThresholds) {
this.search_prefetch_thresholds = thePrefetchThresholds;
}


public static class Cors {
private Boolean allow_Credentials = true;
private List<String> allowed_origin = List.of("*");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
jpaStorageSettings.setExpungeEnabled(appProperties.getExpunge_enabled());
jpaStorageSettings.setLanguageSearchParameterEnabled(appProperties.getLanguage_search_parameter_enabled());

jpaStorageSettings.setSearchPreFetchThresholds(appProperties.getSearch_prefetch_thresholds());

Integer maxFetchSize = appProperties.getMax_page_size();
jpaStorageSettings.setFetchSizeDefaultMaximum(maxFetchSize);
Expand Down
15 changes: 13 additions & 2 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ hapi:
### This flag when enabled to true, will avail evaluate measure operations from CR Module.
### Flag is false by default, can be passed as command line argument to override.
cr:
enabled: false
enabled: true
tadgh marked this conversation as resolved.
Show resolved Hide resolved
caregaps:
reporter: "default"
section_author: "default"
Expand Down Expand Up @@ -229,7 +229,18 @@ hapi:
search-coord-core-pool-size: 20
search-coord-max-pool-size: 100
search-coord-queue-capacity: 200


# Search Prefetch Thresholds.

# This setting sets the number of search results to prefetch. For example, if this list
# is set to [100, 1000, -1] then the server will initially load 100 results and not
# attempt to load more. If the user requests subsequent page(s) of results and goes
# past 100 results, the system will load the next 900 (up to the following threshold of 1000).
# The system will progressively work through these thresholds.
# A threshold of -1 means to load all results. Note that if the final threshold is a
# number other than -1, the system will never prefetch more than the given number.
search_prefetch_thresholds: 13,503,2003
tadgh marked this conversation as resolved.
Show resolved Hide resolved

# comma-separated package names, will be @ComponentScan'ed by Spring to allow for creating custom Spring beans
#custom-bean-packages:

Expand Down
Loading