FlyDB icon indicating copy to clipboard operation
FlyDB copied to clipboard

feat: Implement DataStructureManager and internal structures for vari…

Open qishenonly opened this issue 7 months ago • 0 comments

This pull request introduces a unified data structure management system for the FlyDB project. It adds a DataStructureManager class to provide a single interface for managing multiple data structures, all sharing a single database instance. The changes also include the internal implementation of various data structure types that integrate with the shared database.

Unified Data Structure Management:

  • DataStructureManager Implementation: Added a new DataStructureManager class in structure/manager.go to manage multiple data structures (e.g., strings, hashes, lists, sets, sorted sets, bitmaps, streams) through a single database instance. It supports operations like key deletion, expiration, TTL retrieval, and syncing data to disk.
  • Initialization of Data Structures: The DataStructureManager initializes and provides access to internal implementations of supported data structures, ensuring they share the same database instance.

Internal Data Structure Implementations:

  • Internal Structure Classes: Added internal implementations for ListStructureInternal, SetStructureInternal, ZSetStructureInternal, BitmapStructureInternal, StreamStructureInternal, and ExpiringKeyInternal in structure/structures_internal.go. These classes are designed to work with the shared database instance.
  • Factory Methods: Each internal structure has a corresponding factory method (e.g., newListStructureInternal) to simplify their initialization with the shared database instance.

qishenonly avatar May 13 '25 10:05 qishenonly