亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲免费观看高清完整| 成人国产精品免费网站| 狠狠色丁香久久婷婷综合_中| 国产九色精品成人porny| 91官网在线观看| 国产三级精品视频| 日本aⅴ免费视频一区二区三区| 成人ar影院免费观看视频| 欧美一区二区三区日韩| 综合在线观看色| 国产精品自拍av| 制服丝袜激情欧洲亚洲| 亚洲欧洲综合另类在线| 粉嫩一区二区三区在线看| 欧美一三区三区四区免费在线看| 日韩美女精品在线| 国产精品综合二区| 日韩美女主播在线视频一区二区三区| 一区二区三区在线高清| 成人国产在线观看| 国产亚洲一本大道中文在线| 久久9热精品视频| 日韩一区二区在线观看| 亚洲国产成人av网| 91蝌蚪国产九色| 国产精品久久久久三级| 国产精品亚洲人在线观看| 欧美卡1卡2卡| 亚洲成在线观看| 欧美日韩精品一区二区三区蜜桃| 国产精品理论在线观看| 国产99精品国产| 国产欧美一区视频| 国产精品中文字幕欧美| 久久免费精品国产久精品久久久久| 日韩电影在线一区二区| 欧美一区二区三区四区在线观看| 五月综合激情网| 91精品国产麻豆| 久久爱另类一区二区小说| 欧美成人三级电影在线| 久久成人综合网| 国产三级三级三级精品8ⅰ区| 国产制服丝袜一区| 欧美国产精品一区| 色综合欧美在线| 五月天一区二区| 日韩欧美www| 国产成人综合在线播放| 国产精品系列在线| 在线视频国内自拍亚洲视频| 亚洲精品国产视频| 欧美精品精品一区| 久久99国内精品| 欧美国产精品中文字幕| 在线观看亚洲专区| 免费观看成人鲁鲁鲁鲁鲁视频| 日韩小视频在线观看专区| 捆绑紧缚一区二区三区视频| 久久精品一区二区| 色婷婷av一区二区| 日本人妖一区二区| 国产精品久久久久久户外露出| 欧美性感一类影片在线播放| 麻豆精品久久精品色综合| 国产日韩av一区二区| 在线视频欧美区| 国产成人午夜视频| 亚洲午夜av在线| 国产偷国产偷亚洲高清人白洁| 一本一道久久a久久精品| 精品在线你懂的| 亚洲免费视频中文字幕| 欧美一区二区三区思思人| 99久久精品国产导航| 免费成人在线视频观看| 亚洲视频在线观看一区| 亚洲精品在线免费播放| 欧美亚洲动漫精品| 成人精品电影在线观看| 日一区二区三区| 东方aⅴ免费观看久久av| 5566中文字幕一区二区电影| 久久精品国产999大香线蕉| 国产精品久久久久aaaa樱花 | 欧美日韩亚洲综合一区| 免费高清不卡av| 亚洲色图20p| 精品对白一区国产伦| 欧洲另类一二三四区| 久久精品久久99精品久久| 国产精品久久久久影院老司| 欧美久久一二三四区| 成年人网站91| 青青草成人在线观看| 久久综合色天天久久综合图片| 欧美性猛交xxxx乱大交退制版 | 91国偷自产一区二区三区成为亚洲经典 | 在线观看免费视频综合| 紧缚奴在线一区二区三区| 亚洲人成网站在线| 久久麻豆一区二区| 91精选在线观看| 91亚洲国产成人精品一区二区三| 久久超级碰视频| 亚洲国产一区二区三区青草影视| 国产亚洲制服色| 7799精品视频| 欧洲av在线精品| 国产一区二区三区蝌蚪| 黄一区二区三区| 蜜臀91精品一区二区三区| 亚洲欧美欧美一区二区三区| 国产午夜精品福利| 日韩欧美国产精品| 欧美日韩一区不卡| 色视频成人在线观看免| 白白色 亚洲乱淫| 美女视频黄免费的久久| 视频一区二区不卡| 亚洲国产日韩精品| 欧美激情一区二区在线| 精品美女在线播放| 日韩一级欧美一级| 日韩欧美专区在线| 91麻豆精品91久久久久同性| 9191国产精品| 欧美一区二区三区免费观看视频 | 7777精品伊人久久久大香线蕉| 色婷婷激情综合| 欧美区在线观看| 欧美日韩精品系列| 欧美日韩精品久久久| 欧美日韩一区二区电影| 欧美另类高清zo欧美| 欧美久久久久免费| 在线观看一区二区精品视频| 欧美嫩在线观看| 91精品在线免费| 欧美xxxx老人做受| 久久只精品国产| 国产精品区一区二区三| 久久久精品国产99久久精品芒果 | 日韩一本二本av| 欧美成人激情免费网| 久久噜噜亚洲综合| 久久久精品国产免大香伊| 日韩一级片在线播放| 日韩一二三四区| 国产欧美日韩三区| 亚洲人成网站色在线观看| 亚洲电影一区二区| 蜜臀av亚洲一区中文字幕| 粉嫩aⅴ一区二区三区四区五区| 在线观看欧美黄色| 欧美不卡一二三| xnxx国产精品| 国产欧美日韩麻豆91| 亚洲欧洲av在线| 日韩精品成人一区二区在线| 国产美女精品一区二区三区| 99精品视频免费在线观看| 欧美羞羞免费网站| 欧美绝品在线观看成人午夜影视| 精品国产乱码久久久久久久久| 国产欧美日本一区二区三区| 亚洲婷婷综合色高清在线| 日韩成人免费电影| 91一区二区三区在线观看| 91精品国产免费久久综合| 一区精品在线播放| 久久99国产精品尤物| 一本一道久久a久久精品综合蜜臀| 日韩女优av电影| 亚洲综合在线视频| 成人性生交大片免费看视频在线| 91污片在线观看| 国产女人水真多18毛片18精品视频| 亚洲制服丝袜av| 国产精品一区一区| 欧美猛男超大videosgay| 精品乱人伦小说| 麻豆久久一区二区| 欧美亚洲高清一区| 国产精品国产a级| 国内精品久久久久影院薰衣草| 欧美优质美女网站| 国产精品丝袜91| 国产一区二区精品久久91| 9191成人精品久久| 亚洲精品美腿丝袜| 狠狠色狠狠色综合系列| 欧美一级欧美三级| 亚洲精品国产一区二区精华液| 国产成人一区二区精品非洲| 91精品免费在线| 日本不卡高清视频| 欧美日韩高清一区二区不卡| 亚洲婷婷综合色高清在线| 成人激情电影免费在线观看|