Examples of listAll()


Examples of org.apache.lucene.store.RAMDirectory.listAll()

    copyFile(dir, "segments_3", "segments_2");

    // Create a bogus cfs file shadowing a non-cfs segment:
    copyFile(dir, "_2.cfs", "_3.cfs");

    String[] filesPre = dir.listAll();

    // Open & close a writer: it should delete the above 4
    // files and nothing more:
    writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
    writer.close();
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

    // Open & close a writer: it should delete the above 4
    // files and nothing more:
    writer = new IndexWriter(dir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
    writer.close();

    String[] files2 = dir.listAll();
    dir.close();

    Arrays.sort(files);
    Arrays.sort(files2);
   
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

      // String[] files = startDir.listAll();
      long diskUsage = startDir.sizeInBytes();

      long startDiskUsage = 0;
      String[] files = startDir.listAll();
      for(int i=0;i<files.length;i++) {
        startDiskUsage += startDir.fileLength(files[i]);
      }

      for(int iter=0;iter<3;iter++) {
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

        writer.close();

        long gen = SegmentInfos.getCurrentSegmentGeneration(dir);
        assertTrue("segment generation should be > 1 but got " + gen, gen > 1);

        String[] files = dir.listAll();
        for(int i=0;i<files.length;i++) {
          if (files[i].endsWith(".cfs")) {
            dir.deleteFile(files[i]);
            break;
          }
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

    public void testSmallRAMBuffer() throws IOException {
      RAMDirectory dir = new RAMDirectory();     
      IndexWriter writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
      writer.setRAMBufferSizeMB(0.000001);
      int lastNumFile = dir.listAll().length;
      for(int j=0;j<9;j++) {
        Document doc = new Document();
        doc.add(new Field("field", "aaa" + j, Field.Store.YES, Field.Index.ANALYZED));
        writer.addDocument(doc);
        int numFile = dir.listAll().length;
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

      int lastNumFile = dir.listAll().length;
      for(int j=0;j<9;j++) {
        Document doc = new Document();
        doc.add(new Field("field", "aaa" + j, Field.Store.YES, Field.Index.ANALYZED));
        writer.addDocument(doc);
        int numFile = dir.listAll().length;
        // Verify that with a tiny RAM buffer we see new
        // segment after every doc
        assertTrue(numFile > lastNumFile);
        lastNumFile = numFile;
      }
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

    lmp.setUseCompoundFile(true);
    IndexWriter w3 = new IndexWriter(dir, conf);
    w3.addIndexes(readers);
    w3.close();
   
    assertEquals("Only one compound segment should exist", 3, dir.listAll().length);
  }
  // LUCENE-2996: tests that addIndexes(IndexReader) applies existing deletes correctly.
  public void testExistingDeletes() throws Exception {
    Directory[] dirs = new Directory[2];
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

      // String[] files = startDir.listAll();
      long diskUsage = startDir.sizeInBytes();

      long startDiskUsage = 0;
      String[] files = startDir.listAll();
      for(int i=0;i<files.length;i++) {
        startDiskUsage += startDir.fileLength(files[i]);
      }

      for(int iter=0;iter<6;iter++) {
View Full Code Here

Examples of org.apache.lucene.store.RAMDirectory.listAll()

        writer.close();

        long gen = SegmentInfos.getCurrentSegmentGeneration(dir);
        assertTrue("segment generation should be > 1 but got " + gen, gen > 1);

        String[] files = dir.listAll();
        for(int i=0;i<files.length;i++) {
          if (files[i].endsWith(".cfs")) {
            dir.deleteFile(files[i]);
            break;
          }
View Full Code Here

Examples of org.apache.marmotta.ldcache.backend.kiwi.persistence.LDCachingKiWiPersistenceConnection.listAll()

            entry1.setTripleCount(1);
            connection.storeCacheEntry(entry1);

            connection.commit();

            Assert.assertEquals(1,asList(connection.listAll()).size());
            Assert.assertEquals(0,asList(connection.listExpired()).size());

            KiWiCacheEntry entry2 = new KiWiCacheEntry();
            entry2.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60));
            entry2.setLastRetrieved(new Date());
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.