@Override protected IndexRepository getRepository(Integer bucketId) throws BucketNotFoundException { IndexRepository repo = indexRepositories.get(bucketId); if (repo != null && !repo.isClosed()) { return repo; } repo = computeRepository(bucketId); return repo; }
/** * Return the repository for a given user bucket */ protected IndexRepository getRepository(Integer bucketId) throws BucketNotFoundException { IndexRepository repo = indexRepositories.get(bucketId); if (repo != null && !repo.isClosed()) { return repo; } repo = computeRepository(bucketId); if (repo == null) { throw new BucketNotFoundException( "Unable to find lucene index because no longer primary for bucket " + bucketId); } return repo; }
if (oldRepository != null && !oldRepository.isClosed()) { return oldRepository;