public static RemoteTopicPartitionDirectory openTopicPartitionDirectory(final TopicIdPartition topicIdPartition,
                                                                            final File storageDirectory) {


        final File directory = new File(storageDirectory, toString(topicIdPartition));
        final boolean existed = directory.exists();

        if (!existed) {
            LOGGER.info("Creating directory: " + directory.getAbsolutePath());
            directory.mkdirs();
        }

        return new RemoteTopicPartitionDirectory(topicIdPartition, directory, existed);
    }
Creates a new {@link RemoteTopicPartitionDirectory} instance for the directory of the
provided topicPartition under the root directory of the local tiered storage.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/RemoteTopicPartitionDirectory.java