Package org.jgroups

Examples of org.jgroups.ViewId



   public FLUSH()
   {
      super();     
      currentView = new View(new ViewId(), new Vector());
      flushOkSet = new TreeSet();
      flushCompletedSet = new TreeSet();
      stopFlushOkSet = new TreeSet();
      flushMembers = new ArrayList();
      suspected = new TreeSet();     
View Full Code Here


   public void stop()
   {
      synchronized (sharedLock)
      {
         currentView = new View(new ViewId(), new Vector());
         flushCompletedSet.clear();
         flushOkSet.clear();
         stopFlushOkSet.clear();
         flushMembers.clear();
         suspected.clear();
View Full Code Here

   private long currentViewId()
   {
      long viewId = -1;
      synchronized (sharedLock)
      {
         ViewId view = currentView.getVid();
         if (view != null)
         {
            viewId = view.getId();
         }
      }
      return viewId;
   }
View Full Code Here

                            "cannot become coordinator (disable_initial_coord=" + gms.disable_initial_coord +
                            "), will retry fetching the initial membership");
                    continue;
                }
                joined=true;
                gms.view_id=new ViewId(mbr);       // create singleton view with mbr as only member
                gms.mbrs.add(mbr);
                view_evt=new Event(Event.VIEW_CHANGE,
                                   GMS.makeView(gms.mbrs.getMembers(), gms.view_id));
                gms.passDown(view_evt);
                gms.passUp(view_evt);
View Full Code Here

                if(!response.isServer())
                    continue;
                View view=response.getView();
                if(view == null)
                    continue;
                ViewId vid=view.getVid();
                if(!containsViewId(ret, vid))
                    ret.add(view);
            }
            return ret;
        }
View Full Code Here

       


        boolean containsViewId(Collection<View> views, ViewId vid) {
            for(View view: views) {
                ViewId tmp=view.getVid();
                if(Util.sameViewId(vid, tmp))
                    return true;
            }
            return false;
        }
View Full Code Here

        public List<View> detectDifferentViews(Map<Address,View> map) {
            final List<View> ret=new ArrayList<View>();
            for(View view: map.values()) {
                if(view == null)
                    continue;
                ViewId vid=view.getVid();
                if(!Util.containsViewId(ret, vid))
                    ret.add(view);
            }
            return ret;
        }
View Full Code Here

        public List<View> detectDifferentViews(Map<Address,View> map) {
            final List<View> ret=new ArrayList<View>();
            for(View view: map.values()) {
                if(view == null)
                    continue;
                ViewId vid=view.getVid();
                if(!Util.containsViewId(ret, vid))
                    ret.add(view);
            }
            return ret;
        }
View Full Code Here

public class ViewIdTest {
    private ViewId v1, v2, v3, v4;

    @BeforeClass
    void setUp() throws UnknownHostException {
        v1=new ViewId(Util.createRandomAddress("A"), 22);
        v2=new ViewId(Util.createRandomAddress("B"), 21);
        v3=v1.copy();
        v4=new ViewId(Util.createRandomAddress("C"), 22);
    }
View Full Code Here

        assert v1.equals(v3) : "v1 and v3 should be the same view";
    }


    public void testCopy() {
        ViewId tmp=v1.copy();
        assert v1.equals(tmp);
    }
View Full Code Here

TOP

Related Classes of org.jgroups.ViewId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.