• Moti Cohen's avatar
    Support HSET+expire in one command, at infra level (#13230) · c33c91db
    Moti Cohen authored
    Unify infra of `HSETF`, `HEXPIRE`, `HSET` and provide API for RDB load
    as well. Whereas setting plain fields is rather straightforward, setting
    expiration time to fields might be time-consuming and complex since each 
    update of expiration time, not only updates `ebuckets` of corresponding hash, 
    but also might update `ebuckets` of global HFE DS. It is required to opt 
    sequence of field updates with expirartion for a given hash, such that only once
    done, the global HFE DS will get updated.
    
    To do so, follow the scheme:
    1. Call `hashTypeSetExInit()` to initialize the HashTypeSetEx struct.
    2. Call `hashTypeSetEx()` one time or more, for each field/expiration update.
    3. Call `hashTypeSetExDone()` for notification and update of global HFE.
    
    If expiration is not required, then avoid this API and use instead hashTypeSet().
    c33c91db
ebuckets.h 14.7 KB