Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 4.0.0
    • Component/s: Client, Framework
    • Labels:
      None

      Description

      All of Curator's CRUD methods work with raw byte arrays. It would be nice to be able to use strongly type Models.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user Randgalt opened a pull request:

          https://github.com/apache/curator/pull/211

          [WIP] CURATOR-397 Strongly typed Model DSL

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/apache/curator CURATOR-397

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/curator/pull/211.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #211


          commit 2c0fca86ca3c25c9777e1b5c3bb3eea6cb0be8da
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T00:14:53Z

          interim work - updated APIs make sure old tests work

          commit afa8f7a45b1cc154317ac757d20340ce26b9cdab
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T00:19:05Z

          Merge branch 'CURATOR-3.0' into CURATOR-261

          commit 4c3c8377935f8ae2c0f24c4a1010cf4bdef4e297
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T00:22:10Z

          Merge branch 'CURATOR-3.0' into CURATOR-265

          Conflicts:
          curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java

          commit d42ef172e57af17ed42d7c2c4e2d9a7a0c520f3c
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T02:07:44Z

          wip - adding() API was misnamed. Also, it's mutually exclusive with join/leave

          commit 36ddd58a31045addfd9d984353956f7a99c09221
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T02:49:12Z

          finalized the changes and removed old classes

          commit e09388a5a7cc131643d685fd8efff64da15e168b
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T03:00:37Z

          missed a few

          commit a8ec17ece060484e0e6ce723568ed9505f6b82ef
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T03:05:43Z

          Fixed newMembers test

          commit 2ff89856d6ee2d373cf91bc1a3bd388890604373
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T04:59:47Z

          enforce single thread

          commit c1084663aa8991a06cc7390180d07cbaf6c330e1
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T14:15:54Z

          License header

          commit a7076bc8dd806bb824e33dcd2f8b5e53626b5691
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T15:03:20Z

          better test - shouldn't fail if slow

          commit 26364c6186fc7c09a9462557b1ca791e9aa70006
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T18:13:02Z

          1. EnsembleTracker should always be on, it now is
          2. Removed DynamicEnsembleProvider. This should not be optional. EnsembleTracker now always publishes config changes which will end up calling ZooKeeper.updateServerList()
          3. Testing

          commit 56d9ba665ef69944ef0ab9c65aa014b921fd39f9
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T18:59:35Z

          Added doc regarding EnsembleTracker

          commit 6e56e8ae9f04ffdd76505858dbbe5b1ff04dbd49
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T23:03:06Z

          ExhibitorEnsembleProvider is not compatible with updateServerList()

          commit 2827ba81b5c66ec4f864cc2e3582776e955158ac
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-26T23:07:10Z

          fixed compile error

          commit cb34e6f6a41b08c9d4e6179d9f893b0e48e7860c
          Author: randgalt <randgalt@apache.org>
          Date: 2015-09-27T18:31:32Z

          continued work on tests, etc.

          commit b89091e9363e760aa34028bcfb57baf6ca921957
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-02T14:37:13Z

          Support getting at the cached config from the ensemble tracker

          commit add56dc92e4564ce5d146a8f3c0a8ae51c6dc46f
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-02T22:22:48Z

          Support delete().quietly() and create().orSetData()

          commit 537156db46becd67542a653d6ab055168ed507d0
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-06T01:27:46Z

          for some reason, one of the constructors got messed up

          commit df949e7a27e370d0e7f8013a7c7b0469382d1a2f
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-06T13:23:41Z

          Merge branch 'master' into CURATOR-3.0

          commit 0fe4d969f86836ecfcf27ab1164c422e771d1495
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-09T00:09:13Z

          Merge branch 'CURATOR-3.0' into CURATOR-265

          commit 779ff5ea459ce8d60c92db1c3fde2966d1cc3e3a
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-09T00:11:56Z

          Merge branch 'CURATOR-3.0' into CURATOR-266

          Conflicts:
          curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java

          commit 198179ca8e6b08c49d786896b9d7fb83c3b78608
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-09T14:49:05Z

          make git tag HEAD

          commit 967faf123243b052ea01762ad55ace61ab39d15c
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-10T20:15:27Z

          remove calls to deprecated client.clearWatcherReferences()

          commit b25a8a35856abf9710d42fae0a7324fbe66c362d
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-10T20:15:50Z

          Trying to make tests more reliable

          commit 34700a0557672061ecc859b8b129e40b3f5c244e
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-10T21:49:06Z

          don't do work if client is closed

          commit 208317ab0110663745a5e8e76fd9a8bca634082e
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-10T21:49:33Z

          Trying to make tests more reliable

          commit ff3fbd759879e677f84b9628b1f2f4a91c3d521d
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-10T21:51:15Z

          Removed testChildReaperCleansUpLockNodes() as the Reaper is now deprecated

          commit a0cb3fa7fc5cfbfe6c596ff1b890864ed421fa92
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-11T15:44:38Z

          Remove retry logic. It doesn't work correctly anyway. Maybe revisit later

          commit b7cfbb64a10526a612f87a00f62e32d08b5da411
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-11T15:45:39Z

          Don't fail on unexpected event. It's not actually a failure

          commit 2fa711c5056741c39203cb77dda05773133bcf80
          Author: randgalt <randgalt@apache.org>
          Date: 2015-10-11T20:45:07Z

          PEM can generate delete or data change. Tests were only watching for delete


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user Randgalt opened a pull request: https://github.com/apache/curator/pull/211 [WIP] CURATOR-397 Strongly typed Model DSL You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/curator CURATOR-397 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/curator/pull/211.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #211 commit 2c0fca86ca3c25c9777e1b5c3bb3eea6cb0be8da Author: randgalt <randgalt@apache.org> Date: 2015-09-26T00:14:53Z interim work - updated APIs make sure old tests work commit afa8f7a45b1cc154317ac757d20340ce26b9cdab Author: randgalt <randgalt@apache.org> Date: 2015-09-26T00:19:05Z Merge branch ' CURATOR-3 .0' into CURATOR-261 commit 4c3c8377935f8ae2c0f24c4a1010cf4bdef4e297 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T00:22:10Z Merge branch ' CURATOR-3 .0' into CURATOR-265 Conflicts: curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java commit d42ef172e57af17ed42d7c2c4e2d9a7a0c520f3c Author: randgalt <randgalt@apache.org> Date: 2015-09-26T02:07:44Z wip - adding() API was misnamed. Also, it's mutually exclusive with join/leave commit 36ddd58a31045addfd9d984353956f7a99c09221 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T02:49:12Z finalized the changes and removed old classes commit e09388a5a7cc131643d685fd8efff64da15e168b Author: randgalt <randgalt@apache.org> Date: 2015-09-26T03:00:37Z missed a few commit a8ec17ece060484e0e6ce723568ed9505f6b82ef Author: randgalt <randgalt@apache.org> Date: 2015-09-26T03:05:43Z Fixed newMembers test commit 2ff89856d6ee2d373cf91bc1a3bd388890604373 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T04:59:47Z enforce single thread commit c1084663aa8991a06cc7390180d07cbaf6c330e1 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T14:15:54Z License header commit a7076bc8dd806bb824e33dcd2f8b5e53626b5691 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T15:03:20Z better test - shouldn't fail if slow commit 26364c6186fc7c09a9462557b1ca791e9aa70006 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T18:13:02Z 1. EnsembleTracker should always be on, it now is 2. Removed DynamicEnsembleProvider. This should not be optional. EnsembleTracker now always publishes config changes which will end up calling ZooKeeper.updateServerList() 3. Testing commit 56d9ba665ef69944ef0ab9c65aa014b921fd39f9 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T18:59:35Z Added doc regarding EnsembleTracker commit 6e56e8ae9f04ffdd76505858dbbe5b1ff04dbd49 Author: randgalt <randgalt@apache.org> Date: 2015-09-26T23:03:06Z ExhibitorEnsembleProvider is not compatible with updateServerList() commit 2827ba81b5c66ec4f864cc2e3582776e955158ac Author: randgalt <randgalt@apache.org> Date: 2015-09-26T23:07:10Z fixed compile error commit cb34e6f6a41b08c9d4e6179d9f893b0e48e7860c Author: randgalt <randgalt@apache.org> Date: 2015-09-27T18:31:32Z continued work on tests, etc. commit b89091e9363e760aa34028bcfb57baf6ca921957 Author: randgalt <randgalt@apache.org> Date: 2015-10-02T14:37:13Z Support getting at the cached config from the ensemble tracker commit add56dc92e4564ce5d146a8f3c0a8ae51c6dc46f Author: randgalt <randgalt@apache.org> Date: 2015-10-02T22:22:48Z Support delete().quietly() and create().orSetData() commit 537156db46becd67542a653d6ab055168ed507d0 Author: randgalt <randgalt@apache.org> Date: 2015-10-06T01:27:46Z for some reason, one of the constructors got messed up commit df949e7a27e370d0e7f8013a7c7b0469382d1a2f Author: randgalt <randgalt@apache.org> Date: 2015-10-06T13:23:41Z Merge branch 'master' into CURATOR-3 .0 commit 0fe4d969f86836ecfcf27ab1164c422e771d1495 Author: randgalt <randgalt@apache.org> Date: 2015-10-09T00:09:13Z Merge branch ' CURATOR-3 .0' into CURATOR-265 commit 779ff5ea459ce8d60c92db1c3fde2966d1cc3e3a Author: randgalt <randgalt@apache.org> Date: 2015-10-09T00:11:56Z Merge branch ' CURATOR-3 .0' into CURATOR-266 Conflicts: curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceFacade.java commit 198179ca8e6b08c49d786896b9d7fb83c3b78608 Author: randgalt <randgalt@apache.org> Date: 2015-10-09T14:49:05Z make git tag HEAD commit 967faf123243b052ea01762ad55ace61ab39d15c Author: randgalt <randgalt@apache.org> Date: 2015-10-10T20:15:27Z remove calls to deprecated client.clearWatcherReferences() commit b25a8a35856abf9710d42fae0a7324fbe66c362d Author: randgalt <randgalt@apache.org> Date: 2015-10-10T20:15:50Z Trying to make tests more reliable commit 34700a0557672061ecc859b8b129e40b3f5c244e Author: randgalt <randgalt@apache.org> Date: 2015-10-10T21:49:06Z don't do work if client is closed commit 208317ab0110663745a5e8e76fd9a8bca634082e Author: randgalt <randgalt@apache.org> Date: 2015-10-10T21:49:33Z Trying to make tests more reliable commit ff3fbd759879e677f84b9628b1f2f4a91c3d521d Author: randgalt <randgalt@apache.org> Date: 2015-10-10T21:51:15Z Removed testChildReaperCleansUpLockNodes() as the Reaper is now deprecated commit a0cb3fa7fc5cfbfe6c596ff1b890864ed421fa92 Author: randgalt <randgalt@apache.org> Date: 2015-10-11T15:44:38Z Remove retry logic. It doesn't work correctly anyway. Maybe revisit later commit b7cfbb64a10526a612f87a00f62e32d08b5da411 Author: randgalt <randgalt@apache.org> Date: 2015-10-11T15:45:39Z Don't fail on unexpected event. It's not actually a failure commit 2fa711c5056741c39203cb77dda05773133bcf80 Author: randgalt <randgalt@apache.org> Date: 2015-10-11T20:45:07Z PEM can generate delete or data change. Tests were only watching for delete
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Randgalt commented on the issue:

          https://github.com/apache/curator/pull/211

          This new feature allows code like this:

          ```java
          // let "client" be a CuratorFramework instance

          ZPath path = ZPath.parse(...); // whatever path you need
          JacksonModelSerializer<Person> serializer = JacksonModelSerializer.build(Person.class);
          ModeledAsyncCuratorFramework<MyModel> modeled = ModeledAsyncCuratorFramework.wrap(client, path, serializer);

          ...

          public void writePerson(String id, Person p)

          { modeled.at(id).create(p); // note this is an async operation }

          public void readPerson(String id, Consumer<Person> receiver) {
          modeled.at(id).read().whenComplete((person, exception) -> {
          if ( exception != null )

          { ... }

          else

          { receiver.accept(person); }

          });
          }
          ```

          Show
          githubbot ASF GitHub Bot added a comment - Github user Randgalt commented on the issue: https://github.com/apache/curator/pull/211 This new feature allows code like this: ```java // let "client" be a CuratorFramework instance ZPath path = ZPath.parse(...); // whatever path you need JacksonModelSerializer<Person> serializer = JacksonModelSerializer.build(Person.class); ModeledAsyncCuratorFramework<MyModel> modeled = ModeledAsyncCuratorFramework.wrap(client, path, serializer); ... public void writePerson(String id, Person p) { modeled.at(id).create(p); // note this is an async operation } public void readPerson(String id, Consumer<Person> receiver) { modeled.at(id).read().whenComplete((person, exception) -> { if ( exception != null ) { ... } else { receiver.accept(person); } }); } ```
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Randgalt commented on the issue:

          https://github.com/apache/curator/pull/211

          Note: I've also added wrappers so that `NodeCache`, `PathChildrenCache` and `TreeCache` can have modeled usages.

          Show
          githubbot ASF GitHub Bot added a comment - Github user Randgalt commented on the issue: https://github.com/apache/curator/pull/211 Note: I've also added wrappers so that `NodeCache`, `PathChildrenCache` and `TreeCache` can have modeled usages.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user jhalterman commented on the issue:

          https://github.com/apache/curator/pull/211

          This looks pretty sweet! My only comment is that this interface name is so long, ex: `ModeledAsyncCuratorFramework<MyModel>`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user jhalterman commented on the issue: https://github.com/apache/curator/pull/211 This looks pretty sweet! My only comment is that this interface name is so long, ex: `ModeledAsyncCuratorFramework<MyModel>`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user igor-kupczynski commented on the issue:

          https://github.com/apache/curator/pull/211

          Awesome stuff @Randgalt I'd love to see it integrated

          Show
          githubbot ASF GitHub Bot added a comment - Github user igor-kupczynski commented on the issue: https://github.com/apache/curator/pull/211 Awesome stuff @Randgalt I'd love to see it integrated
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Randgalt commented on the issue:

          https://github.com/apache/curator/pull/211

          merged

          Show
          githubbot ASF GitHub Bot added a comment - Github user Randgalt commented on the issue: https://github.com/apache/curator/pull/211 merged
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user Randgalt closed the pull request at:

          https://github.com/apache/curator/pull/211

          Show
          githubbot ASF GitHub Bot added a comment - Github user Randgalt closed the pull request at: https://github.com/apache/curator/pull/211
          Hide
          randgalt Jordan Zimmerman added a comment - - edited

          Reopening to fix a few mistakes and add a couple of improvements

          Show
          randgalt Jordan Zimmerman added a comment - - edited Reopening to fix a few mistakes and add a couple of improvements
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user Randgalt opened a pull request:

          https://github.com/apache/curator/pull/229

          A few things for CURATOR-397

          1. AsyncWrappers.asyncEnsureContainers was just wrong - this is a better implementation
          2. Added raw serializer constant
          3. Add ModeledOptions which can be expanded in the future. For now it just has ignoreMissingNodesForChildren

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/apache/curator CURATOR-397.2

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/curator/pull/229.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #229


          commit 11be719b32bcf8879c44a0c2005ba5a2107986cb
          Author: randgalt <randgalt@apache.org>
          Date: 2017-07-14T13:13:03Z

          A few things for CURATOR-397

          1. AsyncWrappers.asyncEnsureContainers was just wrong - this is a better implementation
          2. Added raw serializer constant
          3. Add ModeledOptions which can be expanded in the future. For now it just has ignoreMissingNodesForChildren


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user Randgalt opened a pull request: https://github.com/apache/curator/pull/229 A few things for CURATOR-397 1. AsyncWrappers.asyncEnsureContainers was just wrong - this is a better implementation 2. Added raw serializer constant 3. Add ModeledOptions which can be expanded in the future. For now it just has ignoreMissingNodesForChildren You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/curator CURATOR-397 .2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/curator/pull/229.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #229 commit 11be719b32bcf8879c44a0c2005ba5a2107986cb Author: randgalt <randgalt@apache.org> Date: 2017-07-14T13:13:03Z A few things for CURATOR-397 1. AsyncWrappers.asyncEnsureContainers was just wrong - this is a better implementation 2. Added raw serializer constant 3. Add ModeledOptions which can be expanded in the future. For now it just has ignoreMissingNodesForChildren
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/curator/pull/229

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/curator/pull/229

            People

            • Assignee:
              randgalt Jordan Zimmerman
              Reporter:
              randgalt Jordan Zimmerman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development