Examples of fileExists()


Examples of org.apache.lucene.store.Directory.fileExists()

    // Create a bogus cfs file shadowing a non-cfs segment:
   
    // TODO: assert is bogus (relies upon codec-specific filenames)
    assertTrue(dir.fileExists("_3.fdt") || dir.fileExists("_3.fld"));
    assertTrue(!dir.fileExists("_3.cfs"));
    copyFile(dir, "_1.cfs", "_3.cfs");
   
    String[] filesPre = dir.listAll();

    // Open & close a writer: it should delete the above 4
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

        delTerm = new Term("id", "x" + count);
      }
      w.updateDocument(delTerm, doc);
      // Eventually segment 0 should get a del docs:
      // TODO: fix this test
      if (dir.fileExists("_0_1.del") || dir.fileExists("_0_1.liv") ) {
        if (VERBOSE) {
          System.out.println("TEST: deletes created @ count=" + count);
        }
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

        delTerm = new Term("id", "x" + count);
      }
      w.updateDocument(delTerm, doc);
      // Eventually segment 0 should get a del docs:
      // TODO: fix this test
      if (dir.fileExists("_0_1.del") || dir.fileExists("_0_1.liv") ) {
        if (VERBOSE) {
          System.out.println("TEST: deletes created @ count=" + count);
        }
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

        delTerm = new Term("id", "x" + count);
      }
      w.updateDocument(delTerm, doc);
      // Eventually segment 0 should get a del docs:
      // TODO: fix this test
      if (dir.fileExists("_0_1.del") || dir.fileExists("_0_1.liv")) {
        break;
      }
      count++;
      if (count > flushAtDelCount) {
        fail("delete's were not applied at count=" + flushAtDelCount);
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

        delTerm = new Term("id", "x" + count);
      }
      w.updateDocument(delTerm, doc);
      // Eventually segment 0 should get a del docs:
      // TODO: fix this test
      if (dir.fileExists("_0_1.del") || dir.fileExists("_0_1.liv")) {
        break;
      }
      count++;
      if (count > flushAtDelCount) {
        fail("delete's were not applied at count=" + flushAtDelCount);
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

      doc.add(newStringField("id", ""+id, Field.Store.NO));
      doc.add(newTextField("body", sb.toString(), Field.Store.NO));
      w.updateDocument(new Term("id", ""+id), doc);
      docsInSegment.incrementAndGet();
      // TODO: fix this test
      if (dir.fileExists("_0_1.del") || dir.fileExists("_0_1.liv")) {
        if (VERBOSE) {
          System.out.println("TEST: deletes created @ id=" + id);
        }
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

      doc.add(newStringField("id", ""+id, Field.Store.NO));
      doc.add(newTextField("body", sb.toString(), Field.Store.NO));
      w.updateDocument(new Term("id", ""+id), doc);
      docsInSegment.incrementAndGet();
      // TODO: fix this test
      if (dir.fileExists("_0_1.del") || dir.fileExists("_0_1.liv")) {
        if (VERBOSE) {
          System.out.println("TEST: deletes created @ id=" + id);
        }
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

    assertSnapshotExists(dir, sdp, numSnapshots - 1, false);
    writer.close();

    // but 'snapshot1' files will still exist (need to release snapshot before they can be deleted).
    String segFileName = snapshots.get(1).getSegmentsFileName();
    assertTrue("snapshot files should exist in the directory: " + segFileName, dir.fileExists(segFileName));

    dir.close();
  }

  @Test
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

    // Release
    String segFileName = snapshots.get(0).getSegmentsFileName();
    sdp.release(snapshots.get(0));
    writer.deleteUnusedFiles();
    writer.close();
    assertFalse("segments file should not be found in dirctory: " + segFileName, dir.fileExists(segFileName));
    dir.close();
  }

  @Test
  public void testSnapshotLastCommitTwice() throws Exception {
View Full Code Here

Examples of org.apache.lucene.store.FSDirectory.fileExists()

        // Make sure we really did close the dir inside IndexReader.open
        dir.close();

        try {
          dir.fileExists("hi");
          fail("did not hit expected exception");
        } catch (AlreadyClosedException ace) {
          // expected
        }
      } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.