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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? workqueuefrontier.html

?? 網(wǎng)絡(luò)爬蟲開源代碼
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
<a name="564" href="#564">564</a>     <em>/**<em>*</em></em><a name="565" href="#565">565</a> <em>     * Restore a retired queue to the 'inactive' state. </em><a name="566" href="#566">566</a> <em>     * </em><a name="567" href="#567">567</a> <em>     * @param q</em><a name="568" href="#568">568</a> <em>     */</em><a name="569" href="#569">569</a>     <strong>private</strong> <strong>void</strong> unretireQueue(<a href="../../../../org/archive/crawler/frontier/WorkQueue.html">WorkQueue</a> q) {<a name="570" href="#570">570</a>         deactivateQueue(q);<a name="571" href="#571">571</a>         q.setRetired(false); <a name="572" href="#572">572</a>         incrementQueuedUriCount(q.getCount());<a name="573" href="#573">573</a>     }<a name="574" href="#574">574</a> <a name="575" href="#575">575</a>     <em>/**<em>*</em></em><a name="576" href="#576">576</a> <em>     * Return the work queue for the given CrawlURI's classKey. URIs</em><a name="577" href="#577">577</a> <em>     * are ordered and politeness-delayed within their 'class'.</em><a name="578" href="#578">578</a> <em>     * If the requested queue is not found, a new instance is created.</em><a name="579" href="#579">579</a> <em>     * </em><a name="580" href="#580">580</a> <em>     * @param curi CrawlURI to base queue on</em><a name="581" href="#581">581</a> <em>     * @return the found or created ClassKeyQueue</em><a name="582" href="#582">582</a> <em>     */</em><a name="583" href="#583">583</a>     <strong>protected</strong> <strong>abstract</strong> <a href="../../../../org/archive/crawler/frontier/WorkQueue.html">WorkQueue</a> getQueueFor(<a href="../../../../org/archive/crawler/datamodel/CrawlURI.html">CrawlURI</a> curi);<a name="584" href="#584">584</a> <a name="585" href="#585">585</a>     <em>/**<em>*</em></em><a name="586" href="#586">586</a> <em>     * Return the work queue for the given classKey, or null</em><a name="587" href="#587">587</a> <em>     * if no such queue exists.</em><a name="588" href="#588">588</a> <em>     * </em><a name="589" href="#589">589</a> <em>     * @param classKey key to look for</em><a name="590" href="#590">590</a> <em>     * @return the found WorkQueue</em><a name="591" href="#591">591</a> <em>     */</em><a name="592" href="#592">592</a>     <strong>protected</strong> <strong>abstract</strong> <a href="../../../../org/archive/crawler/frontier/WorkQueue.html">WorkQueue</a> getQueueFor(String classKey);<a name="593" href="#593">593</a>     <a name="594" href="#594">594</a>     <em>/**<em>*</em></em><a name="595" href="#595">595</a> <em>     * Return the next CrawlURI to be processed (and presumably</em><a name="596" href="#596">596</a> <em>     * visited/fetched) by a a worker thread.</em><a name="597" href="#597">597</a> <em>     *</em><a name="598" href="#598">598</a> <em>     * Relies on the readyClassQueues having been loaded with</em><a name="599" href="#599">599</a> <em>     * any work queues that are eligible to provide a URI. </em><a name="600" href="#600">600</a> <em>     *</em><a name="601" href="#601">601</a> <em>     * @return next CrawlURI to be processed. Or null if none is available.</em><a name="602" href="#602">602</a> <em>     *</em><a name="603" href="#603">603</a> <em>     * @see org.archive.crawler.framework.Frontier#next()</em><a name="604" href="#604">604</a> <em>     */</em><a name="605" href="#605">605</a>     <strong>public</strong> <a href="../../../../org/archive/crawler/datamodel/CrawlURI.html">CrawlURI</a> next()<a name="606" href="#606">606</a>     throws InterruptedException, <a href="../../../../org/archive/crawler/framework/exceptions/EndedException.html">EndedException</a> {<a name="607" href="#607">607</a>         <strong>while</strong> (<strong>true</strong>) { <em class="comment">// loop left only by explicit return or exception</em><a name="608" href="#608">608</a>             <strong>long</strong> now = System.currentTimeMillis();<a name="609" href="#609">609</a> <a name="610" href="#610">610</a>             <em class="comment">// Do common checks for pause, terminate, bandwidth-hold</em><a name="611" href="#611">611</a>             preNext(now);<a name="612" href="#612">612</a>             <a name="613" href="#613">613</a>             <strong>synchronized</strong>(readyClassQueues) {<a name="614" href="#614">614</a>                 <strong>int</strong> activationsNeeded = targetSizeForReadyQueues() - readyClassQueues.size();<a name="615" href="#615">615</a>                 <strong>while</strong>(activationsNeeded > 0 &amp;&amp; !inactiveQueues.isEmpty()) {<a name="616" href="#616">616</a>                     activateInactiveQueue();<a name="617" href="#617">617</a>                     activationsNeeded--;<a name="618" href="#618">618</a>                 }<a name="619" href="#619">619</a>             }<a name="620" href="#620">620</a>                    <a name="621" href="#621">621</a>             <a href="../../../../org/archive/crawler/frontier/WorkQueue.html">WorkQueue</a> readyQ = <strong>null</strong>;<a name="622" href="#622">622</a>             Object key = readyClassQueues.poll(DEFAULT_WAIT,TimeUnit.MILLISECONDS);<a name="623" href="#623">623</a>             <strong>if</strong> (key != <strong>null</strong>) {<a name="624" href="#624">624</a>                 readyQ = (WorkQueue)<strong>this</strong>.allQueues.get(key);<a name="625" href="#625">625</a>             }<a name="626" href="#626">626</a>             <strong>if</strong> (readyQ != <strong>null</strong>) {<a name="627" href="#627">627</a>                 <strong>while</strong>(<strong>true</strong>) { <em class="comment">// loop left by explicit return or break on empty</em><a name="628" href="#628">628</a>                     <a href="../../../../org/archive/crawler/datamodel/CrawlURI.html">CrawlURI</a> curi = <strong>null</strong>;<a name="629" href="#629">629</a>                     <strong>synchronized</strong>(readyQ) {<a name="630" href="#630">630</a>                         curi = readyQ.peek(<strong>this</strong>);                     <a name="631" href="#631">631</a>                         <strong>if</strong> (curi != <strong>null</strong>) {<a name="632" href="#632">632</a>                             <em class="comment">// check if curi belongs in different queue</em><a name="633" href="#633">633</a>                             String currentQueueKey = getClassKey(curi);<a name="634" href="#634">634</a>                             <strong>if</strong> (currentQueueKey.equals(curi.getClassKey())) {<a name="635" href="#635">635</a>                                 <em class="comment">// curi was in right queue, emit</em><a name="636" href="#636">636</a>                                 noteAboutToEmit(curi, readyQ);<a name="637" href="#637">637</a>                                 inProcessQueues.add(readyQ);<a name="638" href="#638">638</a>                                 <strong>return</strong> curi;<a name="639" href="#639">639</a>                             }<a name="640" href="#640">640</a>                             <em class="comment">// URI's assigned queue has changed since it</em><a name="641" href="#641">641</a>                             <em class="comment">// was queued (eg because its IP has become</em><a name="642" href="#642">642</a>                             <em class="comment">// known). Requeue to new queue.</em><a name="643" href="#643">643</a>                             curi.setClassKey(currentQueueKey);<a name="644" href="#644">644</a>                             readyQ.dequeue(<strong>this</strong>);<a name="645" href="#645">645</a>                             decrementQueuedCount(1);<a name="646" href="#646">646</a>                             curi.setHolderKey(<strong>null</strong>);<a name="647" href="#647">647</a>                             <em class="comment">// curi will be requeued to true queue after lock</em><a name="648" href="#648">648</a>                             <em class="comment">//  on readyQ is released, to prevent deadlock</em><a name="649" href="#649">649</a>                         } <strong>else</strong> {<a name="650" href="#650">650</a>                             <em class="comment">// readyQ is empty and ready: it's exhausted</em><a name="651" href="#651">651</a>                             <em class="comment">// release held status, allowing any subsequent </em><a name="652" href="#652">652</a>                             <em class="comment">// enqueues to again put queue in ready</em><a name="653" href="#653">653</a>                             readyQ.clearHeld();<a name="654" href="#654">654</a>                             <strong>break</strong>;<a name="655" href="#655">655</a>                         }<a name="656" href="#656">656</a>                     }<a name="657" href="#657">657</a>                     <strong>if</strong>(curi!=<strong>null</strong>) {<a name="658" href="#658">658</a>                         <em class="comment">// complete the requeuing begun earlier</em><a name="659" href="#659">659</a>                         sendToQueue(curi);<a name="660" href="#660">660</a>                     }<a name="661" href="#661">661</a>                 }<a name="662" href="#662">662</a>             } <strong>else</strong> {<a name="663" href="#663">663</a>                 <em class="comment">// ReadyQ key wasn't in all queues: unexpected</em><a name="664" href="#664">664</a>                 <strong>if</strong> (key != <strong>null</strong>) {<a name="665" href="#665">665</a>                     logger.severe(<span class="string">"Key "</span>+ key +<a name="666" href="#666">666</a>                         <span class="string">" in readyClassQueues but not allQueues"</span>);<a name="667" href="#667">667</a>                 }<a name="668" href="#668">668</a>             }<a name="669" href="#669">669</a> <a name="670" href="#670">670</a>             <strong>if</strong>(shouldTerminate) {<a name="671" href="#671">671</a>                 <em class="comment">// skip subsequent steps if already on last legs</em><a name="672" href="#672">672</a>                 <strong>throw</strong> <strong>new</strong> <a href="../../../../org/archive/crawler/framework/exceptions/EndedException.html">EndedException</a>(<span class="string">"shouldTerminate is true"</span>);<a name="673" href="#673">673</a>             }<a name="674" href="#674">674</a>                 <a name="675" href="#675">675</a>             <strong>if</strong>(inProcessQueues.size()==0) {<a name="676" href="#676">676</a>                 <em class="comment">// Nothing was ready or in progress or imminent to wake; ensure </em><a name="677" href="#677">677</a>                 <em class="comment">// any piled-up pending-scheduled URIs are considered</em><a name="678" href="#678">678</a>                 <strong>this</strong>.alreadyIncluded.requestFlush();<a name="679" href="#679">679</a>             }    <a name="680" href="#680">680</a>         }<a name="681" href="#681">681</a>     }<a name="682" href="#682">682</a> <a name="683" href="#683">683</a>     <strong>private</strong> <strong>int</strong> targetSizeForReadyQueues() {<a name="684" href="#684">684</a>         <strong>return</strong> targetSizeForReadyQueues;<a name="685" href="#685">685</a>     }<a name="686" href="#686">686</a> <a name="687" href="#687">687</a>     <em>/**<em>*</em></em><a name="688" href="#688">688</a> <em>     * Return the 'cost' of a CrawlURI (how much of its associated</em><a name="689" href="#689">689</a> <em>     * queue's budget it depletes upon attempted processing)</em><a name="690" href="#690">690</a> <em>     * </em><a name="691" href="#691">691</a> <em>     * @param curi</em><a name="692" href="#692">692</a> <em>     * @return the associated cost</em><a name="693" href="#693">693</a> <em>     */</em><a name="694" href="#694">694</a>     <strong>private</strong> <strong>int</strong> getCost(<a href="../../../../org/archive/crawler/datamodel/CrawlURI.html">CrawlURI</a> curi) {<a name="695" href="#695">695</a>         <strong>int</strong> cost = curi.getHolderCost();<a name="696" href="#696">696</a>         <strong>if</strong> (cost == CrawlURI.UNCALCULATED) {<a name="697" href="#697">697</a>             cost = costAssignmentPolicy.costOf(curi);<a name="698" href="#698">698</a>             curi.setHolderCost(cost);<a name="699" href="#699">699</a>         }<a name="700" href="#700">700</a>         <strong>return</strong> cost;<a name="701" href="#701">701</a>     }<a name="702" href="#702">702</a>     <a name="703" href="#703">703</a>     <em>/**<em>*</em></em><a name="704" href="#704">704</a> <em>     * Activate an inactive queue, if any are available. </em><a name="705" href="#705">705</a> <

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
偷拍一区二区三区四区| 欧美精品一区二区三区高清aⅴ | 久久精品在线免费观看| 国产精品欧美一级免费| 亚洲激情一二三区| 免费欧美在线视频| 国产高清视频一区| 在线国产电影不卡| 欧美一区二区视频在线观看2022 | 国产suv精品一区二区6| 91麻豆免费看| 91精品国产福利| 中文av一区特黄| 视频在线在亚洲| 丁香六月久久综合狠狠色| 欧美天天综合网| 亚洲国产激情av| www.亚洲免费av| 欧美日韩中文另类| 精品国产三级a在线观看| 日韩毛片一二三区| 久久电影网电视剧免费观看| 色综合久久久久网| 久久夜色精品一区| 亚洲不卡一区二区三区| 成人做爰69片免费看网站| 欧美日韩卡一卡二| 国产精品美女久久久久久2018| 日韩一区精品视频| 色综合亚洲欧洲| 精品欧美一区二区三区精品久久| 最新不卡av在线| 国产一区二三区| 7777精品伊人久久久大香线蕉经典版下载 | 久久九九99视频| 日本午夜精品一区二区三区电影| 91在线无精精品入口| 精品国产一二三区| 日韩高清不卡一区二区| 99久久婷婷国产综合精品电影| 欧美电影精品一区二区| 亚洲va国产va欧美va观看| 97se亚洲国产综合自在线| 久久中文娱乐网| 久久国产综合精品| 欧美三级电影在线观看| 成人欧美一区二区三区黑人麻豆| 国产原创一区二区三区| 日韩欧美高清在线| 日韩电影在线看| 欧美疯狂做受xxxx富婆| 亚洲线精品一区二区三区 | 亚洲美女视频在线| 成人不卡免费av| 国产欧美一区二区精品秋霞影院| 久久激情五月婷婷| 欧美大胆一级视频| 毛片不卡一区二区| 日韩亚洲国产中文字幕欧美| 亚洲成a人片在线观看中文| 色欧美88888久久久久久影院| 国产精品国产三级国产普通话99| 国产激情视频一区二区在线观看 | 激情六月婷婷综合| 337p亚洲精品色噜噜狠狠| 亚洲国产一区二区三区| 色就色 综合激情| 亚洲欧美日韩综合aⅴ视频| 成人免费毛片高清视频| 欧美国产精品一区| 本田岬高潮一区二区三区| 国产三级精品三级在线专区| 国产精品一区二区无线| 久久久综合激的五月天| 国产成人综合视频| 国产精品久久久久久妇女6080 | 亚洲色图视频网| 久久久久国产精品麻豆| 国产老肥熟一区二区三区| 久久久久国产免费免费| 成人午夜激情影院| 国产精品少妇自拍| 99视频精品在线| 亚洲啪啪综合av一区二区三区| 91婷婷韩国欧美一区二区| 亚洲日本va在线观看| 一本色道久久综合狠狠躁的推荐| 一区二区三区四区乱视频| 欧美做爰猛烈大尺度电影无法无天| 亚洲一区二区高清| 欧美一二三区在线| 国产伦理精品不卡| 中日韩av电影| 欧美性大战久久| 全国精品久久少妇| 久久久精品欧美丰满| 成人av电影免费在线播放| 亚洲尤物视频在线| 91精品国产综合久久精品图片| 精品一区二区免费在线观看| 国产日韩欧美激情| 色域天天综合网| 青青草精品视频| 久久精品人人做人人爽人人| 一本色道**综合亚洲精品蜜桃冫| 手机精品视频在线观看| 久久网站最新地址| 97精品超碰一区二区三区| 视频一区二区欧美| 日本一区二区三级电影在线观看| 一本大道av一区二区在线播放| 五月婷婷综合在线| 亚洲国产精品成人综合| 欧美日韩免费观看一区三区| 黄色日韩三级电影| 亚洲黄色av一区| 日韩精品综合一本久道在线视频| 99在线热播精品免费| 日韩精品91亚洲二区在线观看| 久久久亚洲精品一区二区三区| 91免费版在线| 国产最新精品精品你懂的| 亚洲老司机在线| 日韩欧美一级二级三级| 99久久免费视频.com| 青草av.久久免费一区| 国产欧美日韩不卡免费| 欧美日韩国产美女| 不卡av在线免费观看| 日韩成人免费在线| 亚洲人成7777| 国产亚洲制服色| 在线不卡中文字幕播放| 99久久亚洲一区二区三区青草| 婷婷综合五月天| 中文字幕一区二区三区四区 | 韩国视频一区二区| 亚洲一二三四在线观看| 国产精品天干天干在线综合| 日韩一区二区三区视频在线观看| 不卡欧美aaaaa| 狠狠色丁香久久婷婷综合_中| 亚洲国产一区在线观看| 中文字幕不卡在线观看| 日韩一区二区电影在线| 色呦呦国产精品| 日韩免费看的电影| 欧美日韩一区二区三区在线| 本田岬高潮一区二区三区| 激情综合网av| 日本欧美韩国一区三区| 亚洲第一狼人社区| 亚洲美腿欧美偷拍| 亚洲欧洲精品一区二区三区不卡| 久久久久久久久久久99999| 日韩一区二区在线播放| 欧美精品久久一区| 欧美日韩精品一区二区三区蜜桃 | 亚洲一区电影777| 亚洲色图第一区| 国产精品色一区二区三区| 久久蜜桃香蕉精品一区二区三区| 日韩视频一区二区三区在线播放| 欧美日韩综合在线免费观看| 色噜噜狠狠色综合中国| 成人av第一页| av午夜一区麻豆| av动漫一区二区| www..com久久爱| 99久久免费精品高清特色大片| 成人免费av在线| 成人精品国产福利| 成人av动漫网站| 成人黄色软件下载| 岛国一区二区在线观看| 成人免费黄色在线| 国产成人在线观看| 国产成人99久久亚洲综合精品| 国产成人精品免费在线| 国产成人综合在线| 成人永久看片免费视频天堂| 成人免费毛片aaaaa**| 成人理论电影网| 99视频在线观看一区三区| av午夜一区麻豆| 日本精品免费观看高清观看| 在线视频中文字幕一区二区| 欧美系列一区二区| 欧美日韩黄色影视| 日韩一区二区三区四区| 精品成a人在线观看| 欧美激情一区二区三区全黄| 中文字幕一区免费在线观看| 亚洲精品欧美专区| 亚洲一区二区三区国产| 蜜臀精品久久久久久蜜臀| 国产真实乱子伦精品视频| 国产99久久久国产精品免费看| 不卡一区在线观看| 欧美午夜精品免费|