public void cleanup() throws IOException {
            entryLock.writeLock().lock();
            try {
                markForCleanup();
                // no-op if clean is done already
                if (!cleanStarted) {
                    cleanStarted = true;

                    List<StorageAction<Void, Exception>> actions = Arrays.asList(() -> {
                        offsetIndex.deleteIfExists();
                        return null;
                    }, () -> {
                        timeIndex.deleteIfExists();
                        return null;
                    }, () -> {
                        txnIndex.deleteIfExists();
                        return null;
                    });

                    tryAll(actions);
                }
            } finally {
                entryLock.writeLock().unlock();
            }
        }
Creates RemoteIndexCache with the given configs.

@param maxSize              maximum bytes size of segment index entries to be cached.
@param remoteStorageManager RemoteStorageManager instance, to be used in fetching indexes.
@param logDir               log directory
storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java