Search in sources :

Example 1 with RawDirectoryWrapper

use of org.apache.lucene.store.RawDirectoryWrapper in project lucene-solr by apache.

the class LuceneTestCase method wrapDirectory.

private static BaseDirectoryWrapper wrapDirectory(Random random, Directory directory, boolean bare) {
    if (rarely(random) && !bare) {
        directory = new NRTCachingDirectory(directory, random.nextDouble(), random.nextDouble());
    }
    if (bare) {
        BaseDirectoryWrapper base = new RawDirectoryWrapper(directory);
        closeAfterSuite(new CloseableDirectory(base, suiteFailureMarker));
        return base;
    } else {
        MockDirectoryWrapper mock = new MockDirectoryWrapper(random, directory);
        mock.setThrottling(TEST_THROTTLING);
        closeAfterSuite(new CloseableDirectory(mock, suiteFailureMarker));
        return mock;
    }
}
Also used : MockDirectoryWrapper(org.apache.lucene.store.MockDirectoryWrapper) RawDirectoryWrapper(org.apache.lucene.store.RawDirectoryWrapper) BaseDirectoryWrapper(org.apache.lucene.store.BaseDirectoryWrapper) NRTCachingDirectory(org.apache.lucene.store.NRTCachingDirectory)

Aggregations

BaseDirectoryWrapper (org.apache.lucene.store.BaseDirectoryWrapper)1 MockDirectoryWrapper (org.apache.lucene.store.MockDirectoryWrapper)1 NRTCachingDirectory (org.apache.lucene.store.NRTCachingDirectory)1 RawDirectoryWrapper (org.apache.lucene.store.RawDirectoryWrapper)1