dev@shoal.java.net

Re: [Shoal-Dev] question about ViewWindow's views vector

From: Shreedhar Ganapathy <Shreedhar.Ganapathy_at_Sun.COM>
Date: Thu, 14 Feb 2008 15:35:00 -0800

Bongjae Chang wrote:
> Hi..
> I have another question about ViewWindow's view vector(views). :-)
> ---
> <ViewWindow.java>
> private int size = 100; // 100 is some default.
> private final List<ArrayList<GMSMember>> *views* = new
> Vector<ArrayList<GMSMember>>();
> ---
> I think Shoal mainly uses *views* for previous clustering view.
> ex) default recovery selection algorithm orwhether there is previous
> view or not
Yes. That is correct.
> *views* is Vector(default size is 100), so *views* can store a lot of
> view's history.
> My question is "why is *views* Vector? and why must views storemore
> than two history?".
No specific reason why its a Vector. It could be an ArrayList.
Early on, I wanted to expose a monitoring interface which would allow a
console to show the progression of last 100 views amonf other monitoring
information about a group or group member such as failure histories,
uptime, etc. This is particularly useful in large installations. We have
not gotten around to do it.
> And in SimpleSelectionAlgorithm(default algorithm), does previous
> clustering view need?
> ex) *views* vector has following members.
> --------------
> index | values
> 0| (A,B,C,D) <-- previous view
> 1| (A,C,D) <-- current view, B is failed
> --------------
> "C"will be selected from index 0
> but I think "C" can be selected fromindex 1 because we can already
> know Bwas failed.
Could you write a code snippet to do this? How will code looking only at
index 1 know that B's position was before C assuming we have no notion
of alphabetical or numerical ordering ? If there is a better way to do
this we should do it.
> please give me advice.
> thanks.
> --
> Bongjae Chang