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

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

?? segmentinfos.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 org.apache.lucene.store.IndexInput;import org.apache.lucene.store.IndexOutput;import org.apache.lucene.store.ChecksumIndexOutput;import org.apache.lucene.store.ChecksumIndexInput;import java.io.File;import java.io.FileNotFoundException;import java.io.IOException;import java.io.PrintStream;import java.util.Vector;final class SegmentInfos extends Vector {  /** The file format version, a negative number. */  /* Works since counter, the old 1st entry, is always >= 0 */  public static final int FORMAT = -1;  /** This format adds details used for lockless commits.  It differs   * slightly from the previous format in that file names   * are never re-used (write once).  Instead, each file is   * written to the next generation.  For example,   * segments_1, segments_2, etc.  This allows us to not use   * a commit lock.  See <a   * href="http://lucene.apache.org/java/docs/fileformats.html">file   * formats</a> for details.   */  public static final int FORMAT_LOCKLESS = -2;  /** This format adds a "hasSingleNormFile" flag into each segment info.   * See <a href="http://issues.apache.org/jira/browse/LUCENE-756">LUCENE-756</a>   * for details.   */  public static final int FORMAT_SINGLE_NORM_FILE = -3;  /** This format allows multiple segments to share a single   * vectors and stored fields file. */  public static final int FORMAT_SHARED_DOC_STORE = -4;  /** This format adds a checksum at the end of the file to   *  ensure all bytes were successfully written. */  public static final int FORMAT_CHECKSUM = -5;  /** This format adds the deletion count for each segment.   *  This way IndexWriter can efficiently report numDocs(). */  public static final int FORMAT_DEL_COUNT = -6;  /** This format adds the boolean hasProx to record if any   *  fields in the segment store prox information (ie, have   *  omitTf==false) */  public static final int FORMAT_HAS_PROX = -7;  /* This must always point to the most recent file format. */  static final int CURRENT_FORMAT = FORMAT_HAS_PROX;    public int counter = 0;    // used to name new segments  /**   * counts how often the index has been changed by adding or deleting docs.   * starting with the current time in milliseconds forces to create unique version numbers.   */  private long version = System.currentTimeMillis();  private long generation = 0;     // generation of the "segments_N" for the next commit  private long lastGeneration = 0; // generation of the "segments_N" file we last successfully read                                   // or wrote; this is normally the same as generation except if                                   // there was an IOException that had interrupted a commit  /**   * If non-null, information about loading segments_N files   * will be printed here.  @see #setInfoStream.   */  private static PrintStream infoStream;  public final SegmentInfo info(int i) {    return (SegmentInfo) get(i);  }  /**   * Get the generation (N) of the current segments_N file   * from a list of files.   *   * @param files -- array of file names to check   */  public static long getCurrentSegmentGeneration(String[] files) {    if (files == null) {      return -1;    }    long max = -1;    for (int i = 0; i < files.length; i++) {      String file = files[i];      if (file.startsWith(IndexFileNames.SEGMENTS) && !file.equals(IndexFileNames.SEGMENTS_GEN)) {        long gen = generationFromSegmentsFileName(file);        if (gen > max) {          max = gen;        }      }    }    return max;  }  /**   * Get the generation (N) of the current segments_N file   * in the directory.   *   * @param directory -- directory to search for the latest segments_N file   */  public static long getCurrentSegmentGeneration(Directory directory) throws IOException {    String[] files = directory.list();    if (files == null)      throw new IOException("cannot read directory " + directory + ": list() returned null");    return getCurrentSegmentGeneration(files);  }  /**   * Get the filename of the current segments_N file   * from a list of files.   *   * @param files -- array of file names to check   */  public static String getCurrentSegmentFileName(String[] files) throws IOException {    return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,                                                 "",                                                 getCurrentSegmentGeneration(files));  }  /**   * Get the filename of the current segments_N file   * in the directory.   *   * @param directory -- directory to search for the latest segments_N file   */  public static String getCurrentSegmentFileName(Directory directory) throws IOException {    return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,                                                 "",                                                 getCurrentSegmentGeneration(directory));  }  /**   * Get the segments_N filename in use by this segment infos.   */  public String getCurrentSegmentFileName() {    return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,                                                 "",                                                 lastGeneration);  }  /**   * Parse the generation off the segments file name and   * return it.   */  public static long generationFromSegmentsFileName(String fileName) {    if (fileName.equals(IndexFileNames.SEGMENTS)) {      return 0;    } else if (fileName.startsWith(IndexFileNames.SEGMENTS)) {      return Long.parseLong(fileName.substring(1+IndexFileNames.SEGMENTS.length()),                            Character.MAX_RADIX);    } else {      throw new IllegalArgumentException("fileName \"" + fileName + "\" is not a segments file");    }  }  /**   * Get the next segments_N filename that will be written.   */  public String getNextSegmentFileName() {    long nextGeneration;    if (generation == -1) {      nextGeneration = 1;    } else {      nextGeneration = generation+1;    }    return IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,                                                 "",                                                 nextGeneration);  }  /**   * Read a particular segmentFileName.  Note that this may   * throw an IOException if a commit is in process.   *   * @param directory -- directory containing the segments file   * @param segmentFileName -- segment file to load   * @throws CorruptIndexException if the index is corrupt   * @throws IOException if there is a low-level IO error   */  public final void read(Directory directory, String segmentFileName) throws CorruptIndexException, IOException {    boolean success = false;    // Clear any previous segments:    clear();    ChecksumIndexInput input = new ChecksumIndexInput(directory.openInput(segmentFileName));    generation = generationFromSegmentsFileName(segmentFileName);    lastGeneration = generation;    try {      int format = input.readInt();      if(format < 0){     // file contains explicit format info        // check that it is a format we can understand        if (format < CURRENT_FORMAT)          throw new CorruptIndexException("Unknown format version: " + format);        version = input.readLong(); // read version        counter = input.readInt(); // read counter      }      else{     // file is in old format without explicit format info        counter = format;      }            for (int i = input.readInt(); i > 0; i--) { // read segmentInfos        add(new SegmentInfo(directory, format, input));      }            if(format >= 0){    // in old format the version number may be at the end of the file        if (input.getFilePointer() >= input.length())          version = System.currentTimeMillis(); // old file format without version number        else          version = input.readLong(); // read version      }      if (format <= FORMAT_CHECKSUM) {        final long checksumNow = input.getChecksum();        final long checksumThen = input.readLong();        if (checksumNow != checksumThen)          throw new CorruptIndexException("checksum mismatch in segments file");      }      success = true;    }    finally {      input.close();      if (!success) {        // Clear any segment infos we had loaded so we        // have a clean slate on retry:        clear();      }    }  }  /**   * This version of read uses the retry logic (for lock-less   * commits) to find the right segments file to load.   * @throws CorruptIndexException if the index is corrupt   * @throws IOException if there is a low-level IO error   */  public final void read(Directory directory) throws CorruptIndexException, IOException {    generation = lastGeneration = -1;    new FindSegmentsFile(directory) {      protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {        read(directory, segmentFileName);        return null;      }    }.run();  }  // Only non-null after prepareCommit has been called and  // before finishCommit is called  ChecksumIndexOutput pendingOutput;  private final void write(Directory directory) throws IOException {    String segmentFileName = getNextSegmentFileName();    // Always advance the generation on write:    if (generation == -1) {      generation = 1;    } else {      generation++;    }    ChecksumIndexOutput output = new ChecksumIndexOutput(directory.createOutput(segmentFileName));    boolean success = false;    try {      output.writeInt(CURRENT_FORMAT); // write FORMAT      output.writeLong(++version); // every write changes                                   // the index      output.writeInt(counter); // write counter      output.writeInt(size()); // write infos      for (int i = 0; i < size(); i++) {        info(i).write(output);      }      output.prepareCommit();      success = true;      pendingOutput = output;    } finally {      if (!success) {        // We hit an exception above; try to close the file        // but suppress any exception:        try {          output.close();        } catch (Throwable t) {          // Suppress so we keep throwing the original exception        }        try {          // Try not to leave a truncated segments_N file in          // the index:          directory.deleteFile(segmentFileName);        } catch (Throwable t) {          // Suppress so we keep throwing the original exception        }      }    }  }  /**   * Returns a copy of this instance, also copying each   * SegmentInfo.   */    public Object clone() {    SegmentInfos sis = (SegmentInfos) super.clone();    for(int i=0;i<sis.size();i++) {      sis.set(i, sis.info(i).clone());    }    return sis;  }  /**   * version number when this SegmentInfos was generated.   */  public long getVersion() {    return version;  }  public long getGeneration() {    return generation;  }  public long getLastGeneration() {    return lastGeneration;  }  /**   * Current version number from segments file.   * @throws CorruptIndexException if the index is corrupt   * @throws IOException if there is a low-level IO error   */  public static long readCurrentVersion(Directory directory)    throws CorruptIndexException, IOException {    return ((Long) new FindSegmentsFile(directory) {        protected Object doBody(String segmentFileName) throws CorruptIndexException, IOException {          IndexInput input = directory.openInput(segmentFileName);          int format = 0;          long version = 0;          try {            format = input.readInt();            if(format < 0){              if (format < CURRENT_FORMAT)                throw new CorruptIndexException("Unknown format version: " + format);              version = input.readLong(); // read version            }          }          finally {            input.close();          }               if(format < 0)            return new Long(version);          // We cannot be sure about the format of the file.          // Therefore we have to read the whole file and cannot simply seek to the version entry.          SegmentInfos sis = new SegmentInfos();          sis.read(directory, segmentFileName);          return new Long(sis.getVersion());        }      }.run()).longValue();  }  /** If non-null, information about retries when loading   * the segments file will be printed to this.   */  public static void setInfoStream(PrintStream infoStream) {    SegmentInfos.infoStream = infoStream;  }  /* Advanced configuration of retry logic in loading     segments_N file */  private static int defaultGenFileRetryCount = 10;  private static int defaultGenFileRetryPauseMsec = 50;  private static int defaultGenLookaheadCount = 10;  /**   * Advanced: set how many times to try loading the   * segments.gen file contents to determine current segment   * generation.  This file is only referenced when the   * primary method (listing the directory) fails.   */  public static void setDefaultGenFileRetryCount(int count) {    defaultGenFileRetryCount = count;  }  /**   * @see #setDefaultGenFileRetryCount   */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久久久| 欧美在线视频你懂得| 一区二区三区在线免费观看| 日韩视频123| 在线看国产一区二区| 国产电影精品久久禁18| 亚洲成人一区二区| 自拍偷拍亚洲综合| 日本一区二区三区dvd视频在线| 欧美吞精做爰啪啪高潮| www.av亚洲| 成人在线视频一区二区| 精品一区二区免费| 日韩精品一卡二卡三卡四卡无卡| 日韩理论电影院| 亚洲国产精品激情在线观看| 精品粉嫩aⅴ一区二区三区四区| 欧美日精品一区视频| 99视频有精品| 成人av网站大全| 国产成人免费视| 国产毛片精品国产一区二区三区| 日韩1区2区日韩1区2区| 午夜激情综合网| 亚洲国产精品一区二区尤物区| 亚洲欧美日韩精品久久久久| 国产精品午夜免费| 国产女人aaa级久久久级 | 国产欧美综合在线观看第十页| 欧美xxxx在线观看| 91精品欧美综合在线观看最新| 日本丰满少妇一区二区三区| 91毛片在线观看| 91精品久久久久久久久99蜜臂| 色综合中文字幕| 色嗨嗨av一区二区三区| 91美女片黄在线观看| 91在线播放网址| 日本韩国视频一区二区| 欧美在线免费观看视频| 欧美日韩一级片在线观看| 欧美羞羞免费网站| 欧美日韩中文字幕一区二区| 欧美日韩国产区一| 欧美精品久久99久久在免费线| 欧美日韩免费观看一区二区三区| 欧美性视频一区二区三区| 欧美视频在线一区二区三区| 欧美日本一区二区三区| 欧美一级夜夜爽| 26uuu精品一区二区在线观看| 国产亚洲欧美激情| 中文字幕日韩一区| 一区二区三区在线播放| 亚洲va欧美va国产va天堂影院| 天天操天天干天天综合网| 青青国产91久久久久久 | 蜜臀久久99精品久久久久宅男 | 国产精品一线二线三线精华| 国产精品一二三| 不卡一卡二卡三乱码免费网站| 欧美性高清videossexo| 日韩丝袜情趣美女图片| 久久精品亚洲乱码伦伦中文| 亚洲美女一区二区三区| 亚洲成人第一页| 国产精品一区一区三区| 91在线视频播放地址| 9191久久久久久久久久久| 久久综合色鬼综合色| 亚洲三级免费观看| 日日夜夜一区二区| 国产成人免费xxxxxxxx| 欧美日精品一区视频| 久久久久久久综合日本| 亚洲激情一二三区| 久久国产精品色婷婷| 福利91精品一区二区三区| 精品视频免费在线| 国产夜色精品一区二区av| 一级女性全黄久久生活片免费| 久久精品国产久精国产| 99久久精品一区| 欧美va亚洲va香蕉在线| 依依成人综合视频| 国产一区久久久| 欧美揉bbbbb揉bbbbb| 国产精品素人视频| 热久久免费视频| 色综合久久天天| 亚洲精品一区二区三区福利| 亚洲美女视频在线| 国产又黄又大久久| 欧美日韩免费电影| 中文字幕一区二区三区四区| 美国毛片一区二区| 91久久免费观看| 中文字幕av一区 二区| 日韩高清电影一区| 色8久久精品久久久久久蜜| 国产午夜久久久久| 久久精品99国产精品日本| 色偷偷成人一区二区三区91| 久久免费看少妇高潮| 丝袜诱惑亚洲看片| 91久久国产综合久久| 中文字幕欧美三区| 国产一区二区三区在线观看精品| 欧美日韩国产乱码电影| 一区二区三区四区在线免费观看| 国产成人午夜精品影院观看视频| 7777精品伊人久久久大香线蕉完整版 | 亚洲精品国久久99热| 国产精品乡下勾搭老头1| 欧美一区二区三区视频在线| 一区二区三区波多野结衣在线观看 | 亚洲精品在线观| 天堂资源在线中文精品| 欧美视频在线一区| 亚洲制服丝袜av| 一本大道综合伊人精品热热| 欧美国产国产综合| 国产精品一线二线三线| www日韩大片| 韩国欧美国产一区| 日韩三区在线观看| 美女视频一区在线观看| 欧美一级在线观看| 久久狠狠亚洲综合| 欧美一卡二卡在线| 男人的j进女人的j一区| 欧美一级欧美三级在线观看 | 岛国一区二区三区| 国产欧美日韩久久| 成人免费视频播放| 国产精品国产三级国产普通话99 | 成人aa视频在线观看| 国产精品美女www爽爽爽| 成人午夜视频免费看| 中文字幕一区二区三区不卡在线 | 欧美日韩视频在线观看一区二区三区 | 欧美日韩专区在线| 日本网站在线观看一区二区三区| 日韩三级免费观看| 国产自产v一区二区三区c| 国产欧美视频一区二区| 国产成人精品亚洲午夜麻豆| 亚洲国产成人午夜在线一区 | 久久久亚洲高清| 东方aⅴ免费观看久久av| 国产精品初高中害羞小美女文| 99国产精品国产精品毛片| 亚洲美女屁股眼交3| 在线播放欧美女士性生活| 日本三级韩国三级欧美三级| 久久久久久久久久久黄色| 北岛玲一区二区三区四区| 亚洲裸体在线观看| 欧美疯狂做受xxxx富婆| 老鸭窝一区二区久久精品| 久久精子c满五个校花| 99久久亚洲一区二区三区青草| 一区二区三区视频在线看| 91麻豆精品国产91久久久久久久久 | 久久久久久久久久久久久夜| 99国产精品久久久| 日韩综合小视频| 久久理论电影网| av电影在线观看一区| 日本在线不卡视频| 国产精品伦一区| 欧美日韩一卡二卡三卡| 国产精品一区二区在线观看网站| 亚洲天堂福利av| 精品少妇一区二区三区免费观看| 成人av综合在线| 免费在线观看一区二区三区| 欧美国产激情一区二区三区蜜月| 欧美日韩国产高清一区二区三区 | 国产欧美日韩中文久久| 色哦色哦哦色天天综合| 久久97超碰色| 亚洲自拍偷拍网站| 国产欧美日韩另类视频免费观看 | 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 亚洲第一主播视频| 国产欧美一区视频| 在线不卡免费欧美| 91免费看`日韩一区二区| 久99久精品视频免费观看| 夜夜亚洲天天久久| 国产欧美日韩一区二区三区在线观看| 欧美色涩在线第一页| 国模少妇一区二区三区| 亚洲国产日韩在线一区模特| 中文字幕亚洲一区二区va在线| 日韩一区二区在线观看视频播放| 91亚洲精品一区二区乱码| 国产资源在线一区| 男女男精品视频网|