@Override public void swapIndexes(String indexName1, String indexName2) { if (!(isManagedIndex(indexName1) && isManagedIndex(indexName2))) { throw new IllegalArgumentException(String.format( "Both core names (%s,%s) must correspond to a managed index", indexName1, indexName2)); } server.swap(indexName1, indexName2); } }
@Override public void swapIndexes(String indexName1, String indexName2) { if (!(isManagedIndex(indexName1) && isManagedIndex(indexName2))) { throw new IllegalArgumentException(String.format( "Both core names (%s,%s) must correspond to a managed index", indexName1, indexName2)); } server.swap(indexName1, indexName2); } }
/** * Swaps two cores * @param core1 the first core to swap * @param core2 the second core to swap */ public void swap(String core1,String core2){ log.info("Swap Core {} with Core {}on CoreContainer {}", new Object[]{core1,core2, serverProperties.getServerName()}); //swap the cores server.swap(core1, core2); //if succeeded (re-)register the swapped core registerCoreService(core1,null); registerCoreService(core2,null); //update the OSGI service for the CoreContainer updateServerRegistration(); }
/** * Swaps two cores * @param core1 the first core to swap * @param core2 the second core to swap */ public void swap(String core1,String core2){ log.info("Swap Core {} with Core {}on CoreContainer {}", new Object[]{core1,core2, serverProperties.getServerName()}); //swap the cores server.swap(core1, core2); //if succeeded (re-)register the swapped core registerCoreService(core1,null); registerCoreService(core2,null); //update the OSGI service for the CoreContainer updateServerRegistration(); }
@Override public void swap(String name1, String name2) { log.info(" .... swap {}:{} with {}:{}",new Object[]{ serverProperties.getServerName(),name1, serverProperties.getServerName(),name2 }); super.swap(name1, name2); //also update the OSGI Service registrations if(initialised){ registerCoreService(name1,null); registerCoreService(name2,null); //update the OSGI service for the CoreContainer updateCoreNamesInServerProperties(); updateServerRegistration(); } //else ignore registration during startup } }
@Override public void swap(String name1, String name2) { log.info(" .... swap {}:{} with {}:{}",new Object[]{ serverProperties.getServerName(),name1, serverProperties.getServerName(),name2 }); super.swap(name1, name2); //also update the OSGI Service registrations if(initialised){ registerCoreService(name1,null); registerCoreService(name2,null); //update the OSGI service for the CoreContainer updateCoreNamesInServerProperties(); updateServerRegistration(); } //else ignore registration during startup } }
/** * Handle "SWAP" action * * @param req * @param rsp * * @return true if a modification has resulted that requires persistance * of the CoreContainer configuration. */ protected boolean handleSwapAction(SolrQueryRequest req, SolrQueryResponse rsp) { final SolrParams params = req.getParams(); final SolrParams required = params.required(); final String cname = params.get(CoreAdminParams.CORE); boolean doPersist = params.getBool(CoreAdminParams.PERSISTENT, coreContainer.isPersistent()); String other = required.get(CoreAdminParams.OTHER); coreContainer.swap(cname, other); return doPersist; }