Package org.apache.lucene.index

Examples of org.apache.lucene.index.IndexCommitPoint


   *  just to test that the files indeed exist and are
   *  readable even while the index is changing. */
  public void backupIndex(Directory dir, SnapshotDeletionPolicy dp) throws IOException {

    // To backup an index we first take a snapshot:
    IndexCommitPoint cp = dp.snapshot();
    try {

      // While we hold the snapshot, and nomatter how long
      // we take to do the backup, the IndexWriter will
      // never delete the files in the snapshot:
      Collection files = cp.getFileNames();
      Iterator it = files.iterator();
      while(it.hasNext()) {
        final String fileName = (String) it.next();
        // NOTE: in a real backup you would not use
        // readFile; you would need to use something else
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.IndexCommitPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.