Log exception in case of import via JMX operation fails
@@ -41,11 +41,14 @@ import org.apache.jackrabbit.oak.spi.whiteboard.Registration;
import org.apache.jackrabbit.oak.spi.whiteboard.Tracker;
import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard;
import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import static org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.registerMBean;
@Component
public class IndexerMBeanImpl extends AnnotatedStandardMBean implements IndexerMBean {
+ private final Logger log = LoggerFactory.getLogger(getClass());
@Reference
private NodeStore nodeStore;
@@ -62,9 +65,14 @@ public class IndexerMBeanImpl extends AnnotatedStandardMBean implements IndexerM
@Override
public boolean importIndex(String indexDirPath) throws IOException, CommitFailedException {
+ try {
IndexImporter importer = new IndexImporter(nodeStore, new File(indexDirPath), editorProvider, createLock());
providerTracker.getServices().forEach(importer::addImporterProvider);
importer.importIndex();
+ } catch (IOException | CommitFailedException | RuntimeException e) {
+ log.warn("Error occurred while importing index from path [{}]", indexDirPath, e);
+ throw e;
+ }
return true;
}
