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

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

?? indexfiledeleter.java

?? lucene-2.4.0 是一個全文收索的工具包
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package org.apache.lucene.index;/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.  See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License.  You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */import org.apache.lucene.store.Directory;import java.io.IOException;import java.io.FileNotFoundException;import java.io.PrintStream;import java.util.Map;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.ArrayList;import java.util.Collections;import java.util.Collection;/* * This class keeps track of each SegmentInfos instance that * is still "live", either because it corresponds to a * segments_N file in the Directory (a "commit", i.e. a * committed SegmentInfos) or because it's an in-memory * SegmentInfos that a writer is actively updating but has * not yet committed.  This class uses simple reference * counting to map the live SegmentInfos instances to * individual files in the Directory. * * When autoCommit=true, IndexWriter currently commits only * on completion of a merge (though this may change with * time: it is not a guarantee).  When autoCommit=false, * IndexWriter only commits when it is closed.  Regardless * of autoCommit, the user may call IndexWriter.commit() to * force a blocking commit. *  * The same directory file may be referenced by more than * one IndexCommit, i.e. more than one SegmentInfos. * Therefore we count how many commits reference each file. * When all the commits referencing a certain file have been * deleted, the refcount for that file becomes zero, and the * file is deleted. * * A separate deletion policy interface * (IndexDeletionPolicy) is consulted on creation (onInit) * and once per commit (onCommit), to decide when a commit * should be removed. *  * It is the business of the IndexDeletionPolicy to choose * when to delete commit points.  The actual mechanics of * file deletion, retrying, etc, derived from the deletion * of commit points is the business of the IndexFileDeleter. *  * The current default deletion policy is {@link * KeepOnlyLastCommitDeletionPolicy}, which removes all * prior commits when a new commit has completed.  This * matches the behavior before 2.2. * * Note that you must hold the write.lock before * instantiating this class.  It opens segments_N file(s) * directly with no retry logic. */final class IndexFileDeleter {  /* Files that we tried to delete but failed (likely   * because they are open and we are running on Windows),   * so we will retry them again later: */  private List deletable;  /* Reference count for all files in the index.     * Counts how many existing commits reference a file.   * Maps String to RefCount (class below) instances: */  private Map refCounts = new HashMap();  /* Holds all commits (segments_N) currently in the index.   * This will have just 1 commit if you are using the   * default delete policy (KeepOnlyLastCommitDeletionPolicy).   * Other policies may leave commit points live for longer   * in which case this list would be longer than 1: */  private List commits = new ArrayList();  /* Holds files we had incref'd from the previous   * non-commit checkpoint: */  private List lastFiles = new ArrayList();  /* Commits that the IndexDeletionPolicy have decided to delete: */   private List commitsToDelete = new ArrayList();  private PrintStream infoStream;  private Directory directory;  private IndexDeletionPolicy policy;  private DocumentsWriter docWriter;  /** Change to true to see details of reference counts when   *  infoStream != null */  public static boolean VERBOSE_REF_COUNTS = false;  void setInfoStream(PrintStream infoStream) {    this.infoStream = infoStream;    if (infoStream != null)      message("setInfoStream deletionPolicy=" + policy);  }    private void message(String message) {    infoStream.println("IFD [" + Thread.currentThread().getName() + "]: " + message);  }  /**   * Initialize the deleter: find all previous commits in   * the Directory, incref the files they reference, call   * the policy to let it delete commits.  The incoming   * segmentInfos must have been loaded from a commit point   * and not yet modified.  This will remove any files not   * referenced by any of the commits.   * @throws CorruptIndexException if the index is corrupt   * @throws IOException if there is a low-level IO error   */  public IndexFileDeleter(Directory directory, IndexDeletionPolicy policy, SegmentInfos segmentInfos, PrintStream infoStream, DocumentsWriter docWriter)    throws CorruptIndexException, IOException {    this.docWriter = docWriter;    this.infoStream = infoStream;    if (infoStream != null)      message("init: current segments file is \"" + segmentInfos.getCurrentSegmentFileName() + "\"; deletionPolicy=" + policy);    this.policy = policy;    this.directory = directory;    // First pass: walk the files and initialize our ref    // counts:    long currentGen = segmentInfos.getGeneration();    IndexFileNameFilter filter = IndexFileNameFilter.getFilter();    String[] files = directory.list();    if (files == null)      throw new IOException("cannot read directory " + directory + ": list() returned null");    CommitPoint currentCommitPoint = null;    for(int i=0;i<files.length;i++) {      String fileName = files[i];      if (filter.accept(null, fileName) && !fileName.equals(IndexFileNames.SEGMENTS_GEN)) {        // Add this file to refCounts with initial count 0:        getRefCount(fileName);        if (fileName.startsWith(IndexFileNames.SEGMENTS)) {          // This is a commit (segments or segments_N), and          // it's valid (<= the max gen).  Load it, then          // incref all files it refers to:          if (SegmentInfos.generationFromSegmentsFileName(fileName) <= currentGen) {            if (infoStream != null) {              message("init: load commit \"" + fileName + "\"");            }            SegmentInfos sis = new SegmentInfos();            try {              sis.read(directory, fileName);            } catch (FileNotFoundException e) {              // LUCENE-948: on NFS (and maybe others), if              // you have writers switching back and forth              // between machines, it's very likely that the              // dir listing will be stale and will claim a              // file segments_X exists when in fact it              // doesn't.  So, we catch this and handle it              // as if the file does not exist              if (infoStream != null) {                message("init: hit FileNotFoundException when loading commit \"" + fileName + "\"; skipping this commit point");              }              sis = null;            }            if (sis != null) {              CommitPoint commitPoint = new CommitPoint(commitsToDelete, directory, sis);              if (sis.getGeneration() == segmentInfos.getGeneration()) {                currentCommitPoint = commitPoint;              }              commits.add(commitPoint);              incRef(sis, true);            }          }        }      }    }    if (currentCommitPoint == null) {      // We did not in fact see the segments_N file      // corresponding to the segmentInfos that was passed      // in.  Yet, it must exist, because our caller holds      // the write lock.  This can happen when the directory      // listing was stale (eg when index accessed via NFS      // client with stale directory listing cache).  So we      // try now to explicitly open this commit point:      SegmentInfos sis = new SegmentInfos();      try {        sis.read(directory, segmentInfos.getCurrentSegmentFileName());      } catch (IOException e) {        throw new CorruptIndexException("failed to locate current segments_N file");      }      if (infoStream != null)        message("forced open of current segments file " + segmentInfos.getCurrentSegmentFileName());      currentCommitPoint = new CommitPoint(commitsToDelete, directory, sis);      commits.add(currentCommitPoint);      incRef(sis, true);    }    // We keep commits list in sorted order (oldest to newest):    Collections.sort(commits);    // Now delete anything with ref count at 0.  These are    // presumably abandoned files eg due to crash of    // IndexWriter.    Iterator it = refCounts.keySet().iterator();    while(it.hasNext()) {      String fileName = (String) it.next();      RefCount rc = (RefCount) refCounts.get(fileName);      if (0 == rc.count) {        if (infoStream != null) {          message("init: removing unreferenced file \"" + fileName + "\"");        }        deleteFile(fileName);      }    }    // Finally, give policy a chance to remove things on    // startup:    policy.onInit(commits);    // It's OK for the onInit to remove the current commit    // point; we just have to checkpoint our in-memory    // SegmentInfos to protect those files that it uses:    if (currentCommitPoint.deleted) {      checkpoint(segmentInfos, false);    }        deleteCommits();  }  /**   * Remove the CommitPoints in the commitsToDelete List by   * DecRef'ing all files from each SegmentInfos.   */  private void deleteCommits() throws IOException {    int size = commitsToDelete.size();    if (size > 0) {      // First decref all files that had been referred to by      // the now-deleted commits:      for(int i=0;i<size;i++) {        CommitPoint commit = (CommitPoint) commitsToDelete.get(i);        if (infoStream != null) {          message("deleteCommits: now decRef commit \"" + commit.getSegmentsFileName() + "\"");        }        int size2 = commit.files.size();        for(int j=0;j<size2;j++) {          decRef((String) commit.files.get(j));        }      }      commitsToDelete.clear();      // Now compact commits to remove deleted ones (preserving the sort):      size = commits.size();      int readFrom = 0;      int writeTo = 0;      while(readFrom < size) {        CommitPoint commit = (CommitPoint) commits.get(readFrom);        if (!commit.deleted) {          if (writeTo != readFrom) {            commits.set(writeTo, commits.get(readFrom));          }          writeTo++;        }        readFrom++;      }      while(size > writeTo) {        commits.remove(size-1);        size--;      }    }  }  /**   * Writer calls this when it has hit an error and had to   * roll back, to tell us that there may now be   * unreferenced files in the filesystem.  So we re-list   * the filesystem and delete such files.  If segmentName   * is non-null, we will only delete files corresponding to   * that segment.   */  public void refresh(String segmentName) throws IOException {    String[] files = directory.list();    if (files == null)      throw new IOException("cannot read directory " + directory + ": list() returned null");    IndexFileNameFilter filter = IndexFileNameFilter.getFilter();    String segmentPrefix1;    String segmentPrefix2;    if (segmentName != null) {      segmentPrefix1 = segmentName + ".";      segmentPrefix2 = segmentName + "_";    } else {      segmentPrefix1 = null;      segmentPrefix2 = null;    }        for(int i=0;i<files.length;i++) {      String fileName = files[i];      if (filter.accept(null, fileName) &&          (segmentName == null || fileName.startsWith(segmentPrefix1) || fileName.startsWith(segmentPrefix2)) &&          !refCounts.containsKey(fileName) &&

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美激情小说另类| 国产成人高清在线| 成人黄色在线看| 日韩欧美亚洲国产另类| 亚洲欧美视频在线观看| 国产福利91精品一区| 欧美主播一区二区三区| 中文字幕av一区 二区| 老汉av免费一区二区三区| 91视频91自| 精品国产成人在线影院 | 天堂蜜桃91精品| 成人av电影免费在线播放| 欧美成人一区二区三区| 日韩精彩视频在线观看| 欧美午夜影院一区| 亚洲女同女同女同女同女同69| 激情小说亚洲一区| 日韩欧美美女一区二区三区| 亚洲国产视频在线| 欧美亚洲国产bt| 亚洲男人的天堂网| 成人av在线一区二区| 国产午夜三级一区二区三| 精品一区二区三区视频| 日韩欧美一区二区在线视频| 日韩福利电影在线观看| 欧美精品一级二级| 视频一区视频二区中文| 7777精品伊人久久久大香线蕉完整版 | 亚洲一区二区三区中文字幕在线| 国产成人免费xxxxxxxx| 久久精品夜色噜噜亚洲a∨| 久久国产精品72免费观看| 欧美一区二区三区精品| 美女视频网站黄色亚洲| 欧美v亚洲v综合ⅴ国产v| 久久国产精品第一页| 精品日韩av一区二区| 国产伦理精品不卡| 久久精品一区二区三区av| 国产aⅴ精品一区二区三区色成熟| 国产精品网曝门| av一本久道久久综合久久鬼色| 中文字幕一区视频| 欧美丝袜丝nylons| 精品制服美女久久| 中文无字幕一区二区三区| 99精品久久免费看蜜臀剧情介绍| 亚洲综合区在线| 日韩欧美一卡二卡| 粉嫩av一区二区三区在线播放 | 亚洲啪啪综合av一区二区三区| 色久综合一二码| 日韩—二三区免费观看av| 日韩色在线观看| 粉嫩aⅴ一区二区三区四区| 亚洲国产成人一区二区三区| 91麻豆精品秘密| 免费观看一级特黄欧美大片| 国产日产欧美一区| 91成人国产精品| 免费观看在线综合| 国产精品美女视频| 9191久久久久久久久久久| 成人妖精视频yjsp地址| 五月天亚洲婷婷| 久久久久久久网| 91蜜桃免费观看视频| 久久99精品国产麻豆婷婷洗澡| 中文字幕av一区二区三区 | 久久疯狂做爰流白浆xx| 中文字幕av一区二区三区免费看 | 偷拍一区二区三区| 国产精品萝li| 欧美人狂配大交3d怪物一区| 成人动漫在线一区| 裸体歌舞表演一区二区| 国产精品精品国产色婷婷| 欧美精品粉嫩高潮一区二区| www.综合网.com| 美女国产一区二区三区| 亚洲综合免费观看高清在线观看| 久久综合九色综合欧美98| 欧美在线你懂得| 成人国产亚洲欧美成人综合网| 久久99蜜桃精品| 偷拍日韩校园综合在线| 亚洲精品日日夜夜| 国产精品毛片a∨一区二区三区| 日韩一区二区三区在线| 欧美日本韩国一区二区三区视频 | 日韩精品最新网址| 91成人在线免费观看| 99久久婷婷国产精品综合| 国产一区二区三区蝌蚪| 免费在线观看一区二区三区| 亚洲一区二区视频在线| 亚洲女人的天堂| 亚洲三级在线免费观看| 中国色在线观看另类| 久久久国产精品麻豆| 久久久综合激的五月天| 日韩欧美国产精品| 欧美一区永久视频免费观看| 欧美日韩免费观看一区二区三区| 色综合亚洲欧洲| 色偷偷一区二区三区| 94色蜜桃网一区二区三区| 成人亚洲精品久久久久软件| 国产成人av一区二区三区在线观看| 捆绑变态av一区二区三区| 日韩国产欧美视频| 日韩不卡一二三区| 日本aⅴ亚洲精品中文乱码| 日本欧美一区二区三区| 青青草原综合久久大伊人精品优势| 亚洲自拍偷拍网站| 亚洲午夜电影网| 亚洲gay无套男同| 免费在线一区观看| 精品一区二区av| 粉嫩高潮美女一区二区三区| av资源网一区| 在线观看视频91| 在线不卡欧美精品一区二区三区| 日韩视频免费观看高清完整版| 精品电影一区二区三区| 国产亚洲欧美中文| 一色屋精品亚洲香蕉网站| 亚洲一区二区在线观看视频| 日韩有码一区二区三区| 激情久久久久久久久久久久久久久久| 国产一区二区福利视频| av激情成人网| 欧美日韩精品一区二区三区 | 欧美成人一区二区三区片免费 | 亚洲高清在线精品| 美女高潮久久久| 99久久亚洲一区二区三区青草| 色激情天天射综合网| 日韩女优毛片在线| 亚洲日本丝袜连裤袜办公室| 亚洲国产日产av| 国产一区二区精品久久99| 91久久精品国产91性色tv| 欧美一区二区视频在线观看| 久久女同性恋中文字幕| 一区二区三区 在线观看视频| 美女高潮久久久| 91丨九色丨蝌蚪富婆spa| 正在播放亚洲一区| 日本一区二区成人| 日韩精品国产精品| 99久久综合99久久综合网站| 欧美一二三区在线观看| 亚洲男人电影天堂| 国产电影精品久久禁18| 欧美日韩精品欧美日韩精品| 中文字幕av在线一区二区三区| 丝袜国产日韩另类美女| 91一区一区三区| 久久蜜臀中文字幕| 视频一区二区中文字幕| 91偷拍与自偷拍精品| 久久久久久影视| 日韩av在线发布| 欧美亚洲一区二区在线| 中文久久乱码一区二区| 国内精品久久久久影院薰衣草 | 久久久久9999亚洲精品| 亚洲成人一二三| 色婷婷综合激情| 国产精品乱码久久久久久| 久久精品国产免费看久久精品| 欧美亚洲另类激情小说| 日韩理论片在线| 粉嫩欧美一区二区三区高清影视| 日韩欧美一级二级三级久久久| 亚洲国产欧美日韩另类综合| 91色视频在线| 最新日韩在线视频| 国产a级毛片一区| 久久久亚洲综合| 精品一区二区免费视频| 日韩视频免费直播| 免费观看一级特黄欧美大片| 在线成人高清不卡| 亚洲国产欧美在线人成| 91久久线看在观草草青青| 亚洲欧洲国产日韩| 成人在线视频一区二区| 久久精品欧美日韩精品| 国产精品99久| 国产日本亚洲高清| 国产成人av一区| 18涩涩午夜精品.www| 色老汉一区二区三区| 亚洲午夜免费福利视频| 欧美精品vⅰdeose4hd|