|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface View
The Partitionable Group Membership Service contained in Jgroup
tracks changes in the group's composition and installs them as views
at member objects. Installated views are an abstraction of the
current environment with respect to failures and recoveries. Member
objects can obtain information about the current view through the
View
interface. Each view is uniquely identified by a
view identifier, that can be obtained by invoking method
getVid
. The composition of the view may be obtained by
invoking method getMembers
.
Method Summary | |
---|---|
java.lang.Object |
clone()
|
MemberId[] |
commonMembers(MemberId[] members)
Returns an array of MemberId s that are common to this
view and the provided member array. |
MemberId[] |
commonMembers(View view)
Returns an array of MemberId s that are common to this
view and the provided view. |
boolean |
contains(MemberId memberId)
Returns true if the given member is contained in the current view. |
boolean |
containsAll(View view)
Returns true if this view contains all members of the provided view. |
int |
getGid()
Returns the identifier of the group for which this view has been generated. |
MemberId |
getLeader()
Return the MemberId of the group leader (member in
position 0). |
int |
getMemberPosition(MemberId id)
Returns the position of the given member in this view. |
MemberId[] |
getMembers()
Returns an array of MemberId s identifying the members
included in this view. |
long |
getVid()
Returns the identifier of this view. |
boolean |
hasSameMembers(View prevView)
Returns true if this view has exactly the same members are the provided view. |
boolean |
isLeader(MemberId member)
Returns true if the given member is the group leader. |
boolean |
memberHasPosition(int pos,
MemberId member)
Returns true if the specified member is the member at the given position; otherwise false is returned. |
int |
mergingViews()
Returns the number of views (or partitions) merging into this view. |
MemberId[] |
newMembers(View previousView)
Returns an array of MemberId s that are new to this
view; that is they were not in the previous view. |
MemberId[] |
oldMembers(View previousView)
Returns an array of MemberId s that are not longer
part of this view; that is they were members of the previous view
but are no longer members of the this view. |
int |
size()
Returns the number of members in this view. |
Methods inherited from interface java.io.Externalizable |
---|
readExternal, writeExternal |
Method Detail |
---|
int getGid()
long getVid()
int mergingViews()
MemberId[] getMembers()
MemberId
s identifying the members
included in this view.
MemberId getLeader()
MemberId
of the group leader (member in
position 0).
boolean isLeader(MemberId member)
MemberId[] commonMembers(MemberId[] members)
MemberId
s that are common to this
view and the provided member array.
MemberId[] commonMembers(View view)
MemberId
s that are common to this
view and the provided view.
MemberId[] newMembers(View previousView)
MemberId
s that are new to this
view; that is they were not in the previous view.
MemberId[] oldMembers(View previousView)
MemberId
s that are not longer
part of this view; that is they were members of the previous view
but are no longer members of the this view.
boolean contains(MemberId memberId)
boolean containsAll(View view)
This is useful for checking if a new view is a contraction of the previous view, or if there are new members.
boolean hasSameMembers(View prevView)
Note that this is different from using Object.equals()
, since
this method will not check that the view identifiers are the same.
int size()
int getMemberPosition(MemberId id)
boolean memberHasPosition(int pos, MemberId member)
pos
- The position in the view to check for equality with the given
member. A negative position value is considered to indicate
a position from the end of the view array, while a positive
value indicate a position from the beginning of the view
array. A position value outside the range of the view, will
always return false.member
- The member whose position to check.
java.lang.Object clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |