DirectoryFactory implements LuceneIndexFactory { @Override public LuceneIndex newCluster(final KCluster kcluster) { checkCondition("Cluster already exists", !clusters.containsKey(checkNotNull("kcluster", kcluster))); final LuceneIndex newIndex = type.newIndex(kcluster, newConfig(analyzer)); clusters.put(kcluster, newIndex); return newIndex; } DirectoryFactory(final DirectoryType type,
                            final Analyzer analyzer);  DirectoryFactory(final DirectoryType type,
                            final Analyzer analyzer,
                            final File hostingDir); static File defaultHostingDir(); @Override LuceneIndex newCluster(final KCluster kcluster); @Override void remove(KCluster cluster); @Override Map<? extends KCluster, ? extends LuceneIndex> getIndexes(); @Override synchronized void dispose(); static final String CLUSTER_ID_SEGMENT_SEPARATOR; }
@Test(expected = IllegalStateException.class) public void loadsExistingIndicesOnStartup() throws Exception { KCluster kcluster = new KClusterImpl("myteam/myproject/master"); factory.newCluster(kcluster); }