Package org.apache.lucene.store

Examples of org.apache.lucene.store.SimpleFSLockFactory


     * @throws java.io.IOException if an error occurs while creating
     * directories
     */
    public IndexDatabase(Project project) throws IOException {
        this.project = project;
        lockfact = new SimpleFSLockFactory();
        initialize();
    }
View Full Code Here


  public void testWhetherDeleteAllDeletesWriteLock() throws Exception {
    Directory d = newFSDirectory(createTempDir("TestIndexWriter.testWhetherDeleteAllDeletesWriteLock"));
    // Must use SimpleFSLockFactory... NativeFSLockFactory
    // somehow "knows" a lock is held against write.lock
    // even if you remove that file:
    d.setLockFactory(new SimpleFSLockFactory());
    RandomIndexWriter w1 = new RandomIndexWriter(random(), d);
    w1.deleteAll();
    try {
      new RandomIndexWriter(random(), d, newIndexWriterConfig(TEST_VERSION_CURRENT, null).setWriteLockTimeout(100));
      fail("should not be able to create another writer");
View Full Code Here

            } else {

                try {
                    this.dir =
                        FSDirectory.getDirectory(new File(this.indexDirectoryPath),
                                        new SimpleFSLockFactory(this.indexDirectoryPath));

                } catch (IOException e) {
                    System.err.println("Could not open index at " + this.indexDirectoryPath);

                    throw e;
View Full Code Here

    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir==null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set");
      }
      try {
        return new SimpleFSLockFactory( indexDir );
      } catch (IOException e) {
        throw new SearchException( "Could not initialize SimpleFSLockFactory", e);
      }
    }
    else if ( "native".equals( lockFactoryName ) ) {
View Full Code Here

    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new SimpleFSLockFactory( indexDir );
      }
      catch ( IOException e ) {
        throw new SearchException( "Could not initialize SimpleFSLockFactory", e );
      }
    }
View Full Code Here

    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new SimpleFSLockFactory( indexDir );
      }
      catch (IOException e) {
        throw new SearchException( "Could not initialize SimpleFSLockFactory", e );
      }
    }
View Full Code Here

    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir==null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set");
      }
      try {
        return new SimpleFSLockFactory( indexDir );
      } catch (IOException e) {
        throw new SearchException( "Could not initialize SimpleFSLockFactory", e);
      }
    }
    else if ( "native".equals( lockFactoryName ) ) {
View Full Code Here

    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new SimpleFSLockFactory( indexDir );
      }
      catch ( IOException e ) {
        throw new SearchException( "Could not initialize SimpleFSLockFactory", e );
      }
    }
View Full Code Here

  public void testWhetherDeleteAllDeletesWriteLock() throws Exception {
    Directory d = newFSDirectory(_TestUtil.getTempDir("TestIndexWriter.testWhetherDeleteAllDeletesWriteLock"));
    // Must use SimpleFSLockFactory... NativeFSLockFactory
    // somehow "knows" a lock is held against write.lock
    // even if you remove that file:
    d.setLockFactory(new SimpleFSLockFactory());
    RandomIndexWriter w1 = new RandomIndexWriter(random, d);
    w1.deleteAll();
    try {
      new RandomIndexWriter(random, d, newIndexWriterConfig(TEST_VERSION_CURRENT, null).setWriteLockTimeout(100));
      fail("should not be able to create another writer");
View Full Code Here

    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set" );
      }
      try {
        return new SimpleFSLockFactory( indexDir );
      }
      catch ( IOException e ) {
        throw new SearchException( "Could not initialize SimpleFSLockFactory", e );
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.SimpleFSLockFactory

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.