helix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kishore g <g.kish...@gmail.com>
Subject Re: Helix 0.6.2: State Model question
Date Wed, 19 Feb 2014 19:17:35 GMT
Regarding state models, you can define state model at a Resource level. You
can use a resource to model a Node, Instance or any Task. For example,

You can define a state model for a node as ServiceStateModel
OFFLINE->BOOTSTRAP->ONLINE. This need not be partitioned. Every node that
comes up can always go through these phases.

Lets say you want to assign tasks to these nodes. You can define another
taskStateModel with states like start, stop, pause, resume, cancel etc. The
task can be partitioned and allocated to various nodes in the cluster. Each
task undergoes these transitions.

The constraints can be placed on states and transitions at various scopes
like partition, resource, node, cluster.

Regaring controller deployment modes take a look at this.
http://helix.apache.org/0.6.2-incubating-docs/tutorial_controller.html.
CONTROLLER_PARTICIPANT is used to achieve CONTROLLER_AS_SERVICE model.

At LinkedIn, we have large number of clusters. Instead of having one set of
controllers  per cluster, we have only one set of controller nodes that
manage all the clusters. These set of controller are called
CONTROLLER_PARTICIPANT. They join a cluster called as SUPER_CLUSTER.  Lets
see we add a new cluster C1, we simply add C1 as a resource to
SUPER_CLUSTER and one of the controller will start managing C1. Hope this
helps.

Here is the general guideline,

(only one/few clusters) ? ( (<100 nodes) ? [embedded in your participants]
: [standalone] ) :  [controller as a service];


thanks,
Kishore G


On Wed, Feb 19, 2014 at 10:58 AM, Kanak Biscuitwala <kanak.b@hotmail.com>wrote:

> The methods in StateModel subclasses are invoked by reflection, generating
> names from the state transition message. You have two options here: naming
> your method as in the example per state transition, or by using the
> @Transition(from="FROMSTATE", to="TOSTATE") annotation.
>
> A controller participant is confusingly named. The idea is that if you
> have multiple clusters, we want to have a set of controllers manage all of
> them. So we have a cluster of controllers as participants where the
> resources are other clusters that the controllers should manage. This is
> the "distributed" controller mode.
>
> Kanak
> ________________________________
> > Date: Wed, 19 Feb 2014 10:54:21 -0800
> > Subject: Helix 0.6.2: State Model question
> > From: osgigeek@gmail.com
> > To: user@helix.apache.org
> >
> > I am looking at Quickstart.java in helix/examples. I see there are two
> > state models need to be defined
> >
> > (1) Instance state model which defines the transitions for nodes in the
> > cluster
> > (2) Node state model which listens to transitions occurring on a given
> node.
> >
> > I looked at the MasterSlaveStateModel and notice APIs in there like
> >
> > onBecomeSlaveFromOffline(Message message, NotificationContext context)
> >
> > they are not available on the base StateModel class.
> >
> > Are these callbacks assumed to be defined on the extension of the
> > StateModel which is registered? Does the reporting mechanism infer
> > these methods based on the state-transitions defined in (1) above?
> >
> > The other question is can I simply have one node registered as
> > InstanceType.CONTROLLER_PARTICIPANT? Would I use that type if I were to
> > build a peer-peer network?
> >
> > Thanks,
> >
> > Sandeep
>

Mime
View raw message