Entities are the basic units of information necessary in order for Helix to 
function. It's the "language" Helix speaks. If you look at ZooKeeper, this is 
what you would see.

Scopes are the levels at which things can be configured. That is to say, you 
can configure the entire cluster, a single resource, a participant, etc.

Roles are the way nodes are labeled in the system. Currently Helix nodes can 
have the following roles: Participant, Spectator, Controller, and 
Administrator. A single machine may take on multiple roles.

The purpose of the API is to sufficiently abstract the entities at appropriate 
scopes for each role.

When we started brainstorming APIs, we identified the following use cases: 
configuration, registration, state transitions, and rebalancing. Here is a take 
on what part of configuration and registration could look like:

Administrator admin = new ZKHelixAdministrator();
admin.connect();
ClusterConfig = new ClusterConfig().setName().setuserproperties();
admin.createCluster(clusterconfig);
StateModelDef def = new MasterSlaveModel();
ResourceConfig resourceConfig = new 
ResourceConfig(resourceId).withFSM(def).partitioned(24).replicated(3).withRebalancer(RebalancerConfig);
admin.addResource(resourceConfig);

//add Instances, we shud probably call this ParticipantConfig
ParticipantConfig instanceConfig = new ParticipantConfig();

// We can probably have controllerService that wraps controller -- this can 
help people who want to control which events trigger the pipeline

// not StandaloneController? no -- standalone means its only one controller, 
people think its not fault tolerant
SingleClusterController controller = new SingleClusterController();
controller.start();

// controls multiple clusters
MultiClusterController controller = new MultiClusterController();
controller.start();

Participant participant = new Participant();
ParticipantService service = new PartiticipantService(participant);
service.start(); // service has some callbacks init/start getListeners callback 
that will be called appropriately

Specator spectator = new Spectator();
SpecatorService service = new SpectatorService().watch(resource(s));
service.start(); //similar to participant gives a callback to get the listeners 
to be added

----------------------------------------
> Date: Sun, 23 Feb 2014 09:51:01 -0800
> Subject: Re: [DISCUSS] New Helix Api
> From: [email protected]
> To: [email protected]
>
> Hey guys,
>
> For the sake of the newcomer could you please define/describe what you
> mean by the following
>
> (a) Entity
> (b) Scope
>
> I have some thoughts on the entities etc but wanted to understand what
> their definitions are before I suggest something.
>
> Thanks,
>
> Sandeep
>
> On Sun, Feb 23, 2014 at 7:54 AM, kishore g <[email protected]> wrote:
>> Hi,
>>
>> Here are the entities, scopes and roles defined in Helix.
>> Entities
>> -- Idealstate
>> -- ExternalView
>> -- CurrentState
>> -- LiveInstance
>> -- HelixConfig
>> -- UserConfig
>> -- StateModelDefinition
>> -- Alerts
>>
>>
>> Scopes
>> -- Cluster
>> -- Participant/Group
>> -- Resource/Group
>> -- Partition
>> -- Transition
>>
>> Misc
>> -- One time read v/s cache v/s cache and update automatically on
>> notification
>>
>> ====================
>> HelixConfig
>> -- Cluster
>> -- Participant
>> -- Resource
>> -- Partition
>>
>> UserConfig
>> -- Cluster
>> -- Participant
>> -- Resource
>> -- Partition
>>
>> StateModelDefinition
>> -- States
>> -- Transitions
>> -- Constraints (Partition only)
>>
>>
>> Constraints
>> -- Cluster
>> -- Node
>> -- Resource
>> -- Partition
>> -- Resource/ResourceGroup
>>
>> Kanak and I did one pass on this and made some changes. Kanak, do you have
>> send across the changed version.
>>
>> We need to come up with the user facing api's that support simple CRUD on
>> these entities.
>>
>> thanks,
>> Kishore G                                      

Reply via email to