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

cursor close methods shouldn't take configuration argument

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: WT1.0
    • Component/s: None
    • Labels:

      Description

      1. No other cursor method takes a configuration argument, so this complicates the API (I think we did it that way because BDB did it that way, clearing statistics is a flag to the DB_ENV->stat_print).
      2. The only configuration value we ever pass to cursor close is "clear", for statistics cursors, which is a fairly rare case.
      3. A reasonable argument to make is that you don't want to clear all the cursors, it's reasonable to only want to clear one, or a handful of cursors (especially if extensions are adding their own statistics, so it's reasonable an API might not even know what statistics it is clearing).

      I suggest we replace the cursor.close clear argument with the ability to set a statistic cursor's value using the standard cursor set_key, set_value and update methods (returning EPERM on update for read-only values).

      The only loss is a short-hand for clearing all the statistics values, if you really want to clear all the statistics, you'll need to write the loop to do it manually. First, clearing the statistics isn't a common operation, it's unclear we need a short-hand for the operation, second, it's arguable that clearing all the statistics is the wrong interface, anyway.

      Michael, I'm assigning this to you since it's an API change – if you agree, toss it back to me and I'll do the change.

        Attachments

          Activity

            People

            Assignee:
            michael.cahill Michael Cahill
            Reporter:
            keith.bostic Keith Bostic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: