Package com.bah.lucene

Examples of com.bah.lucene.BlockCacheDirectoryFactoryV2


*/
public class WriteReadPerformanceTest {

    public static void main(String[] args) throws Exception {
        HdfsDirectory hdfsDirectory = new HdfsDirectory(new Configuration(), new Path("hdfs://localhost/index"));
        Directory directory = new BlockCacheDirectoryFactoryV2(new Configuration(), 1000000).newDirectory(
                "index", "shard1", hdfsDirectory, null
        );

        String[] names = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
                "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
View Full Code Here


            fileSystem.mkdirs(localIndexPath);
            fileSystem.copyFromLocalFile(new Path(localDir.getAbsolutePath() + "/"), localIndexPath);
            Path hdfsIndexPath = fileSystem.listStatus(localIndexPath)[0].getPath();

            HdfsDirectory hdfsDirectory = new HdfsDirectory(conf, hdfsIndexPath);
            Directory directory = new BlockCacheDirectoryFactoryV2(new Configuration(), 1000000).newDirectory(
                    "index", "shard1", hdfsDirectory, null
            );

            try (DirectoryReader reader = DirectoryReader.open(directory)) {
                IndexSearcher indexSearcher = new IndexSearcher(reader);
View Full Code Here

TOP

Related Classes of com.bah.lucene.BlockCacheDirectoryFactoryV2

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.