private void prepareCleanIndex( boolean deleteExisting ) throws IOException { if ( deleteExisting ) { closeReaders(); // unlock the dir forcibly if ( IndexWriter.isLocked( indexDirectory ) ) { IndexWriter.unlock( indexDirectory ); } deleteIndexFiles( true ); } openAndWarmup(); if ( StringUtils.isEmpty( getRepositoryId() ) ) { throw new IllegalArgumentException( "The repositoryId cannot be null when creating new repository!" ); } storeDescriptor(); }
private void prepareCleanIndex( boolean deleteExisting ) throws IOException { if ( deleteExisting ) { closeReaders(); // unlock the dir forcibly if ( IndexWriter.isLocked( indexDirectory ) ) { unlockForcibly( lockFactory, indexDirectory ); } deleteIndexFiles( true ); } openAndWarmup(); if ( StringUtils.isEmpty( getRepositoryId() ) ) { throw new IllegalArgumentException( "The repositoryId cannot be null when creating new repository!" ); } storeDescriptor(); }
private void prepareCleanIndex( boolean deleteExisting ) throws IOException { if ( deleteExisting ) { closeReaders(); // unlock the dir forcibly if ( IndexWriter.isLocked( indexDirectory ) ) { unlockForcibly( lockFactory, indexDirectory ); } deleteIndexFiles( true ); } openAndWarmup(); if ( StringUtils.isEmpty( getRepositoryId() ) ) { throw new IllegalArgumentException( "The repositoryId cannot be null when creating new repository!" ); } storeDescriptor(); }
storeDescriptor(); return; storeDescriptor(); return;
storeDescriptor(); return; storeDescriptor(); return;
storeDescriptor(); return; storeDescriptor(); return;
public synchronized void replace( Directory directory ) throws IOException { final Date ts = IndexUtils.getTimestamp( directory ); closeReaders(); deleteIndexFiles( false ); IndexUtils.copyDirectory( directory, indexDirectory ); openAndWarmup(); // reclaim the index as mine storeDescriptor(); rebuildGroups(); updateTimestamp( true, ts ); optimize(); }
public synchronized void replace( Directory directory, Set<String> allGroups, Set<String> rootGroups ) throws IOException { final Date ts = IndexUtils.getTimestamp( directory ); closeReaders(); deleteIndexFiles( false ); IndexUtils.copyDirectory( directory, indexDirectory ); openAndWarmup(); // reclaim the index as mine storeDescriptor(); if ( allGroups == null && rootGroups == null ) { rebuildGroups(); } else { if ( allGroups != null ) { setAllGroups( allGroups ); } if ( rootGroups != null ) { setRootGroups( rootGroups ); } } updateTimestamp( true, ts ); optimize(); }
public synchronized void replace( Directory directory, Set<String> allGroups, Set<String> rootGroups ) throws IOException { final Date ts = IndexUtils.getTimestamp( directory ); closeReaders(); deleteIndexFiles( false ); IndexUtils.copyDirectory( directory, indexDirectory ); openAndWarmup(); // reclaim the index as mine storeDescriptor(); if ( allGroups == null && rootGroups == null ) { rebuildGroups(); } else { if ( allGroups != null ) { setAllGroups( allGroups ); } if ( rootGroups != null ) { setRootGroups( rootGroups ); } } updateTimestamp( true, ts ); optimize(); }