public void doWork() {
                try {
                    Entry entry = expiredIndexes.take();
                    log.debug("Cleaning up index entry {}", entry);
                    entry.cleanup();
                } catch (InterruptedException ie) {
                    // cleaner thread should only be interrupted when cache is being closed, else it's an error
                    if (!isRemoteIndexCacheClosed.get()) {
                        log.error("Cleaner thread received interruption but remote index cache is not closed", ie);
                        // propagate the InterruptedException outside to correctly close the thread.
                        throw new KafkaException(ie);
                    } else {
                        log.debug("Cleaner thread was interrupted on cache shutdown");
                    }
                } catch (Exception ex) {
                    // do not exit for exceptions other than InterruptedException
                    log.error("Error occurred while cleaning up expired entry", ex);
                }
            }
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