I agree with the transition comment. There's currently 2 ways to construct a transition and that one is more for backwards compatibility.
Compare and swap is certainly a possibility. There's obviously some starvation-related issues with that and the ability to express a delta is pretty valuable to get around that issue, though. I'll think about it some more. There are a number of "atomic" operations and behavior left to design. Some ways to do this include versioning and locking. I will work on safe versions of all these admin operations and will send out a separate email. Kanak On 10/2/13 1:35 PM, "kishore g" <[email protected]> wrote: >Thanks Kanak, it looks very nice. I created a gist on github so that its >easier to read. > >https://gist.github.com/kishoreg/85709d2e0dba9c893e92 > > >clusterBuilder.addTransitionConstraint(Scope.resource(resource.getId()), > lockUnlock.getStateModelDefId(), >Transition.from("RELEASED-LOCKED"), 1); > > >Can we avoid having to parse the transition. Should we not construct >Transition using two state instances (to and from) > > >userConfig.setMapField("sampleMap", mapField); > ResourceConfig.Delta delta = > new >ResourceConfig.Delta(resource.getId()).setUserConfig(userConfig); > accessor.updateResource(resource.getId(), delta); > >How can we guarantee that underlying config is not updated by some one >else. Can we instead have a compare and set api? something like >currConfig = accessor.read();//return immutable table > >newConfig = doSomething(currConfig); >boolean true = accessor.compareAndSet(currConfig,newConfig); > > >thanks, >Kishore G > >On Wed, Oct 2, 2013 at 9:57 AM, Kanak Biscuitwala ><[email protected]>wrote: > >> Hi, >> >> We've been working on some new APIs related to admin-type operations, as >> well as getting a cluster snapshot. I would really appreciate any >>feedback >> you have on the flow in the class below. >> >> >> >>https://git-wip-us.apache.org/repos/asf?p=incubator-helix.git;a=blob;f=he >>lix-examples/src/main/java/org/apache/helix/examples/NewModelExample.java >>;h=804df10aff12150af07742f1210cd9f12a432d94;hb=helix-logical-model >> >> Thanks, >> Kanak
