Package org.apache.lucene.store

Examples of org.apache.lucene.store.SimpleFSLockFactory


    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


        throw new LockObtainFailedException(msg);
      }
    } else {
      try {
        File fDir = new File(this.luceneConfig.getIndexLocation());
        SimpleFSLockFactory factory = new SimpleFSLockFactory(fDir);
        factory.setLockPrefix("lucene-simple");
        lock = factory.makeLock(BACKGROUND_LOCKNAME);
      } catch (IOException e) {
        String msg = pfx+" "+e.getMessage();
        getLogger().log(Level.WARNING,pfx,e);
        throw new LockObtainFailedException(msg);
      }
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

    String lockFactoryName = dirConfiguration.getProperty( LOCKING_STRATEGY_PROP_NAME, defaultStrategy );
    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set" );
      }
      return new SimpleFSLockFactory( indexDir );
    }
    else if ( "native".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"native\" as a LockFactory strategy an indexBase path must be set" );
      }
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

     * @param project the project to create the database for
     * @throws java.io.IOException if an error occurs while creating directories
     */
    public IndexDatabase(Project project) throws IOException {
        this.project = project;
        lockFactory = new SimpleFSLockFactory();
        initialize();
    }
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

    String lockFactoryName = dirConfiguration.getProperty( LOCKING_STRATEGY_PROP_NAME, defaultStrategy );
    if ( "simple".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"simple\" as a LockFactory strategy an indexBase path must be set" );
      }
      return new SimpleFSLockFactory( indexDir );
    }
    else if ( "native".equals( lockFactoryName ) ) {
      if ( indexDir == null ) {
        throw new SearchException( "To use \"native\" as a LockFactory strategy an indexBase path must be set" );
      }
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.