Interface OpenSearchConfigManager
- All Known Implementing Classes:
DefaultOpenSearchConfigManager
public interface OpenSearchConfigManager
Configuration manager for OpenSearch settings.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIf enabled OpenSearch index will be refreshed on every write.List<org.apache.hc.core5.http.HttpHost> Gets the list of Apache HTTP hosts for OpenSearch cluster connections.org.apache.hc.core5.http.HttpHostGets the AWS OpenSearch Service host.Gets the AWS region for Amazon OpenSearch Service connections.intGets the connection timeout for OpenSearch HTTP connections.org.apache.hc.core5.http.HttpHostgetHttpHost(String url, String key) Creates anHttpHostobject from a URL string.intGets the maximum number of HTTP connections allowed per route.intGets the maximum total number of HTTP connections allowed.intGets the max result response buffer sizeGets the password for basic authentication with Apache HTTP transport.getPhysicalIndexName(String jiraIndexName) Gets the actual index name in OpenSearch for a given Jira index name.Gets the keep-alive duration for Point-in-Time (PIT) contexts.intGets the request connection timeout for OpenSearch HTTP connections.intGets the socket timeout for OpenSearch HTTP connections.intGets the batch size for streaming search results.Gets the username for authentication.booleanDetermines whether HTTP request compression is enabled for OpenSearch connections.booleanDetermines whether DFS query-then-fetch search type should be used.booleanConfigures the HTTP client to accept all SSL certificates for testing.
-
Method Details
-
isCompressionEnabled
boolean isCompressionEnabled()Determines whether HTTP request compression is enabled for OpenSearch connections.- Returns:
trueif compression is enabled,falseotherwise. Returns the default value if the property is not configured.
-
getUsername
Gets the username for authentication.- Returns:
- an
Optionalcontaining the username if configured, orOptional.empty()if not set
-
getPassword
Gets the password for basic authentication with Apache HTTP transport.- Returns:
- an
Optionalcontaining the password if configured, orOptional.empty()if not set
-
getAwsRegion
Gets the AWS region for Amazon OpenSearch Service connections.This is required when using AWS OpenSearch Service with request signing.
- Returns:
- an
Optionalcontaining the AWS region (e.g., "us-east-1") if configured, orOptional.empty()if not set
-
getApacheHosts
List<org.apache.hc.core5.http.HttpHost> getApacheHosts()Gets the list of Apache HTTP hosts for OpenSearch cluster connections.This method parses a comma-separated list of URLs from the configuration and returns them as
HttpHostobjects. This is used when connecting to OpenSearch via Apache HTTP transport.- Returns:
- a list of
HttpHostobjects representing the OpenSearch nodes - Throws:
NullPointerException- if the HTTP URL property is not configuredConfigParseException- if any URL is malformed
-
getAwsHost
org.apache.hc.core5.http.HttpHost getAwsHost()Gets the AWS OpenSearch Service host.This method returns a single host for AWS OpenSearch Service connections. Unlike
getApacheHosts(), this expects a single domain endpoint.- Returns:
- an
HttpHostobject representing the AWS OpenSearch domain - Throws:
NullPointerException- if the HTTP URL property is not configuredConfigParseException- if the URL is malformed
-
getHttpHost
Creates anHttpHostobject from a URL string.This utility method parses a URL string and creates an appropriate
HttpHostobject. It's used internally by other methods but exposed for flexibility.- Parameters:
url- the URL string to parse (e.g., "http://localhost:9200")key- the configuration property key, used for error messages- Returns:
- an
HttpHostobject representing the parsed URL - Throws:
ConfigParseException- if the URL is malformed
-
getConnectTimeout
int getConnectTimeout()Gets the connection timeout for OpenSearch HTTP connections.- Returns:
- the connection timeout in milliseconds
-
getRequestConnectTimeout
int getRequestConnectTimeout()Gets the request connection timeout for OpenSearch HTTP connections.- Returns:
- the request connection timeout in milliseconds
-
getSocketTimeout
int getSocketTimeout()Gets the socket timeout for OpenSearch HTTP connections.- Returns:
- the socket timeout in milliseconds
-
getMaxHttpConnectionTotal
int getMaxHttpConnectionTotal()Gets the maximum total number of HTTP connections allowed.- Returns:
- the maximum total number of HTTP connections
-
getMaxHttpConnectionPerRoute
int getMaxHttpConnectionPerRoute()Gets the maximum number of HTTP connections allowed per route.- Returns:
- the maximum number of HTTP connections per route
-
getStreamBatchSize
int getStreamBatchSize()Gets the batch size for streaming search results.- Returns:
- the stream batch size (number of documents per batch)
-
isDfsQueryThenFetch
boolean isDfsQueryThenFetch()Determines whether DFS query-then-fetch search type should be used.- Returns:
trueif DFS query-then-fetch should be used,falseotherwise
-
getPointInTimeKeepAlive
Duration getPointInTimeKeepAlive()Gets the keep-alive duration for Point-in-Time (PIT) contexts.- Returns:
- the PIT keep-alive duration
-
trustAllSsl
boolean trustAllSsl()Configures the HTTP client to accept all SSL certificates for testing. Dev mode must also be enabled.- Returns:
- true if all SSL certificates should be trusted, otherwise false
-
getPhysicalIndexName
Gets the actual index name in OpenSearch for a given Jira index name.- Parameters:
jiraIndexName- the logical Jira index name (e.g., "issues")- Returns:
- the actual OpenSearch index name (e.g., "jira-issues")
-
forceRefreshOnWrite
boolean forceRefreshOnWrite()If enabled OpenSearch index will be refreshed on every write. Otherwise, Jira will apply a more relaxed index consistency: read-your-writes consistency.CAUTION: enable this if you are having issues related to delayed consistency, but note that doing so would negatively impact write performance.
- Returns:
- true if force refresh is enabled, otherwise false
-
getMaxResultBuffer
int getMaxResultBuffer()Gets the max result response buffer size- Returns:
- the configured max result response buffer size
- Since:
- 11.3
-