Skip to content

Conversation

@Jayesh45-master
Copy link

@Jayesh45-master Jayesh45-master commented Dec 26, 2025

Implement in-memory test harness for IRC Events REST endpoint

Fixes #13582

Summary

This PR introduces a lightweight test harness for the IRC Events REST endpoint in the Iceberg REST Catalog.

The implementation is intentionally non-production, using an in-memory event store, and is designed to unblock further development and validation of the Events API before it is merged into the REST Catalog specification.

This work follows the consensus reached in #12584 and builds on the groundwork from #13580.


Motivation

Before finalizing and merging the IRC Events endpoint into the REST Catalog specification, we need a concrete implementation to:

  • Validate endpoint contracts

  • Enable integration and unit testing

  • Provide a reference implementation for future production backends

The test harness satisfies these needs without introducing storage or operational complexity.


What’s Included

This PR adds support for POST and GET operations on:

/v1/{prefix}/events

using an in-memory backend.

Key components introduced

In-memory events store

  • Thread-safe storage for received events

  • Suitable for tests and local development only

Request / response models

  • PostEventsRequest

  • EventsResponse

REST wiring

  • New routes registered in Route

  • Endpoint handling added to RESTCatalogAdapter

Path helpers

  • Centralized /v1/{prefix}/events path in ResourcePaths

Tests

  • TestEventsEndpoint validates:

    • Posting events

    • Retrieving stored events

    • Basic request/response flow


Files Changed

File | Description -- | -- ResourcePaths.java | Added V1_EVENTS path and helper PostEventsRequest.java | Request model for POST /events EventsResponse.java | Response model for GET /events InMemoryEventsStore.java | Simple in-memory event backend RESTCatalogAdapter.java | Endpoint handling for events Route.java | Added EVENTS_POST and EVENTS_GET routes TestEventsEndpoint.java | Unit test covering the new endpoint

Design Notes

  • Non-production by design
    The in-memory store is scoped to testing and local usage only.

  • No persistence guarantees
    Events are not durable and reset between runs.

  • Minimal surface area
    No external dependencies or configuration required.

This approach keeps the implementation simple while providing meaningful coverage and validation.


Testing

  • Added TestEventsEndpoint

  • Verified:

    • POST events are accepted

    • GET returns previously posted events

  • Full build executed locally using:

./gradlew build

Backward Compatibility

  • No breaking changes

  • No impact on existing REST Catalog functionality

  • New endpoint is additive and isolated


Follow-ups / Future Work

  • Pluggable or persistent event stores

  • Metrics and retention policies

  • Authorization and filtering

  • Production-ready implementations


Checklist

  • Follows Iceberg REST patterns

  • Minimal, test-only implementation

  • Covered by unit tests

  • No production assumptions introduced

  • Ready for review and iteration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IRC Events Endpoint Implementation: Test Harness

1 participant