nddipiazza opened a new pull request, #2465: URL: https://github.com/apache/tika/pull/2465
## JIRA Ticket https://issues.apache.org/jira/browse/TIKA-4579 ## Summary Adds the ability to update existing fetcher/emitter configurations at runtime without using reflection hacks. The TikaGrpcServer previously had to use reflection to forcibly clear the cache when updating fetchers because saveComponent() would throw an exception for duplicate IDs. ## Changes - **AbstractComponentManager.saveComponent()**: Changed behavior to support updates instead of throwing exception when component ID already exists - Removed duplicate ID check that threw TikaConfigException - When updating existing component, cache is cleared to force re-instantiation - Added logging to distinguish between creating new vs updating existing configs - **TikaGrpcServerImpl.saveFetcher()**: Removed reflection hack - Deleted reflection-based code that was forcibly clearing the cache - Now simply calls fetcherManager.saveFetcher() which handles updates properly - **Updated JavaDocs**: Modified documentation for FetcherManager, EmitterManager, and AbstractComponentManager - Changed from "adds a component" to "adds or updates a component" - Removed mentions of exceptions for duplicate IDs - **Updated Tests**: Modified FetcherManagerTest - Changed test from expecting TikaConfigException to verifying update behavior - Verifies that updating a fetcher clears the cache and creates a new instance - Ensures config store contains only one fetcher after update ## Use Case 1. tika-grpc server starts with no fetcher configs in tika-config (blank slate) 2. Users call saveFetcher gRPC method to create new fetcher configurations 3. Users can then use those fetchers 4. Users can update/modify existing fetcher configurations without reflection ## Testing - Modified existing test to verify update behavior - All existing tests pass - Verified cache is properly cleared on update ## Security Note This functionality stores configurations in-memory only. Since tika-grpc is secured via mutual TLS, only authorized users can modify configurations at runtime. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
