@Override
        public void onStorageEvent(LocalTieredStorageEvent event) {
            final List<LocalTieredStorageEvent> events = history.get(event.getType());

            synchronized (events) {
                if (events.size() >= HARD_EVENT_COUNT_LIMIT) {
                    LOGGER.error("Reached max number of historical event of type {}, dropping event {}",
                            event.getType(), event);
                    return;
                }

                events.add(event);
            }
        }
Subscribes to the events generated by the given {@link LocalTieredStorage}.
Note there is no check performed against multiple subscriptions on the same storage.

@param storage The {@link LocalTieredStorage} to subscribe to.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorageHistory.java