亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stable.java

?? JGRoups源碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
// $Id: STABLE.java,v 1.11 2005/08/11 12:43:47 belaban Exp $package org.jgroups.protocols;import org.jgroups.*;import org.jgroups.blocks.GroupRequest;import org.jgroups.blocks.MethodCall;import org.jgroups.stack.RpcProtocol;import org.jgroups.util.TimeScheduler;import org.jgroups.util.Util;import java.util.Properties;import java.util.Vector;/** * Computes the broadcast messages that are stable; i.e., that have been received * by all members. Sends STABLE events up the stack when this is the case. * Uses a probabilistic scheme to do so, as described in:<br> * GSGC: An Efficient Gossip-Style Garbage Collection Scheme for Scalable * Reliable Multicast, K. Guo et al., 1997. * <p> * The only difference is that instead of using counters for an estimation of * messages received from each member, we retrieve this actual information * from the NAKACK layer (which must be present for the STABLE protocol to * work). * <p> * Note: the the <tt>Event.MSG</tt> call path path must be as lightweight as * possible. It should not request any lock for which there is a high * contention and/or long delay. * <p> * <pre> * Changes(igeorg - 2.VI.2001): * i. Thread-safety (in RPC calls most notably on the lines of Gianluca * Collot's bugfix) * ii. All slow calls (RPCs, seqnos requests, etc.) placed outside locks * iii. Removed redundant initialization in adaptation to a higher round * iv. heard_from[this meber] is always set to true on every new round * (i.e. on every stability bcast). * v. Replaced gossip thread with <tt>TimeScheduler.Task</tt> * </pre> * <p> * [[[ TODO(igeorg - 2.VI.2001) * i. Faster stability convergence by better selection of gossip subsets * (replace Util.pickSubset()). * ii. Special mutex on the <tt>Event.MSG</tt> call path. I.e. remove * <tt>synchronized(this)</t>> with e.g. <tt>synchronized(msg_mutex)</tt>. * ]] TODO */public class STABLE extends RpcProtocol {    /** The protocol name */    private static final String PROT_NAME="STABLE";    /** Default subgroup size for gossiping expressed as percentage overthe group's size */    private static final double SUBSET_SIZE=0.1;    /** Default max number of msgs to wait for before sending gossip */    private static final int GOSSIP_MSG_INTERVAL=100;    /** Default max time to wait before sending gossip (ms) */    private static final int GOSSIP_INTERVAL=10000;    private Address local_addr=null;    private ViewId vid=null;    private final Vector mbrs=new Vector(11);    /** gossip round */    private long round=1;    /** highest seqno received for each member (corresponds to membership) */    private long[] seqnos=new long[0];    /** Array of members from which we have received a gossip in the current round */    private boolean[] heard_from=new boolean[0];    /** Percentage of members to which gossip is sent (parameterizable by user) */    private double subset=SUBSET_SIZE;    /** The gossiping task scheduler */    private TimeScheduler sched=null;    private Task gossip_task;    /** wait for n messages until sending gossip ... */    private int max_msgs=GOSSIP_MSG_INTERVAL;    /** ... or until max_wait_time has elapsed, whichever comes first */    private long max_wait_time=GOSSIP_INTERVAL;    /** Current number of msgs left to be received before sending a gossip */    private long num_msgs=max_msgs;    /** mutex for interacting with NAKACK layer (GET_MSGS_RECVD) */    private final Object highest_seqnos_mutex=new Object();        /** Time to wait for a reply from NAKACK layer (GET_MSGS_RECVD) */    private long highest_seqnos_timeout=4000;    /**     * @return this protocol name     */    public String getName() {        return (PROT_NAME);    }    /**     * The events expected to be handled from some layer above:     * <ul>     * <li>     * GET_MSGS_RECEIVED: NAKACK layer     * </li>     * </ul>     * @return a list of events expected by to be handled from some layer     * above     */    public Vector requiredUpServices() {        Vector retval=new Vector(1);        retval.addElement(new Integer(Event.GET_MSGS_RECEIVED));        return retval;    }    /**     * Set the parameters for this layer.     *     * <ul>     * <li>     * <i>subset</i>: the percentage of the group'size to which the     * msgs_seen_so_far gossip is sent periodically.</li>     * <li>     * <i>max_msgs</i>: the max number of msgs to wait for between two     * consecutive gossipings.</li>     * <li>     * <i>max_wait_time</i>: the max time to wait for between two consecutive     * gossipings.</li>     * <li>     * <i>highest_seqno_timeout</i>: time to wait to receive from NAKACK     * the array of highest deliverable seqnos     * </li>     * </ul>     *     * @param props the list of parameters     */    public boolean setProperties(Properties props) {        String str;        super.setProperties(props);        str=props.getProperty("subset");        if(str != null) {            subset=Float.parseFloat(str);            props.remove("subset");        }        str=props.getProperty("max_msgs");        if(str != null) {            num_msgs=max_msgs=Integer.parseInt(str);            if(max_msgs <= 1) {                if(log.isFatalEnabled()) log.fatal("value for 'max_msgs' must be greater than 1 !");                return false;            }            props.remove("max_msgs");        }        str=props.getProperty("max_wait_time");        if(str != null) {            max_wait_time=Long.parseLong(str);            props.remove("max_wait_time");        }        str=props.getProperty("highest_seqnos_timeout");        if(str != null) {            highest_seqnos_timeout=Long.parseLong(str);            props.remove("highest_seqnos_timeout");        }        if(props.size() > 0) {            log.error("STABLE.setProperties(): these properties are not recognized: " + props);            return false;        }        return true;    }    /**     * Start the layer:     * i. Set the gossip task scheduler     * ii. Reset the layer's state.     * iii. Start the gossiping task     */    public void start() throws Exception {        TimeScheduler timer;        super.start();        timer=stack != null ? stack.timer : null;        if(timer == null)            throw new Exception("STABLE.start(): timer is null");        sched=timer;        // we use only asynchronous method invocations...        if(_corr != null)            _corr.setDeadlockDetection(false);        initialize();        startGossip();    }    /**     * Stop scheduling the gossip task     */    public void stop() {        super.stop();        synchronized(this) {            if(gossip_task != null)                gossip_task.cancel();            gossip_task=null;        }    }    /* ------------------------- Request handler methods ------------------ */    /**     * Contains the highest sequence numbers as seen by <code>sender</code>     *     * @param view_id The view ID in which the gossip was sent. Must be the     * same as ours, otherwise it is discarded     *     * @param gossip_round The round in which the gossip was sent     *     * @param gossip_seqnos A vector with the highest sequence numbers as     * seen by <code>sender</code>     *     * @param heard The sender's <code>heard_from</code> array. This allows     * us to minimize the gossip msgs for a given round as a member does not     * have to receive gossip msgs from each member, but members pass gossips     * they've received from others on in their own gossips. E.g. when a     * member P (of group {P,Q,R}) receives a gossip from R, its own gossip     * to Q might be {R,P}. Q, who hasn't received a gossip from R, will not     * need to receive it anymore as it is already sent by P. This simple     * scheme reduces the number of gossip messages needed.     *     * @param sender The sender of the gossip message (obviously :-))     */    public void gossip(ViewId view_id, long gossip_round,                       long[] gossip_seqnos, boolean[] heard, Object sender) {        Object[] params;        MethodCall call;        synchronized(this) {                if(log.isInfoEnabled()) log.info("sender=" + sender + ", round=" + gossip_round + ", seqnos=" +                        Util.array2String(gossip_seqnos) + ", heard=" +                        Util.array2String(heard));            if(vid == null || view_id == null || !vid.equals(view_id)) {                    if(log.isInfoEnabled()) log.info("view ID s are different (" + vid + " != " + view_id +                            "). Discarding gossip received");                return;            }            if(gossip_round < this.round) {                    if(log.isInfoEnabled()) log.info("received a gossip from a previous round (" +                            gossip_round + "); my round is " + round +                            ". Discarding gossip");                return;            }            if(gossip_seqnos == null || seqnos == null ||                    seqnos.length != gossip_seqnos.length) {                    if(warn) log.warn("size of seqnos and gossip_seqnos are not equal ! " +                            "Discarding gossip");                return;            }            // (1) If round greater than local round:            // i. Adjust the local to the received round            //            // (2)            // i. local_seqnos = arrayMin(local_seqnos, gossip_seqnos)            // ii. local_heard = arrayMax(local_heard, gossip_heard)            // iii. If heard from all, bcast our seqnos (stability vector)            if(round == gossip_round) {                update(sender, gossip_seqnos, heard);            }            else if(round < gossip_round) {                    if(log.isInfoEnabled()) log.info("received a gossip from a higher round (" +                            gossip_round + "); adopting my round (" + round +                            ") to " + gossip_round);                round=gossip_round;                set(sender, gossip_seqnos, heard_from);            }             if(log.isInfoEnabled()) log.info("heard_from=" + Util.array2String(heard_from));            if(!heardFromAll())                return;            params=new Object[]{                vid.clone(),                new Long(gossip_round),                seqnos.clone(),                local_addr};        } // synchronized(this)        call=new MethodCall("stability", params,             new String[] {ViewId.class.getName(), long.class.getName(), long[].class.getName(), Object.class.getName()});        callRemoteMethods(null, call, GroupRequest.GET_NONE, 0);    }    /**     * Contains the highest message sequence numbers (for each member) that     * can safely be deleted (because they have been seen by all members).     */    public void stability(ViewId view_id, long gossip_round, long[] stability_vector, Object sender) {        // i. Proceed to the next round; init the heard from list        // ii. Send up the stability vector        // iii. get a fresh copy of the highest deliverable seqnos        synchronized(this) {                if(log.isInfoEnabled()) log.info("sender=" + sender + ", round=" + gossip_round + ", vector=" +                        Util.array2String(stability_vector) + ')');            if(vid == null || view_id == null || !vid.equals(view_id)) {                    if(log.isInfoEnabled()) log.info("view ID s are different (" + vid + " != " + view_id +                            "). Discarding gossip received");                return;            }            if(round > gossip_round)                return;            round=gossip_round + 1;            for(int i=0; i < heard_from.length; i++)                heard_from[i]=false;        }        heard_from[mbrs.indexOf(local_addr)]=true;        passUp(new Event(Event.STABLE, stability_vector));        getHighestSeqnos();    }    /* --------------------- End of Request handler methods --------------- */    /**     * <b>Callback</b>. Called by superclass when event may be handled.     * <p>     * <b>Do not use <code>PassUp</code> in this method as the event is passed     * up by default by the superclass after this method returns !</b>     *     * @return boolean Defaults to true. If false, event will not be passed     * up the stack.     */    public boolean handleUpEvent(Event evt) {        switch(evt.getType()) {            case Event.MSG:                if(!upMsg(evt))                    return (false);                break;            case Event.SET_LOCAL_ADDRESS:                local_addr=(Address)evt.getArg();                break;        }        return true;    }    /**     * <b>Callback</b>. Called by superclass when event may be handled.     * <p>     * <b>Do not use <code>PassDown</code> in this method as the event is

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国欧美国产| 亚洲人午夜精品天堂一二香蕉| 国产99久久久国产精品潘金网站| 日韩理论在线观看| 日韩精品最新网址| 91毛片在线观看| 黄色精品一二区| 亚洲综合视频网| 国产女人aaa级久久久级| 91精品福利在线一区二区三区| 99久久精品一区二区| 韩日精品视频一区| 婷婷综合久久一区二区三区| 自拍偷在线精品自拍偷无码专区| 精品美女在线观看| 欧美日韩亚洲综合在线 | 日韩va欧美va亚洲va久久| 中文字幕不卡在线播放| 日韩欧美一区二区在线视频| 色老汉一区二区三区| 国产成人av电影在线观看| 日韩黄色片在线观看| 亚洲精选视频免费看| 国产精品美女久久久久aⅴ| 欧美大白屁股肥臀xxxxxx| 欧美区视频在线观看| 91欧美一区二区| aaa欧美色吧激情视频| 国产一区二区免费视频| 日本伊人精品一区二区三区观看方式| 亚洲蜜臀av乱码久久精品| 中文字幕成人在线观看| 国产嫩草影院久久久久| 亚洲精品一区二区三区福利| 日韩一区二区三区观看| 精品视频资源站| 在线观看亚洲a| 色88888久久久久久影院按摩| 波多野结衣在线aⅴ中文字幕不卡| 国产一区二区三区四区五区美女 | 视频一区中文字幕国产| 一区二区成人在线观看| 亚洲免费观看视频| 亚洲卡通动漫在线| 一区二区三区日韩欧美| 亚洲一区在线播放| 亚洲电影一区二区| 亚洲国产中文字幕在线视频综合| 亚洲一区成人在线| 性做久久久久久免费观看| 天堂成人免费av电影一区| 五月激情综合色| 琪琪久久久久日韩精品| 久久国产夜色精品鲁鲁99| 国产真实乱子伦精品视频| 国产在线精品视频| 成人午夜大片免费观看| 99在线精品观看| 在线看日韩精品电影| 欧美日韩视频在线第一区 | 国产精品毛片久久久久久| 中文字幕欧美三区| 亚洲美女屁股眼交3| 天天综合天天做天天综合| 毛片av中文字幕一区二区| 国产一二三精品| 99久久精品国产毛片| 欧美天天综合网| 精品国产一区二区在线观看| 国产精品视频在线看| 一区二区三区在线观看视频| 亚洲成人免费看| 国产伦精品一区二区三区免费迷 | 一区二区三区在线影院| 亚洲一二三四在线观看| 日韩vs国产vs欧美| 成人sese在线| 欧美视频完全免费看| 精品久久久久久久久久久院品网 | 亚洲品质自拍视频| 视频一区二区三区中文字幕| 国产精品一区免费在线观看| 一本色道久久综合狠狠躁的推荐| 欧美人动与zoxxxx乱| 日本一区二区三区在线观看| 亚洲午夜激情网页| 国产老肥熟一区二区三区| 在线影视一区二区三区| 精品电影一区二区| 一区二区三区免费| 国产一区二区不卡| 欧美性猛交xxxxxx富婆| 久久伊人中文字幕| 夜夜嗨av一区二区三区网页| 国产一区二区三区在线观看免费视频| 一本到三区不卡视频| 欧美电影免费观看完整版| 综合精品久久久| 国产伦精品一区二区三区在线观看| 欧美自拍偷拍午夜视频| 亚洲精品在线免费观看视频| 一区二区三区.www| 国产成人亚洲综合a∨婷婷| 精品1区2区3区| 中文字幕视频一区二区三区久| 婷婷成人激情在线网| 99在线精品观看| 精品久久久影院| 日韩电影在线观看一区| 91麻豆国产香蕉久久精品| www一区二区| 午夜精彩视频在线观看不卡| jlzzjlzz国产精品久久| 久久久九九九九| 男男成人高潮片免费网站| 在线观看亚洲精品视频| 日韩理论电影院| 成人看片黄a免费看在线| 日韩精品一区二区三区视频播放| 亚洲第一搞黄网站| 色综合久久中文字幕| 国产欧美精品一区二区色综合| 美腿丝袜亚洲三区| 欧美日韩亚洲综合一区| 亚洲一区免费视频| 色综合天天综合网天天看片| 欧美国产精品中文字幕| 国产在线精品一区二区不卡了 | 欧美自拍丝袜亚洲| 亚洲久草在线视频| 91捆绑美女网站| 亚洲日本一区二区| 91同城在线观看| 亚洲人妖av一区二区| 91麻豆蜜桃一区二区三区| 1024成人网| 色94色欧美sute亚洲线路一久 | 久久99久久久久久久久久久| 宅男在线国产精品| 日韩av不卡一区二区| 欧美精品aⅴ在线视频| 天堂va蜜桃一区二区三区| 欧美高清性hdvideosex| 日韩精品成人一区二区三区| 欧美精品在线观看一区二区| 亚洲va在线va天堂| 91精品国产综合久久香蕉麻豆| 亚洲成人激情自拍| 日韩一区二区在线观看| 久久精品国产久精国产爱| 26uuu精品一区二区在线观看| 国产一区二区不卡| 国产精品毛片久久久久久| 99国产精品久久久久| 亚洲人被黑人高潮完整版| 欧美三级在线播放| 美女网站视频久久| 久久精品欧美一区二区三区麻豆| 成人美女视频在线观看| 亚洲愉拍自拍另类高清精品| 91精品国产入口| 国产一区二区三区不卡在线观看| 国产精品美日韩| 欧美中文字幕一区| 美女国产一区二区| 国产欧美日韩另类视频免费观看| 99久久精品免费看| 日本不卡视频在线| 国产日韩精品一区二区三区| 色婷婷激情一区二区三区| 视频一区二区国产| 国产精品拍天天在线| 欧美色视频在线观看| 精品中文字幕一区二区小辣椒| 国产精品无人区| 欧美日韩综合色| 国产精品一级黄| 亚洲第一电影网| 国产日产欧美一区| 欧美性猛交xxxx黑人交| 国产精品99久久久久久久女警| 亚洲人成7777| 精品久久久久久综合日本欧美| 99精品视频免费在线观看| 日韩av一区二| 最新国产成人在线观看| 日韩一区二区免费视频| 97成人超碰视| 国产综合成人久久大片91| 亚洲综合免费观看高清在线观看| 日韩一区二区三区免费看 | 99久久免费国产| 另类的小说在线视频另类成人小视频在线| 国产精品午夜电影| 日韩午夜精品视频| 色香色香欲天天天影视综合网| 精品一区二区av| 午夜激情一区二区三区| 亚洲人成精品久久久久| 国产欧美一区视频|