This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
forked from redpanda-data/connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from trifork/feature/opensearch-cache
Feature/opensearch cache
- Loading branch information
Showing
3 changed files
with
73 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,85 @@ | ||
logger: | ||
level: VERBOSE | ||
|
||
pipeline: | ||
processors: | ||
- label: doclevel_cache | ||
cache: | ||
resource: opensearch_entiredoc | ||
operator: get | ||
key: "1" | ||
- label: fieldvalue_cache | ||
cache: | ||
resource: opensearch | ||
resource: opensearch_fieldvalue | ||
operator: get | ||
key: "1" | ||
- label: leveled_cache | ||
processors: | ||
- cache: | ||
resource: opensearch_entiredoc | ||
operator: get | ||
key: "1" | ||
- cache: | ||
resource: hot | ||
operator: get | ||
key: "1" | ||
- cached: | ||
key: "1" | ||
cache: hot | ||
processors: | ||
- mapping: throw("hot cache not found") | ||
|
||
cache_resources: | ||
- label: opensearch | ||
opensearch: | ||
- label: opensearch_entiredoc | ||
opensearch: | ||
urls: ["https://osproxy-saptest.cheetah.trifork.dev"] | ||
index: sap-salesorders_s4hanacloud | ||
key_field: SalesOrder | ||
value_field: "" # CreatedByUser | ||
basic_auth: | ||
enabled: true | ||
username: "apikey" | ||
password: "${OS_API_KEY}" | ||
username: ${USERNAME} | ||
password: ${PASSWORD} | ||
- label: opensearch_fieldvalue | ||
opensearch: | ||
urls: ["https://osproxy-saptest.cheetah.trifork.dev"] | ||
index: sap-salesorders_s4hanacloud | ||
key_field: SalesOrder | ||
value_field: "CreatedByUser" | ||
basic_auth: | ||
enabled: true | ||
username: ${USERNAME} | ||
password: ${PASSWORD} | ||
- label: leveled | ||
multilevel: [hot, opensearch_entiredoc] | ||
- label: hot | ||
memory: | ||
default_ttl: 60s | ||
|
||
tests: | ||
- name: Example test case doclevel_cache | ||
environment: {} | ||
target_processors: doclevel_cache #/pipeline/processors | ||
input_batch: | ||
- content: "ignored value" | ||
output_batches: | ||
- - json_contains: | ||
CreatedByUser: "CB9980000027" | ||
- name: Example test case fieldvalue_cache | ||
environment: {} | ||
target_processors: fieldvalue_cache #/pipeline/processors | ||
input_batch: | ||
- content: 'ignored value' | ||
- content: "ignored value" | ||
output_batches: | ||
- - content_equals: "CB9980000027" | ||
- name: Example test case leveled_cache | ||
environment: {} | ||
target_processors: leveled_cache #/pipeline/processors | ||
input_batch: | ||
- content: "ignored value" | ||
- content: "ignored value" | ||
output_batches: | ||
- - json_contains: | ||
CreatedByUser: 'CB9980000027' | ||
- - json_contains: | ||
CreatedByUser: "CB9980000027" | ||
- json_contains: | ||
CreatedByUser: "CB9980000027" |
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