Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-2291

Associate user defined values with checkpoint

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.3
    • core
    • None

    Description

      For diagnosis, upgrade, migration, maintenance, etc. it would be useful if we could assign user specific properties to checkpoints. This could be used e.g. to record who added a checkpoint (i.e. backup, indexer, ....). This would simplify action taken for example on the checkpoint MBean as one could more easily tell various checkpoints apart.

      I therefore suggest to add the following methods to the NodeStore API:

      /**
       * Creates a new checkpoint of the latest root of the tree. The checkpoint
       * remains valid for at least as long as requested and allows that state
       * of the repository to be retrieved using the returned opaque string
       * reference.
       * <p>
       * The {@code properties} passed to this methods are associated with the
       * checkpoint and can be retrieved through the {@link #checkpointInfo(String)}
       * method. Its semantics is entirely application specific.
       *
       * @param lifetime time (in milliseconds, &gt; 0) that the checkpoint
       *                 should remain available
       * @param properties properties to associate with the checkpoint
       * @return string reference of this checkpoint
       */
      @Nonnull
      String checkpoint(long lifetime, Map<String, String> properties);
      
      /**
       * Retrieve the properties associated with a checkpoint.
       *
       * @param checkpoint string reference of a checkpoint
       * @return the properties associated with the checkpoint referenced by
       *         {@code checkpoint} or an empty map when there is no such
       *         checkpoint.
       */
      @Nonnull
      Map<String, String> checkpointInfo(String checkpoint);
      

      At the same time we should probably deprecate NodeStore#checkpoint(long) in favour or NodeStore#checkpoint(long, Map<String, String>) passing an empty map as its 2nd argument.

      Attachments

        Issue Links

          Activity

            People

              mduerig Michael Dürig
              mduerig Michael Dürig
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: