diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java index 77327d9d76..bb30234f10 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/VariantStorageEngine.java @@ -34,7 +34,6 @@ import org.opencb.opencga.core.models.operations.variant.VariantAggregateFamilyParams; import org.opencb.opencga.core.models.operations.variant.VariantAggregateParams; import org.opencb.opencga.core.models.variant.VariantSetupParams; -import org.opencb.opencga.storage.core.variant.query.VariantQueryResult; import org.opencb.opencga.storage.core.StorageEngine; import org.opencb.opencga.storage.core.StoragePipelineResult; import org.opencb.opencga.storage.core.exceptions.StorageEngineException; @@ -60,6 +59,7 @@ import org.opencb.opencga.storage.core.variant.io.VariantWriterFactory.VariantOutputFormat; import org.opencb.opencga.storage.core.variant.query.ParsedVariantQuery; import org.opencb.opencga.storage.core.variant.query.VariantQueryParser; +import org.opencb.opencga.storage.core.variant.query.VariantQueryResult; import org.opencb.opencga.storage.core.variant.query.VariantQueryUtils; import org.opencb.opencga.storage.core.variant.query.executors.*; import org.opencb.opencga.storage.core.variant.score.VariantScoreFormatDescriptor; @@ -794,7 +794,7 @@ protected void searchIndexLoadedFiles(List inputFiles, ObjectMap options) t protected SolrInputDocumentDataWriter newVariantSearchDataWriter(String collection) throws StorageEngineException { return new SolrInputDocumentDataWriter(collection, - getVariantSearchManager().getSolrClient(), + getVariantSearchManager().getSolrManager().newSolrClient(configuration.getSearch().getWriteTimeout()), true, getVariantSearchManager().getInsertBatchSize()); } diff --git a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/search/solr/SolrInputDocumentDataWriter.java b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/search/solr/SolrInputDocumentDataWriter.java index 5673652e05..6dc3b605f3 100644 --- a/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/search/solr/SolrInputDocumentDataWriter.java +++ b/opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/search/solr/SolrInputDocumentDataWriter.java @@ -9,12 +9,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; import java.util.List; public class SolrInputDocumentDataWriter implements DataWriter { private final String collection; private final SolrClient solrClient; + private boolean closeSolrClient; private final int insertBatchSize; private int serverBufferSize = 0; private int insertedDocuments = 0; @@ -23,8 +25,13 @@ public class SolrInputDocumentDataWriter implements DataWriter batch) throws Exception { UpdateResponse response = solrClient.add(collection, batch); addTimeMs += response.getElapsedTime(); diff --git a/opencga-storage/opencga-storage-core/src/test/java/org/opencb/opencga/storage/core/variant/solr/VariantSolrExternalResource.java b/opencga-storage/opencga-storage-core/src/test/java/org/opencb/opencga/storage/core/variant/solr/VariantSolrExternalResource.java index dc5a019baa..0ccbfb3c5e 100644 --- a/opencga-storage/opencga-storage-core/src/test/java/org/opencb/opencga/storage/core/variant/solr/VariantSolrExternalResource.java +++ b/opencga-storage/opencga-storage-core/src/test/java/org/opencb/opencga/storage/core/variant/solr/VariantSolrExternalResource.java @@ -116,8 +116,7 @@ public VariantSearchManager configure(VariantStorageEngine variantStorageEngine) variantStorageEngine.getConfiguration().getSearch().setMode("core"); variantStorageEngine.getConfiguration().getSearch().setActive(true); VariantSearchManager variantSearchManager = variantStorageEngine.getVariantSearchManager(); - variantSearchManager.setSolrManager(new SolrManager(solrClient, "localhost", "core", - variantStorageEngine.getConfiguration().getSearch().getTimeout())); + variantSearchManager.setSolrManager(new SolrManager(solrClient, "localhost", "core")); variantSearchManager.setSolrClient(solrClient); return variantSearchManager; }