-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Implement Index Garbage Collection
- Loading branch information
1 parent
5457c28
commit bbcb594
Showing
37 changed files
with
2,099 additions
and
31 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.github/scripts/admin-api/check-column-family-estimate-num-keys.sh
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -e | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
. "$SCRIPT_DIR/../util.sh" | ||
|
||
BASE="http://localhost:8080/fhir" | ||
COLUMN_FAMILY="$1" | ||
EXPECTED_ESTIMATE_NUM_KEYS="$2" | ||
ACTUAL_ESTIMATE_NUM_KEYS=$(curl -s "$BASE/__admin/dbs/index/column-families" | jq ".[] | select(.name == \"$COLUMN_FAMILY\").estimateNumKeys") | ||
|
||
test "estimate number of keys" "$ACTUAL_ESTIMATE_NUM_KEYS" "$EXPECTED_ESTIMATE_NUM_KEYS" |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash -e | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
. "$SCRIPT_DIR/../util.sh" | ||
|
||
BASE="http://localhost:8080/fhir" | ||
|
||
prune-job() { | ||
cat <<END | ||
{ | ||
"resourceType": "Task", | ||
"id": "PruneJobReadyExample", | ||
"meta": { | ||
"profile": [ | ||
"https://samply.github.io/blaze/fhir/StructureDefinition/PruneJob" | ||
] | ||
}, | ||
"input": [ | ||
{ | ||
"type": { | ||
"coding": [ | ||
{ | ||
"code": "t", | ||
"system": "https://samply.github.io/blaze/fhir/CodeSystem/PruneJobParameter", | ||
"display": "T" | ||
} | ||
] | ||
}, | ||
"valuePositiveInt": 2000 | ||
} | ||
], | ||
"code": { | ||
"coding": [ | ||
{ | ||
"code": "prune", | ||
"system": "https://samply.github.io/blaze/fhir/CodeSystem/JobType", | ||
"display": "Prune the Database" | ||
} | ||
] | ||
}, | ||
"status": "ready", | ||
"intent": "order", | ||
"authoredOn": "2024-10-15T15:01:00.000Z" | ||
} | ||
END | ||
} | ||
|
||
RESULT="$(curl -s -H 'Content-Type: application/fhir+json' -H 'Accept: application/fhir+json' -d "$(prune-job)" "$BASE/__admin/Task")" | ||
test "resource type" "$(echo "$RESULT" | jq -r .resourceType)" "Task" | ||
test "status" "$(echo "$RESULT" | jq -r .status)" "ready" | ||
|
||
sleep 2 | ||
|
||
ID="$(echo "$RESULT" | jq -r .id)" | ||
RESULT="$(curl -s -H 'Accept: application/fhir+json' "$BASE/__admin/Task/$ID")" | ||
test "resource type" "$(echo "$RESULT" | jq -r .resourceType)" "Task" | ||
test "status" "$(echo "$RESULT" | jq -r .status)" "completed" |
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
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
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
Oops, something went wrong.