Skip to content

Add Module API for version and compatibility checks#7865

Merged
oranagra merged 14 commits intoredis:unstablefrom
MeirShpilraien:issue_7801
Oct 11, 2020
Merged

Add Module API for version and compatibility checks#7865
oranagra merged 14 commits intoredis:unstablefrom
MeirShpilraien:issue_7801

Conversation

@MeirShpilraien
Copy link

  • Introduce a new API's: RM_GetContextFlagsAll, and
    RM_GetKeyspaceNotificationFlagsAll that will return the
    full flags mask of each feature. The module writer can
    check base on this value if the Flags he needs are
    supported or not.

  • For each flag, introduce a new value on redismodule.h,
    this value represents the LAST value and should be there
    as a reminder to update it when a new value is added,
    also it will be used in the code to calculate the full
    flags mask (assuming flags are incrementally increasing).
    In addition, stated that the module writer should not use
    the LAST flag directly and he should use the GetFlagAll API's.

  • Introduce a new API: RM_IsSubEventSupported, that returns for a given
    event and subevent, whether or not the subevent supported.

  • Introduce a new macro RMAPI_FUNC_SUPPORTED(func) that returns whether
    or not a function API is supported by comparing it to NULL.

  • Introduce a new API: int RM_GetServerVersion();, that will return the
    current Redis version in the format 0x00MMmmpp; e.g. 0x00060008;

  • Changed unstable version from 999.999.999 to 255.255.255

Please notice that flags of RM_HashGet, RM_HashSet, and RM_ZsetAdd are not handled in this PR and we should discuss how to handle those.

* Introduce a new API's: RM_GetContextFlagsAll, and
RM_GetKeyspaceNotificationFlagsAll that will return the
full flags mask of each feature. The module writer can
check base on this value if the Flags he needs are
supported or not.

* For each flag, introduce a new value on redismodule.h,
this value represents the LAST value and should be there
as a reminder to update it when a new value is added,
also it will be used in the code to calculate the full
flags mask (assuming flags are incrementally increasing).
In addition, stated that the module writer should not use
the LAST flag directly and he should use the GetFlagAll API's.

* Introduce a new API: RM_IsSubEventSupported, that returns for a given
event and subevent, whether or not the subevent supported.

* Introduce a new macro RMAPI_FUNC_SUPPORTED(func) that returns whether
or not a function API is supported by comparing it to NULL.

* Introduce a new API: int RM_GetServerVersion();, that will return the
current Redis version in the format 0x00MMmmpp; e.g. 0x00060008;

* Changed unstable version from 999.999.999 to 255.255.255
Meir Shpilraien (Spielrein) and others added 10 commits September 30, 2020 15:17
@MeirShpilraien
Copy link
Author

@oranagra I fixed all the comments except the version comments, let me know if it's fine and what to do about the version.

@oranagra oranagra linked an issue Oct 7, 2020 that may be closed by this pull request
oranagra
oranagra previously approved these changes Oct 7, 2020
@oranagra oranagra changed the title see #7801, Added the following RedisModuleAPI. Add Module API for version and compatibility checks Oct 7, 2020
@oranagra
Copy link
Member

oranagra commented Oct 7, 2020

@redis/core-team please approve

@oranagra oranagra added state:major-decision Requires core team consensus state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten labels Oct 7, 2020
itamarhaber
itamarhaber previously approved these changes Oct 7, 2020
@yossigo yossigo dismissed stale reviews from itamarhaber and oranagra via 6de204d October 11, 2020 13:01
yossigo
yossigo previously approved these changes Oct 11, 2020
oranagra
oranagra previously approved these changes Oct 11, 2020
@oranagra oranagra dismissed stale reviews from yossigo and themself via e39aecb October 11, 2020 14:13
@oranagra oranagra merged commit adc3183 into redis:unstable Oct 11, 2020
oranagra added a commit that referenced this pull request Oct 27, 2020
* Introduce a new API's: RM_GetContextFlagsAll, and
RM_GetKeyspaceNotificationFlagsAll that will return the
full flags mask of each feature. The module writer can
check base on this value if the Flags he needs are
supported or not.

* For each flag, introduce a new value on redismodule.h,
this value represents the LAST value and should be there
as a reminder to update it when a new value is added,
also it will be used in the code to calculate the full
flags mask (assuming flags are incrementally increasing).
In addition, stated that the module writer should not use
the LAST flag directly and he should use the GetFlagAll API's.

* Introduce a new API: RM_IsSubEventSupported, that returns for a given
event and subevent, whether or not the subevent supported.

* Introduce a new macro RMAPI_FUNC_SUPPORTED(func) that returns whether
or not a function API is supported by comparing it to NULL.

* Introduce a new API: int RM_GetServerVersion();, that will return the
current Redis version in the format 0x00MMmmpp; e.g. 0x00060008;

* Changed unstable version from 999.999.999 to 255.255.255

Co-authored-by: Oran Agra <[email protected]>
Co-authored-by: Yossi Gottlieb <[email protected]>
(cherry picked from commit adc3183)
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Nov 4, 2020
* Introduce a new API's: RM_GetContextFlagsAll, and
RM_GetKeyspaceNotificationFlagsAll that will return the
full flags mask of each feature. The module writer can
check base on this value if the Flags he needs are
supported or not.

* For each flag, introduce a new value on redismodule.h,
this value represents the LAST value and should be there
as a reminder to update it when a new value is added,
also it will be used in the code to calculate the full
flags mask (assuming flags are incrementally increasing).
In addition, stated that the module writer should not use
the LAST flag directly and he should use the GetFlagAll API's.

* Introduce a new API: RM_IsSubEventSupported, that returns for a given
event and subevent, whether or not the subevent supported.

* Introduce a new macro RMAPI_FUNC_SUPPORTED(func) that returns whether
or not a function API is supported by comparing it to NULL.

* Introduce a new API: int RM_GetServerVersion();, that will return the
current Redis version in the format 0x00MMmmpp; e.g. 0x00060008;

* Changed unstable version from 999.999.999 to 255.255.255

Co-authored-by: Oran Agra <[email protected]>
Co-authored-by: Yossi Gottlieb <[email protected]>
jschmieg pushed a commit to memKeyDB/memKeyDB that referenced this pull request Nov 6, 2020
* Introduce a new API's: RM_GetContextFlagsAll, and
RM_GetKeyspaceNotificationFlagsAll that will return the
full flags mask of each feature. The module writer can
check base on this value if the Flags he needs are
supported or not.

* For each flag, introduce a new value on redismodule.h,
this value represents the LAST value and should be there
as a reminder to update it when a new value is added,
also it will be used in the code to calculate the full
flags mask (assuming flags are incrementally increasing).
In addition, stated that the module writer should not use
the LAST flag directly and he should use the GetFlagAll API's.

* Introduce a new API: RM_IsSubEventSupported, that returns for a given
event and subevent, whether or not the subevent supported.

* Introduce a new macro RMAPI_FUNC_SUPPORTED(func) that returns whether
or not a function API is supported by comparing it to NULL.

* Introduce a new API: int RM_GetServerVersion();, that will return the
current Redis version in the format 0x00MMmmpp; e.g. 0x00060008;

* Changed unstable version from 999.999.999 to 255.255.255

Co-authored-by: Oran Agra <[email protected]>
Co-authored-by: Yossi Gottlieb <[email protected]>
(cherry picked from commit adc3183)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:major-decision Requires core team consensus state:to-be-merged The PR should be merged soon, even if not yet ready, this is used so that it won't be forgotten

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedisModuleAPI to check if flags are supported

4 participants