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=helix-examples/src/main/java/org/apache/helix/examples/NewModelExample.java;h=804df10aff12150af07742f1210cd9f12a432d94;hb=helix-logical-model > > Thanks, > Kanak
