Skip to content

Commit

Permalink
Merge branch 'hkhalid/etag-impl' of https://github.com/hamdaankhalid/…
Browse files Browse the repository at this point in the history
…garnet into hkhalid/etag-impl
  • Loading branch information
hamdaankhalidmsft committed Dec 17, 2024
2 parents ddf63ca + fd062d8 commit 2e2c6b1
Show file tree
Hide file tree
Showing 21 changed files with 1,409 additions and 11 deletions.
47 changes: 42 additions & 5 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
branches:
- main
paths:
- 'charts/**'
- 'charts/*/Chart.yaml'

permissions:
contents: write
packages: write
pull-requests: write

jobs:
helm-chart:
Expand All @@ -22,35 +24,70 @@ jobs:

- name: Configure git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Install helm
uses: azure/setup-helm@v4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Install helm-docs
env:
HELM_DOCS_VERSION: "1.14.2"
run: |
cd /tmp
wget https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
tar -xvf helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
sudo mv helm-docs /usr/local/bin
- name: Set helm chart appVersion from Version.props
run: |
export VERSION_PROPS=$(awk -F'[<>]' '/VersionPrefix/{print $3}' Version.props)
sed -i -e 's#Version.props#"'${VERSION_PROPS}'"#g' charts/garnet/Chart.yaml
- name: Helm lint and package
- name: Helm lint, helm-docs and helm package
run: |
mkdir .cr-release-packages
for chart in $(find charts -mindepth 1 -maxdepth 1 -type d); do
if [ -z "${chart:-}" ]; then
break
fi
helm lint "${chart}"
helm-docs --document-dependency-values --chart-search-root "${chart}"
helm package "${chart}" --dependency-update --destination .cr-release-packages
done
- name: Discard changes on the charts/garnet/Chart.yaml file
run: |
git checkout -- charts/garnet/Chart.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
add-paths: charts/garnet/README.md
token: ${{ secrets.GITHUB_TOKEN }}
committer: github-actions[bot] <${{ github.actor }}@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: helm-docs-gen
delete-branch: true
title: '[helm-chart] Update charts/garnet/README.md by helm-docs'
body: |
- Update charts/garnet/README.md
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
helm-chart
automated pr
- name: Login to GHCR
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
echo "$GITHUB_TOKEN" | helm registry login ghcr.io --username "$GITHUB_ACTOR" --password-stdin
echo "${GITHUB_TOKEN}" | helm registry login ghcr.io --username "${GITHUB_ACTOR}" --password-stdin
- name: Push charts to GHCR
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,6 @@ test/tmp/

# BenchmarkDotNet Results
BenchmarkDotNet.Artifacts/

# Helm chart artifacts
.cr-release-packages/
168 changes: 168 additions & 0 deletions libs/resources/RespCommandsDocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5817,6 +5817,174 @@
}
]
},
{
"Command": "ZINTER",
"Name": "ZINTER",
"Summary": "Returns the intersect of multiple sorted sets.",
"Group": "SortedSet",
"Complexity": "O(N*K)\u002BO(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.",
"Arguments": [
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "NUMKEYS",
"DisplayText": "numkeys",
"Type": "Integer"
},
{
"TypeDiscriminator": "RespCommandKeyArgument",
"Name": "KEY",
"DisplayText": "key",
"Type": "Key",
"ArgumentFlags": "Multiple",
"KeySpecIndex": 0
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "WEIGHT",
"DisplayText": "weight",
"Type": "Integer",
"Token": "WEIGHTS",
"ArgumentFlags": "Optional, Multiple"
},
{
"TypeDiscriminator": "RespCommandContainerArgument",
"Name": "AGGREGATE",
"Type": "OneOf",
"Token": "AGGREGATE",
"ArgumentFlags": "Optional",
"Arguments": [
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "SUM",
"DisplayText": "sum",
"Type": "PureToken",
"Token": "SUM"
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "MIN",
"DisplayText": "min",
"Type": "PureToken",
"Token": "MIN"
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "MAX",
"DisplayText": "max",
"Type": "PureToken",
"Token": "MAX"
}
]
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "WITHSCORES",
"DisplayText": "withscores",
"Type": "PureToken",
"Token": "WITHSCORES",
"ArgumentFlags": "Optional"
}
]
},
{
"Command": "ZINTERCARD",
"Name": "ZINTERCARD",
"Summary": "Returns the number of members of the intersect of multiple sorted sets.",
"Group": "SortedSet",
"Complexity": "O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets.",
"Arguments": [
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "NUMKEYS",
"DisplayText": "numkeys",
"Type": "Integer"
},
{
"TypeDiscriminator": "RespCommandKeyArgument",
"Name": "KEY",
"DisplayText": "key",
"Type": "Key",
"ArgumentFlags": "Multiple",
"KeySpecIndex": 0
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "LIMIT",
"DisplayText": "limit",
"Type": "Integer",
"Token": "LIMIT",
"ArgumentFlags": "Optional"
}
]
},
{
"Command": "ZINTERSTORE",
"Name": "ZINTERSTORE",
"Summary": "Stores the intersect of multiple sorted sets in a key.",
"Group": "SortedSet",
"Complexity": "O(N*K)\u002BO(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set.",
"Arguments": [
{
"TypeDiscriminator": "RespCommandKeyArgument",
"Name": "DESTINATION",
"DisplayText": "destination",
"Type": "Key",
"KeySpecIndex": 0
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "NUMKEYS",
"DisplayText": "numkeys",
"Type": "Integer"
},
{
"TypeDiscriminator": "RespCommandKeyArgument",
"Name": "KEY",
"DisplayText": "key",
"Type": "Key",
"ArgumentFlags": "Multiple",
"KeySpecIndex": 1
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "WEIGHT",
"DisplayText": "weight",
"Type": "Integer",
"Token": "WEIGHTS",
"ArgumentFlags": "Optional, Multiple"
},
{
"TypeDiscriminator": "RespCommandContainerArgument",
"Name": "AGGREGATE",
"Type": "OneOf",
"Token": "AGGREGATE",
"ArgumentFlags": "Optional",
"Arguments": [
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "SUM",
"DisplayText": "sum",
"Type": "PureToken",
"Token": "SUM"
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "MIN",
"DisplayText": "min",
"Type": "PureToken",
"Token": "MIN"
},
{
"TypeDiscriminator": "RespCommandBasicArgument",
"Name": "MAX",
"DisplayText": "max",
"Type": "PureToken",
"Token": "MAX"
}
]
}
]
},
{
"Command": "ZLEXCOUNT",
"Name": "ZLEXCOUNT",
Expand Down
82 changes: 82 additions & 0 deletions libs/resources/RespCommandsInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4340,6 +4340,88 @@
}
]
},
{
"Command": "ZINTER",
"Name": "ZINTER",
"Arity": -3,
"Flags": "MovableKeys, ReadOnly",
"AclCategories": "Read, SortedSet, Slow",
"KeySpecifications": [
{
"BeginSearch": {
"TypeDiscriminator": "BeginSearchIndex",
"Index": 1
},
"FindKeys": {
"TypeDiscriminator": "FindKeysKeyNum",
"KeyNumIdx": 0,
"FirstKey": 1,
"KeyStep": 1
},
"Flags": "RO, Access"
}
]
},
{
"Command": "ZINTERCARD",
"Name": "ZINTERCARD",
"Arity": -3,
"Flags": "MovableKeys, ReadOnly",
"AclCategories": "Read, SortedSet, Slow",
"KeySpecifications": [
{
"BeginSearch": {
"TypeDiscriminator": "BeginSearchIndex",
"Index": 1
},
"FindKeys": {
"TypeDiscriminator": "FindKeysKeyNum",
"KeyNumIdx": 0,
"FirstKey": 1,
"KeyStep": 1
},
"Flags": "RO, Access"
}
]
},
{
"Command": "ZINTERSTORE",
"Name": "ZINTERSTORE",
"Arity": -4,
"Flags": "DenyOom, MovableKeys, Write",
"FirstKey": 1,
"LastKey": 1,
"Step": 1,
"AclCategories": "SortedSet, Slow, Write",
"KeySpecifications": [
{
"BeginSearch": {
"TypeDiscriminator": "BeginSearchIndex",
"Index": 1
},
"FindKeys": {
"TypeDiscriminator": "FindKeysRange",
"LastKey": 0,
"KeyStep": 1,
"Limit": 0
},
"Flags": "OW, Update"
},
{
"BeginSearch": {
"TypeDiscriminator": "BeginSearchIndex",
"Index": 2
},
"FindKeys": {
"TypeDiscriminator": "FindKeysKeyNum",
"KeyNumIdx": 0,
"FirstKey": 1,
"KeyStep": 1
},
"Flags": "RO, Access"
}
]
},
{
"Command": "ZLEXCOUNT",
"Name": "ZLEXCOUNT",
Expand Down
12 changes: 12 additions & 0 deletions libs/server/API/GarnetApiObjectCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ public GarnetStatus SortedSetDifferenceStore(ArgSlice destinationKey, ReadOnlySp
public GarnetStatus SortedSetScan(ArgSlice key, long cursor, string match, int count, out ArgSlice[] items)
=> storageSession.ObjectScan(GarnetObjectType.SortedSet, key, cursor, match, count, out items, ref objectContext);

/// <inheritdoc />
public GarnetStatus SortedSetIntersect(ReadOnlySpan<ArgSlice> keys, double[] weights, SortedSetAggregateType aggregateType, out Dictionary<byte[], double> pairs)
=> storageSession.SortedSetIntersect(keys, weights, aggregateType, out pairs);

/// <inheritdoc />
public GarnetStatus SortedSetIntersectLength(ReadOnlySpan<ArgSlice> keys, int? limit, out int count)
=> storageSession.SortedSetIntersectLength(keys, limit, out count);

/// <inheritdoc />
public GarnetStatus SortedSetIntersectStore(ArgSlice destinationKey, ReadOnlySpan<ArgSlice> keys, double[] weights, SortedSetAggregateType aggregateType, out int count)
=> storageSession.SortedSetIntersectStore(destinationKey, keys, weights, aggregateType, out count);

#endregion

#region Geospatial commands
Expand Down
Loading

0 comments on commit 2e2c6b1

Please sign in to comment.