protected void process() { final DataStoreFactory dataStoreFactory = ComponentUtil.getDataStoreFactory(); dataStore = dataStoreFactory.getDataStore(dataConfig.getHandlerName()); if (dataStore == null) { logger.error("DataStore(" + dataConfig.getHandlerName() + ") is not found."); } else { try { dataStore.store(dataConfig, indexUpdateCallback, initParamMap); } catch (final Throwable e) { logger.error("Failed to process a data crawling: " + dataConfig.getName(), e); ComponentUtil.getComponent(FailureUrlService.class) .store( dataConfig, e.getClass().getCanonicalName(), dataConfig.getConfigId() + ":" + dataConfig.getName(), e); } finally { indexUpdateCallback.commit(); deleteOldDocs(); } } }
public void stopCrawling() { if (dataStore != null) { dataStore.stop(); } }