Commit 34b60d6
authored
* TIKA-4595: Add dynamic fetcher/emitter management API to PipesClient
- Added SAVE_FETCHER, DELETE_FETCHER, LIST_FETCHERS, GET_FETCHER commands
- Added SAVE_EMITTER, DELETE_EMITTER, LIST_EMITTERS, GET_EMITTER commands
- Implemented PipesClient public API methods for runtime configuration
- Implemented PipesServer command handlers
- Added deleteComponent() and getComponentConfig() to AbstractComponentManager
- Added wrapper methods to FetcherManager and EmitterManager
- Added remove() method to ConfigStore interface and implementations
- All tests passing
* Fix gRPC saveFetcher to propagate to PipesClient's forked PipesServer
- saveFetcher now calls both fetcherManager.saveFetcher() and pipesClient.saveFetcher()
- This ensures fetchers are available in the forked PipesServer process
- Implemented deleteFetcher to call both managers as well
- Fixes FetcherNotFoundException when using dynamic fetchers via gRPC
The issue was that fetchers saved via gRPC were only stored in the gRPC
server's FetcherManager, but when pipesClient.process() forks a new
PipesServer process, that process has its own FetcherManager and doesn't
have access to the dynamically created fetchers. Now both are updated.
* Add file-based ConfigStore for shared config between gRPC and PipesServer
- Created FileBasedConfigStore that persists to JSON file
- Created FileBasedConfigStoreFactory with @extension annotation
- Updated PipesServer.initializeResources() to create and use ConfigStore
- Both gRPC server and forked PipesServer can now share fetcher configs via file
This enables dynamic fetcher management across JVM processes:
1. gRPC saves fetcher → writes to config file
2. PipesServer starts → reads from same file
3. Both JVMs share the same fetcher configuration
* Handle 'file' ConfigStore type as built-in (not plugin)
- Added direct handling for 'file' type in ConfigStoreFactory.createConfigStore()
- File-based store is in core, not a plugin, so needs special handling
- Avoids ClassNotFoundException when trying to load 'file' as a class name
- Also added remove() method to IgniteConfigStore for interface compliance
* Make ExtensionConfig Serializable for socket communication
ExtensionConfig is sent over sockets between PipesClient and PipesServer,
so it needs to implement Serializable. Records can implement Serializable
and all fields (String, String, String) are already serializable.
Fixes NotSerializableException when calling saveFetcher via gRPC.
* Add embedded Ignite server architecture
- Created IgniteStoreServer class that runs as embedded server
- TikaGrpcServer starts Ignite server on startup (if ignite ConfigStore configured)
- IgniteConfigStore now acts as client-only (clientMode=true)
- No external Ignite dependency needed in Docker/Kubernetes
- Server runs in background daemon thread within tika-grpc process
- Clients (gRPC + forked PipesServer) connect to embedded server
Architecture:
┌─────────────────────────────────┐
│ tika-grpc Process │
│ ┌──────────────────────────┐ │
│ │ IgniteStoreServer │ │
│ │ (server mode, daemon) │ │
│ └────────▲─────────────────┘ │
│ │ │
│ ┌────────┴─────────────────┐ │
│ │ IgniteConfigStore │ │
│ │ (client mode) │ │
│ └──────────────────────────┘ │
└─────────────────────────────────┘
▲
│ (client connection)
│
┌────────┴─────────────────┐
│ PipesServer (forked) │
│ IgniteConfigStore │
│ (client mode) │
└──────────────────────────┘
* Configure Ignite work directory to /tmp
- Set workDirectory to /tmp/ignite-work in IgniteStoreServer
- Set workDirectory to /tmp/ignite-work in IgniteConfigStore
- Avoids 'Work directory does not exist and cannot be created: /work' error
- Uses system property ignite.work.dir if set, defaults to /tmp/ignite-work
- Ensures Ignite can write to work directory in Docker containers
* Use /var/cache/tika/ignite-work for Ignite work directory
- Changed from /tmp/ignite-work to /var/cache/tika/ignite-work
- Aligns with Tika's standard cache location
- /var/cache/tika is already used for plugins and other Tika cache data
* Use plugin classloader for Ignite server startup
- Find Ignite plugin's classloader from plugin manager
- Load IgniteStoreServer and CacheMode using plugin classloader
- Fixes NoClassDefFoundError for H2 classes
- Ensures all Ignite dependencies (including H2) are available
- Plugin classloader has all dependencies from lib/ directory
* Enable peer class loading in Ignite client
- Set setPeerClassLoadingEnabled(true) in IgniteConfigStore
- Must match server configuration
- Fixes: Remote node has peer class loading enabled flag different from local
- Both server and client now have peerClassLoading=true
* Disable peer class loading to fix classloader conflicts
- Set setPeerClassLoadingEnabled(false) on both server and client
- Fixes ClassCastException due to class loaded by different classloaders
- Server uses plugin classloader, client uses app classloader
- Peer class loading causes the same class to be in both, creating conflicts
- We don't need peer class loading for our use case
* Move Ignite dependencies directly into tika-grpc
- Made tika-pipes-ignite a required (non-optional) dependency of tika-grpc
- Added ignite.version and h2.version properties
- Removed reflection-based classloader lookup
- Direct instantiation of IgniteStoreServer
- Avoids all PF4J plugin classloader issues
- Ignite classes now on main classpath
* Disable Ignite Object Input Filter autoconfiguration
- Set IGNITE_ENABLE_OBJECT_INPUT_FILTER_AUTOCONFIGURATION=false
- Fixes: Failed to autoconfigure Ignite Object Input Filter
- Ignite was conflicting with existing serialization filter
- Apply in both IgniteStoreServer and IgniteConfigStore
* Add Ignite filter autoconfiguration disable to client too
* 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
* Add PipesIterator management API with save, get, and delete operations
* Fix Ignite tests to use temp directory and server mode
* Fix TikaGrpcServerTest - update assertion for delete operation now that it's implemented
1 parent 771e649 commit 34b60d6
File tree
19 files changed
+1575
-20
lines changed- tika-grpc
- src
- main
- java/org/apache/tika/pipes/grpc
- proto
- test/java/org/apache/tika/pipes/grpc
- tika-pipes
- tika-pipes-core/src
- main/java/org/apache/tika/pipes/core
- config
- emitter
- fetcher
- server
- test/java/org/apache/tika/pipes/core/config
- tika-pipes-plugins/tika-pipes-ignite/src
- main/java/org/apache/tika/pipes/ignite
- server
- test/java/org/apache/tika/pipes/ignite
- tika-plugins-core/src/main/java/org/apache/tika/plugins
19 files changed
+1575
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | | - | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| |||
Lines changed: 151 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
134 | 145 | | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
138 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
139 | 177 | | |
140 | 178 | | |
141 | 179 | | |
| |||
225 | 263 | | |
226 | 264 | | |
227 | 265 | | |
| 266 | + | |
| 267 | + | |
228 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
229 | 272 | | |
230 | 273 | | |
231 | 274 | | |
| |||
331 | 374 | | |
332 | 375 | | |
333 | 376 | | |
334 | | - | |
335 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
336 | 485 | | |
337 | 486 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
62 | 75 | | |
63 | 76 | | |
64 | 77 | | |
| |||
143 | 156 | | |
144 | 157 | | |
145 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
312 | 353 | | |
313 | 354 | | |
314 | 355 | | |
| |||
0 commit comments