Skip to content

Commit 52b14c5

Browse files
committed
Add Ignite as built-in ConfigStore type
- Handle 'ignite' type directly in ConfigStoreFactory - Load IgniteConfigStoreFactory via reflection - Works in forked PipesServer without plugin system - Matches pattern used for 'file' type - Fixes: ClassNotFoundException: ignite in forked process
1 parent d7d9f10 commit 52b14c5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/config/ConfigStoreFactory.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static ConfigStore createConfigStore(PluginManager pluginManager, String configS
5858
return store;
5959
}
6060

61-
// Handle file type directly since it's in core (not a plugin)
61+
// Handle built-in types directly (not plugins)
6262
if ("file".equalsIgnoreCase(configStoreType)) {
6363
LOG.info("Creating FileBasedConfigStore");
6464
FileBasedConfigStoreFactory factory = new FileBasedConfigStoreFactory();
@@ -71,6 +71,21 @@ static ConfigStore createConfigStore(PluginManager pluginManager, String configS
7171
}
7272
}
7373

74+
if ("ignite".equalsIgnoreCase(configStoreType)) {
75+
LOG.info("Creating IgniteConfigStore");
76+
try {
77+
Class<?> factoryClass = Class.forName("org.apache.tika.pipes.ignite.IgniteConfigStoreFactory");
78+
ConfigStoreFactory factory = (ConfigStoreFactory) factoryClass.getDeclaredConstructor().newInstance();
79+
ExtensionConfig config = extensionConfig != null ? extensionConfig :
80+
new ExtensionConfig(configStoreType, configStoreType, "{}");
81+
return factory.buildExtension(config);
82+
} catch (ClassNotFoundException e) {
83+
throw new TikaConfigException("Ignite ConfigStore requested but tika-pipes-ignite not on classpath", e);
84+
} catch (Exception e) {
85+
throw new TikaConfigException("Failed to create IgniteConfigStore", e);
86+
}
87+
}
88+
7489
Map<String, ConfigStoreFactory> factoryMap = loadAllConfigStoreFactoryExtensions(pluginManager);
7590

7691
ConfigStoreFactory factory = factoryMap.get(configStoreType);

0 commit comments

Comments
 (0)