Package org.apache.lucene.store

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


          // Open & close a writer and assert that it
          // actually removed something:
          int preCount = dir.list().length;
          writer = new IndexWriter(dir, false, new WhitespaceAnalyzer(), false, policy);
          writer.close();
          int postCount = dir.list().length;
          assertTrue(postCount < preCount);
        }
      }

      dir.close();
View Full Code Here


    reader.setNorm(21, "content", (float) 1.5);
    reader.close();

    // Now, artificially create an extra .del file & extra
    // .s0 file:
    String[] files = dir.list();

    /*
    for(int i=0;i<files.length;i++) {
      System.out.println(i + ": " + files[i]);
    }
View Full Code Here

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

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

    String[] filesPre = dir.list();

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

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

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

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

    reader.setNorm(21, "content", (float) 1.5);
    reader.close();

    // Now, artificially create an extra .del file & extra
    // .s0 file:
    String[] files = dir.list();

    /*
    for(int i=0;i<files.length;i++) {
      System.out.println(i + ": " + files[i]);
    }
View Full Code Here

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

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

    String[] filesPre = dir.list();

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

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

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

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

        if (gen > 0) {
          // Now that we've removed a commit point, which
          // should have orphan'd at least one index file.
          // Open & close a writer and assert that it
          // actually removed something:
          int preCount = dir.list().length;
          writer = new IndexWriter(dir, false, new WhitespaceAnalyzer(), false, policy);
          writer.close();
          int postCount = dir.list().length;
          assertTrue(postCount < preCount);
        }
View Full Code Here

          // Open & close a writer and assert that it
          // actually removed something:
          int preCount = dir.list().length;
          writer = new IndexWriter(dir, false, new WhitespaceAnalyzer(), false, policy);
          writer.close();
          int postCount = dir.list().length;
          assertTrue(postCount < preCount);
        }
      }

      dir.close();
View Full Code Here

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

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

      for(int iter=0;iter<6;iter++) {
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.