-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
module commands to be marked as unstable and require clients to opt in #2766
Closed
Closed
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
3892f92
HSCAN VALUES support (v5)
sjpotter 54d2c0d
enable module commands to be marked as unstable and require clients t…
sjpotter 5806f68
update all search commands to v5 / unstable interface
sjpotter 0f2e8d5
update architecture to how we throw an error.
sjpotter f8a300f
revert changes needed for resp3 erroring with multi, as now handled b…
sjpotter 1c77ab0
bring all modules / all commands into v5
sjpotter f13f47a
leibele's type changing and cleaning up disabling of type mapping
sjpotter 5daf11b
move tuples to map to requiring simple string for map key
sjpotter a91dded
missed on removal of unstable flag
sjpotter 9baec20
reove ignoreTypeMapping per offline discussion
sjpotter 33adc6f
revert 2 buffer/simple string changes from experimentation
sjpotter 8e7f11c
make resp2/resp3 have same return value
sjpotter 465911e
cleanup
leibale f08e94f
nit
leibale 6e60233
address leibele's comments + more time series stuff I found in process
sjpotter 6c34d6b
more work on review comments
sjpotter d896b09
attempt to implement leibele's suggestion to clean up code
sjpotter 7327f5e
wip - changes of personal review
sjpotter 9a85b10
more cleanup
sjpotter f555c4d
add command/command info and xread/xreadgroup to v5 support
sjpotter 17e4dd5
update tests to actually work right
sjpotter 629e790
hscan values isn't part of 7.4
sjpotter 418f79e
add hash field expiration commands ported over from v4
sjpotter 9dde283
Merge remote-tracking branch 'upstream/v5' into v5-search-broken
sjpotter 4dea5cb
revert cluster broadcasting todo
sjpotter 4f74a86
update test.yaml to have 7.4
sjpotter f0af1eb
redo time series commands to work with resp3 correctly
sjpotter 4bee30f
unwrap json.type in resp3 from extra array
sjpotter 77592d2
add comment to json.type for what we are doing
sjpotter 60499fc
update time series for resp3 to work consistently
sjpotter 2ac0964
move bloom* info commands to not error out if map type mapping is used
sjpotter aef901e
tweak unstable search module flag name + add proper error message
sjpotter 60fd22c
have topk info retur a DoubleReply in resp3
sjpotter 4066097
fix xread/xreadgroup for map->array type mapping
sjpotter 2b2bbb5
handle xread/xreadgroup with typing.
sjpotter 9ac2ee8
redo resp2 "map" types to return Objects to be resp3 default compatible
sjpotter 0337343
adding "type mapping" to transformReply
sjpotter f3013f1
move all 'DoubleReply' in resp2 to new type mapping system
sjpotter 11bd5d2
fix bug + tests
sjpotter 142dfb4
change Buffer('a') to Syumbol() to force TypeError
sjpotter d42fd70
remove some (unnecessary) jsdoc
leibale 78f1de6
revert and comment out "connect, ready and end events" test
leibale 5676a72
use redis CE docker images for all tests without any rebuilding
sjpotter e57ca82
move info commands to discussed format
sjpotter bf8a93c
Merge remote-tracking branch 'origin/v5-search-broken' into v5-search…
sjpotter 52bd5c0
fix bloom info command update
sjpotter 3d0485b
fix cms.info test
sjpotter 9adac9d
rename unstableResp3SearchModule cofnig + xread/group support
sjpotter ea51f39
revert to be v4 compat for xread/xreadgroup
sjpotter 5202955
make versions only use latest release
sjpotter b4b67f6
Merge branch 'v5-search-broken' into change-testing
sjpotter 58f88b5
Merge pull request #1 from sjpotter/change-testing
sjpotter 8ad4171
run tests against PRs against v5 branch
sjpotter d0396e7
fixups for testing
sjpotter faa67f3
fix running docker with redis-stack
sjpotter 830d5db
attempt at fixing 1 github test issue
sjpotter fcdb1c0
fix hello test
sjpotter 7ead8e4
fix `TS.M[REV]RANGE[_WITHLABELS|_SELECTED_LABELS]` & `TS.MGET[_WITHLA…
leibale 68ca83b
fix time series
sjpotter 9e8c183
fix non profile search commands
sjpotter 3f65936
attempt to make ts info / info debug backwards cmmpatable
sjpotter 839e14b
update to handle 'warning' in profile data return
sjpotter 91ed69e
attempt to make test more reliable
sjpotter 2d18b36
fix hello test to test if modules is an array
sjpotter 31d61b8
clean up rejection fix for clientkill
sjpotter 25fdd32
fix ts.info/debug again to hopefully be cleaner
sjpotter 59a27cc
small cleanups
sjpotter bf11c35
more cleanup
sjpotter 1a5ac15
transformTuplesReply can be a BlobStringReply or SimpleStringReply
sjpotter 16950d0
update ft.info to actually work + with newest options
sjpotter e1b935c
small tweak for stopWords
sjpotter 1f346f8
Merge remote-tracking branch 'upstream/v5' into v5-search-broken
sjpotter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 +1,32 @@ | ||
import { RedisArgument, Command } from '@redis/client/dist/lib/RESP/types'; | ||
import { RedisArgument, Command, UnwrapReply, NullReply, NumberReply, TuplesToMapReply, Resp2Reply, SimpleStringReply, TypeMapping } from '@redis/client/dist/lib/RESP/types'; | ||
import { transformInfoV2Reply } from '.'; | ||
|
||
export type BfInfoReplyMap = TuplesToMapReply<[ | ||
[SimpleStringReply<'Capacity'>, NumberReply], | ||
[SimpleStringReply<'Size'>, NumberReply], | ||
[SimpleStringReply<'Number of filters'>, NumberReply], | ||
[SimpleStringReply<'Number of items inserted'>, NumberReply], | ||
[SimpleStringReply<'Expansion rate'>, NullReply | NumberReply] | ||
]>; | ||
|
||
export interface BfInfoReply { | ||
capacity: NumberReply; | ||
size: NumberReply; | ||
numberOfFilters: NumberReply; | ||
numberOfInsertedItems: NumberReply; | ||
expansionRate: NullReply | NumberReply; | ||
} | ||
|
||
export default { | ||
FIRST_KEY_INDEX: 1, | ||
IS_READ_ONLY: true, | ||
transformArguments(key: RedisArgument) { | ||
return ['BF.INFO', key]; | ||
}, | ||
// TODO | ||
transformReply: undefined as unknown as () => any | ||
transformReply: { | ||
2: (reply: UnwrapReply<Resp2Reply<BfInfoReplyMap>>, _, typeMapping?: TypeMapping): BfInfoReplyMap => { | ||
return transformInfoV2Reply<BfInfoReplyMap>(reply, typeMapping); | ||
}, | ||
3: undefined as unknown as () => BfInfoReplyMap | ||
} | ||
} as const satisfies Command; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,27 @@ | ||
import { RedisArgument, Command } from '@redis/client/dist/lib/RESP/types'; | ||
import { RedisArgument, Command, NumberReply, TuplesToMapReply, UnwrapReply, Resp2Reply, SimpleStringReply, TypeMapping } from '@redis/client/dist/lib/RESP/types'; | ||
import { transformInfoV2Reply } from '../bloom'; | ||
|
||
export type CfInfoReplyMap = TuplesToMapReply<[ | ||
[SimpleStringReply<'Size'>, NumberReply], | ||
[SimpleStringReply<'Number of buckets'>, NumberReply], | ||
[SimpleStringReply<'Number of filters'>, NumberReply], | ||
[SimpleStringReply<'Number of items inserted'>, NumberReply], | ||
[SimpleStringReply<'Number of items deleted'>, NumberReply], | ||
[SimpleStringReply<'Bucket size'>, NumberReply], | ||
[SimpleStringReply<'Expansion rate'>, NumberReply], | ||
[SimpleStringReply<'Max iterations'>, NumberReply] | ||
]>; | ||
|
||
export default { | ||
FIRST_KEY_INDEX: 1, | ||
IS_READ_ONLY: true, | ||
transformArguments(key: RedisArgument) { | ||
return ['CF.INFO', key]; | ||
}, | ||
// TODO | ||
// export type InfoRawReply = [ | ||
// _: string, | ||
// size: number, | ||
// _: string, | ||
// numberOfBuckets: number, | ||
// _: string, | ||
// numberOfFilters: number, | ||
// _: string, | ||
// numberOfInsertedItems: number, | ||
// _: string, | ||
// numberOfDeletedItems: number, | ||
// _: string, | ||
// bucketSize: number, | ||
// _: string, | ||
// expansionRate: number, | ||
// _: string, | ||
// maxIteration: number | ||
// ]; | ||
|
||
// export interface InfoReply { | ||
// size: number; | ||
// numberOfBuckets: number; | ||
// numberOfFilters: number; | ||
// numberOfInsertedItems: number; | ||
// numberOfDeletedItems: number; | ||
// bucketSize: number; | ||
// expansionRate: number; | ||
// maxIteration: number; | ||
// } | ||
|
||
// export function transformReply(reply: InfoRawReply): InfoReply { | ||
// return { | ||
// size: reply[1], | ||
// numberOfBuckets: reply[3], | ||
// numberOfFilters: reply[5], | ||
// numberOfInsertedItems: reply[7], | ||
// numberOfDeletedItems: reply[9], | ||
// bucketSize: reply[11], | ||
// expansionRate: reply[13], | ||
// maxIteration: reply[15] | ||
// }; | ||
// } | ||
transformReply: undefined as unknown as () => any | ||
transformReply: { | ||
2: (reply: UnwrapReply<Resp2Reply<CfInfoReplyMap>>, _, typeMapping?: TypeMapping): CfInfoReplyMap => { | ||
return transformInfoV2Reply<CfInfoReplyMap>(reply, typeMapping); | ||
}, | ||
3: undefined as unknown as () => CfInfoReplyMap | ||
} | ||
} as const satisfies Command; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/redis/node-redis/blob/v5/docs/v4-to-v5.md?plain=1#L238
#2506
I'm not sure if we should keep the keys as is for the sake of consistency or transform them for the sake of "friendly/javascripty"..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it says there "to avoid unneccessary transformations" (and confusion but I honestly don't think that is the case).
In this case a transformation is neccessary anyways, so might as well make it friendly. I also distinguish between "info" objects that are defined data structures, and generic maps that can contain any set of keys/values (as I'll discuss on the next one)