@Override @Test @Disabled public void clearStorageTest() throws Exception { super.clearStorageTest(); }
@Override public void clearStorage() throws BackendException { try { if (mode!=Mode.CLOUD) { logger.error("Operation only supported for SolrCloud. Cores must be deleted manually through the Solr API when using HTTP mode."); return; } logger.debug("Clearing storage from Solr: {}", solrClient); final ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader(); zkStateReader.forciblyRefreshAllClusterStateSlow(); final ClusterState clusterState = zkStateReader.getClusterState(); for (final String collection : clusterState.getCollectionsMap().keySet()) { logger.debug("Clearing collection [{}] in Solr",collection); final UpdateRequest deleteAll = newUpdateRequest(); deleteAll.deleteByQuery("*:*"); solrClient.request(deleteAll, collection); } } catch (final SolrServerException e) { logger.error("Unable to clear storage from index due to server error on Solr.", e); throw new PermanentBackendException(e); } catch (final IOException e) { logger.error("Unable to clear storage from index due to low-level I/O error.", e); throw new PermanentBackendException(e); } catch (final Exception e) { logger.error("Unable to clear storage from index due to general error.", e); throw new PermanentBackendException(e); } }
SolrIndex implements IndexProvider { @Override public void clearStorage() throws BackendException { try { if (mode!=Mode.CLOUD) { logger.error("Operation only supported for SolrCloud. Cores must be deleted manually through the Solr API when using HTTP mode."); return; } logger.debug("Clearing storage from Solr: {}", solrClient); final ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader(); zkStateReader.forciblyRefreshAllClusterStateSlow(); final ClusterState clusterState = zkStateReader.getClusterState(); for (final String collection : clusterState.getCollectionsMap().keySet()) { logger.debug("Clearing collection [{}] in Solr",collection); final UpdateRequest deleteAll = newUpdateRequest(); deleteAll.deleteByQuery("*:*"); solrClient.request(deleteAll, collection); } } catch (final SolrServerException e) { logger.error("Unable to clear storage from index due to server error on Solr.", e); throw new PermanentBackendException(e); } catch (final IOException e) { logger.error("Unable to clear storage from index due to low-level I/O error.", e); throw new PermanentBackendException(e); } catch (final Exception e) { logger.error("Unable to clear storage from index due to general error.", e); throw new PermanentBackendException(e); } } }
SolrIndex implements IndexProvider { @Override public void clearStorage() throws BackendException { try { if (mode!=Mode.CLOUD) { logger.error("Operation only supported for SolrCloud. Cores must be deleted manually through the Solr API when using HTTP mode."); return; } logger.debug("Clearing storage from Solr: {}", solrClient); final ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader(); zkStateReader.forciblyRefreshAllClusterStateSlow(); final ClusterState clusterState = zkStateReader.getClusterState(); for (final String collection : clusterState.getCollectionsMap().keySet()) { logger.debug("Clearing collection [{}] in Solr",collection); final UpdateRequest deleteAll = newUpdateRequest(); deleteAll.deleteByQuery("*:*"); solrClient.request(deleteAll, collection); } } catch (final SolrServerException e) { logger.error("Unable to clear storage from index due to server error on Solr.", e); throw new PermanentBackendException(e); } catch (final IOException e) { logger.error("Unable to clear storage from index due to low-level I/O error.", e); throw new PermanentBackendException(e); } catch (final Exception e) { logger.error("Unable to clear storage from index due to general error.", e); throw new PermanentBackendException(e); } } SolrIndex(final Configuration config); }
SolrIndex implements IndexProvider { @Override public void clearStorage() throws BackendException { try { if (mode!=Mode.CLOUD) { logger.error("Operation only supported for SolrCloud. Cores must be deleted manually through the Solr API when using HTTP mode."); return; } logger.debug("Clearing storage from Solr: {}", solrClient); final ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader(); zkStateReader.forciblyRefreshAllClusterStateSlow(); final ClusterState clusterState = zkStateReader.getClusterState(); for (final String collection : clusterState.getCollectionsMap().keySet()) { logger.debug("Clearing collection [{}] in Solr",collection); final UpdateRequest deleteAll = newUpdateRequest(); deleteAll.deleteByQuery("*:*"); solrClient.request(deleteAll, collection); } } catch (final SolrServerException e) { logger.error("Unable to clear storage from index due to server error on Solr.", e); throw new PermanentBackendException(e); } catch (final IOException e) { logger.error("Unable to clear storage from index due to low-level I/O error.", e); throw new PermanentBackendException(e); } catch (final Exception e) { logger.error("Unable to clear storage from index due to general error.", e); throw new PermanentBackendException(e); } } SolrIndex(final Configuration config); @SuppressWarnings("unchecked") @Override void register(String store, String key, KeyInformation information, BaseTransaction tx); @Override void mutate(Map<String, Map<String, IndexMutation>> mutations, KeyInformation.IndexRetriever information,
                       BaseTransaction tx); @Override void restore(Map<String, Map<String, List<IndexEntry>>> documents,
                        KeyInformation.IndexRetriever information, BaseTransaction tx); @Override Stream<String> query(IndexQuery query, KeyInformation.IndexRetriever information,
                                BaseTransaction tx); @Override Stream<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever information,
                                                 BaseTransaction tx); @Override Long totals(RawQuery query, KeyInformation.IndexRetriever information,
                       BaseTransaction tx); String buildQueryFilter(Condition<JanusGraphElement> condition, KeyInformation.StoreRetriever information); @Override BaseTransactionConfigurable beginTransaction(BaseTransactionConfig config); @Override void close(); @Override void clearStorage(); @Override boolean supports(KeyInformation information, JanusGraphPredicate predicate); @Override boolean supports(KeyInformation information); @Override String mapKey2Field(String key, KeyInformation keyInfo); @Override IndexFeatures getFeatures(); @Override boolean exists(); }
SolrIndex implements IndexProvider { @Override public void clearStorage() throws BackendException { try { if (mode!=Mode.CLOUD) { logger.error("Operation only supported for SolrCloud. Cores must be deleted manually through the Solr API when using HTTP mode."); return; } logger.debug("Clearing storage from Solr: {}", solrClient); final ZkStateReader zkStateReader = ((CloudSolrClient) solrClient).getZkStateReader(); zkStateReader.forciblyRefreshAllClusterStateSlow(); final ClusterState clusterState = zkStateReader.getClusterState(); for (final String collection : clusterState.getCollectionsMap().keySet()) { logger.debug("Clearing collection [{}] in Solr",collection); final UpdateRequest deleteAll = newUpdateRequest(); deleteAll.deleteByQuery("*:*"); solrClient.request(deleteAll, collection); } } catch (final SolrServerException e) { logger.error("Unable to clear storage from index due to server error on Solr.", e); throw new PermanentBackendException(e); } catch (final IOException e) { logger.error("Unable to clear storage from index due to low-level I/O error.", e); throw new PermanentBackendException(e); } catch (final Exception e) { logger.error("Unable to clear storage from index due to general error.", e); throw new PermanentBackendException(e); } } SolrIndex(final Configuration config); @SuppressWarnings("unchecked") @Override void register(String store, String key, KeyInformation information, BaseTransaction tx); @Override void mutate(Map<String, Map<String, IndexMutation>> mutations, KeyInformation.IndexRetriever information,
                       BaseTransaction tx); @Override void restore(Map<String, Map<String, List<IndexEntry>>> documents,
                        KeyInformation.IndexRetriever information, BaseTransaction tx); @Override Stream<String> query(IndexQuery query, KeyInformation.IndexRetriever information,
                                BaseTransaction tx); @Override Stream<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever information,
                                                 BaseTransaction tx); @Override Long totals(RawQuery query, KeyInformation.IndexRetriever information,
                       BaseTransaction tx); String buildQueryFilter(Condition<JanusGraphElement> condition, KeyInformation.StoreRetriever information); @Override BaseTransactionConfigurable beginTransaction(BaseTransactionConfig config); @Override void close(); @Override void clearStorage(); @Override boolean supports(KeyInformation information, JanusGraphPredicate predicate); @Override boolean supports(KeyInformation information); @Override String mapKey2Field(String key, KeyInformation keyInfo); @Override IndexFeatures getFeatures(); @Override boolean exists(); static final ConfigNamespace SOLR_NS; static final ConfigOption<String> SOLR_MODE; static final ConfigOption<Boolean> DYNAMIC_FIELDS; static final ConfigOption<String[]> KEY_FIELD_NAMES; static final ConfigOption<String> TTL_FIELD; static final ConfigOption<String[]> ZOOKEEPER_URL; static final ConfigOption<Integer> NUM_SHARDS; static final ConfigOption<Integer> MAX_SHARDS_PER_NODE; static final ConfigOption<Integer> REPLICATION_FACTOR; static final ConfigOption<String> SOLR_DEFAULT_CONFIG; static final ConfigOption<String[]> HTTP_URLS; static final ConfigOption<Integer> HTTP_CONNECTION_TIMEOUT; static final ConfigOption<Boolean> HTTP_ALLOW_COMPRESSION; static final ConfigOption<Integer> HTTP_MAX_CONNECTIONS_PER_HOST; static final ConfigOption<Integer> HTTP_GLOBAL_MAX_CONNECTIONS; static final ConfigOption<Boolean> WAIT_SEARCHER; static final ConfigOption<Boolean> KERBEROS_ENABLED; }