Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-5337

Explore using enum pattern in WT

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: None
    • Labels:

      Description

      I saw in a lot of places in the code base, we switch based on the page type or table type and perform specific operations. I think enum pattern can help us remove most of these switch statements.

      What we need to do is to create enum for page and table and define function pointers in the enum.

      In this way, we can decide what enum we need to pass at the top level and the downstream code only need to call the functions defined in the enum, limiting the switch only at the top level.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-storage-engines Backlog - Storage Engines Team
            Reporter:
            chenhao.qu Chenhao Qu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: