Package org.apache.lucene.store

Examples of org.apache.lucene.store.FSDirectory$FSIndexInput$Descriptor


   @Test
   public void profileTestFSDirectory() throws InterruptedException, IOException {
      File indexDir = new File(new File("."), indexName);
      boolean directoriesCreated = indexDir.mkdirs();
      assert directoriesCreated : "couldn't create directory for FSDirectory test";
      FSDirectory dir = FSDirectory.open(indexDir);
      testDirectory(dir, "FSDirectory");
   }
View Full Code Here


      File subDir = new File(rootDir, indexName);
      boolean directoriesCreated = subDir.mkdir();
      assert directoriesCreated : "couldn't create directory for test";

      //We need at least one Directory to exist on filesystem to trigger the problem
      FSDirectory luceneDirectory = FSDirectory.open(subDir);
      luceneDirectory.close();
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder
         .loaders()
            .addLoader()
               .cacheLoader( new LuceneCacheLoader() )
View Full Code Here

   * @throws java.io.IOException if an error
   */
  public static FSDirectory createFSIndex(File indexDir, Properties properties) throws IOException {
    LockFactory lockFactory = createLockFactory( indexDir, properties );
    FSDirectoryType fsDirectoryType = FSDirectoryType.getType( properties );
    FSDirectory fsDirectory = fsDirectoryType.getDirectory( indexDir, null );

    // must use the setter (instead of using the constructor) to set the lockFactory, or Lucene will
    // throw an exception if it's different than a previous setting.
    fsDirectory.setLockFactory( lockFactory );
    log.debugf( "Initialize index: '%s'", indexDir.getAbsolutePath() );
    initializeIndexIfNeeded( fsDirectory );
    return fsDirectory;
  }
View Full Code Here

   * @throws IOException if an error
   */
  public static FSDirectory createFSIndex(File indexDir, Properties properties) throws IOException {
    LockFactory lockFactory = createLockFactory( indexDir, properties );
    FSDirectoryType fsDirectoryType = FSDirectoryType.getType( properties );
    FSDirectory fsDirectory = fsDirectoryType.getDirectory( indexDir, null );

    // must use the setter (instead of using the constructor) to set the lockFactory, or Lucene will
    // throw an exception if it's different than a previous setting.
    fsDirectory.setLockFactory( lockFactory );
    log.debugf( "Initialize index: '%s'", indexDir.getAbsolutePath() );
    initializeIndexIfNeeded( fsDirectory );
    return fsDirectory;
  }
View Full Code Here

      if (adapter == null) {
         synchronized (openDirectories) {
            adapter = openDirectories.get(indexName);
            if (adapter == null) {
               final File path = new File(this.rootDirectory, indexName);
               final FSDirectory directory = openLuceneDirectory(path);
               final InternalDirectoryContract wrapped = ContractAdaptorFactory.wrapNativeDirectory(directory);
               adapter = new DirectoryLoaderAdaptor(wrapped, indexName, autoChunkSize);
               openDirectories.put(indexName, adapter);
            }
         }
View Full Code Here

      if (adapter == null) {
         synchronized (openDirectories) {
            adapter = openDirectories.get(indexName);
            if (adapter == null) {
               final File path = new File(this.rootDirectory, indexName);
               final FSDirectory directory = openLuceneDirectory(path);
               adapter = new DirectoryLoaderAdaptor(directory, indexName, autoChunkSize);
               openDirectories.put(indexName, adapter);
            }
         }
      }
View Full Code Here

   * @throws IOException if an error
   */
  public static FSDirectory createFSIndex(File indexDir, Properties properties) throws IOException {
    LockFactory lockFactory = createLockFactory( indexDir, properties );
    FSDirectoryType fsDirectoryType = FSDirectoryType.getType( properties );
    FSDirectory fsDirectory = fsDirectoryType.getDirectory( indexDir, null );

    // must use the setter (instead of using the constructor) to set the lockFactory, or Lucene will
    // throw an exception if it's different than a previous setting.
    fsDirectory.setLockFactory( lockFactory );
    log.debugf( "Initialize index: '%s'", indexDir.getAbsolutePath() );
    initializeIndexIfNeeded( fsDirectory );
    return fsDirectory;
  }
View Full Code Here

   * @throws IOException if an error
   */
  public static FSDirectory createFSIndex(File indexDir, Properties properties) throws IOException {
    LockFactory lockFactory = createLockFactory( indexDir, properties );
    FSDirectoryType fsDirectoryType = FSDirectoryType.getType( properties );
    FSDirectory fsDirectory = fsDirectoryType.getDirectory( indexDir, null );

    // must use the setter (instead of using the constructor) to set the lockFactory, or Lucene will
    // throw an exception if it's different than a previous setting.
    fsDirectory.setLockFactory( lockFactory );
    log.debug( "Initialize index: '{}'", indexDir.getAbsolutePath() );
    initializeIndexIfNeeded( fsDirectory );
    return fsDirectory;
  }
View Full Code Here

    tableDescriptor.putToTableProperties("blur.shard.time.between.refreshs", Long.toString(refresh));

    TableContext tableContext = TableContext.create(tableDescriptor);
    File path = new File(base, "index_" + uuid);
    path.mkdirs();
    FSDirectory directory = FSDirectory.open(path);
    ShardContext shardContext = ShardContext.create(tableContext, "test-shard-" + uuid);
    writer = new BlurNRTIndex(shardContext, mergeScheduler, closer, directory, gc, service);
  }
View Full Code Here

    infos.commit(fsDir);
  }

  public void split(File destDir, String[] segs) throws IOException {
    destDir.mkdirs();
    FSDirectory destFSDir = FSDirectory.open(destDir);
    SegmentInfos destInfos = new SegmentInfos();
    for (String n : segs) {
      SegmentInfo info = getInfo(n);
      destInfos.add(info);
      // now copy files over
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.FSDirectory$FSIndexInput$Descriptor

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.