public void resizeCacheSize(long remoteLogIndexFileCacheSize) {
        lock.writeLock().lock();
        try {
            internalCache.policy().eviction().orElseThrow(() -> new NoSuchElementException("No eviction policy is set for the remote index cache.")
            ).setMaximum(remoteLogIndexFileCacheSize);
        } finally {
            lock.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