diff --git a/core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManager.java b/core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManager.java index 0c58fb525..3a0026e94 100644 --- a/core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManager.java +++ b/core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManager.java @@ -42,6 +42,7 @@ import io.aiven.kafka.tieredstorage.chunkmanager.ChunkManager; import io.aiven.kafka.tieredstorage.chunkmanager.ChunkManagerFactory; +import io.aiven.kafka.tieredstorage.config.RemoteStorageManagerConfig; import io.aiven.kafka.tieredstorage.manifest.SegmentEncryptionMetadata; import io.aiven.kafka.tieredstorage.manifest.SegmentEncryptionMetadataV1; import io.aiven.kafka.tieredstorage.manifest.SegmentManifest; @@ -78,9 +79,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static io.aiven.kafka.tieredstorage.RemoteStorageManagerConfig.METRICS_NUM_SAMPLES_CONFIG; -import static io.aiven.kafka.tieredstorage.RemoteStorageManagerConfig.METRICS_RECORDING_LEVEL_CONFIG; -import static io.aiven.kafka.tieredstorage.RemoteStorageManagerConfig.METRICS_SAMPLE_WINDOW_MS_CONFIG; +import static io.aiven.kafka.tieredstorage.config.RemoteStorageManagerConfig.METRICS_NUM_SAMPLES_CONFIG; +import static io.aiven.kafka.tieredstorage.config.RemoteStorageManagerConfig.METRICS_RECORDING_LEVEL_CONFIG; +import static io.aiven.kafka.tieredstorage.config.RemoteStorageManagerConfig.METRICS_SAMPLE_WINDOW_MS_CONFIG; import static org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType.LEADER_EPOCH; import static org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType.OFFSET; import static org.apache.kafka.server.log.remote.storage.RemoteStorageManager.IndexType.PRODUCER_SNAPSHOT; diff --git a/core/src/main/java/io/aiven/kafka/tieredstorage/KeyPairPaths.java b/core/src/main/java/io/aiven/kafka/tieredstorage/config/KeyPairPaths.java similarity index 93% rename from core/src/main/java/io/aiven/kafka/tieredstorage/KeyPairPaths.java rename to core/src/main/java/io/aiven/kafka/tieredstorage/config/KeyPairPaths.java index 8ff3f1664..b1ce7285d 100644 --- a/core/src/main/java/io/aiven/kafka/tieredstorage/KeyPairPaths.java +++ b/core/src/main/java/io/aiven/kafka/tieredstorage/config/KeyPairPaths.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.aiven.kafka.tieredstorage; +package io.aiven.kafka.tieredstorage.config; import java.nio.file.Path; import java.util.Objects; @@ -23,7 +23,7 @@ public class KeyPairPaths { public final Path publicKey; public final Path privateKey; - public KeyPairPaths(final Path publicKey, final Path privateKey) { + KeyPairPaths(final Path publicKey, final Path privateKey) { this.publicKey = Objects.requireNonNull(publicKey, "publicKey cannot be null"); this.privateKey = Objects.requireNonNull(privateKey, "privateKey cannot be null"); } diff --git a/core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManagerConfig.java b/core/src/main/java/io/aiven/kafka/tieredstorage/config/RemoteStorageManagerConfig.java similarity index 95% rename from core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManagerConfig.java rename to core/src/main/java/io/aiven/kafka/tieredstorage/config/RemoteStorageManagerConfig.java index d8df6aff2..ba1fd3de6 100644 --- a/core/src/main/java/io/aiven/kafka/tieredstorage/RemoteStorageManagerConfig.java +++ b/core/src/main/java/io/aiven/kafka/tieredstorage/config/RemoteStorageManagerConfig.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.aiven.kafka.tieredstorage; +package io.aiven.kafka.tieredstorage.config; import java.nio.file.Path; import java.time.Duration; @@ -274,7 +274,7 @@ private static String privateKeyFileConfig(final String keyPairId) { private final EncryptionConfig encryptionConfig; - RemoteStorageManagerConfig(final Map props) { + public RemoteStorageManagerConfig(final Map props) { super(CONFIG, props); encryptionConfig = encryptionEnabled() ? EncryptionConfig.create(props) : null; validate(); @@ -291,14 +291,14 @@ private void validateCompression() { } } - StorageBackend storage() { + public StorageBackend storage() { final Class storageClass = getClass(STORAGE_BACKEND_CLASS_CONFIG); final StorageBackend storage = Utils.newInstance(storageClass, StorageBackend.class); storage.configure(this.originalsWithPrefix(STORAGE_PREFIX)); return storage; } - Optional segmentManifestCacheSize() { + public Optional segmentManifestCacheSize() { final long rawValue = getLong(SEGMENT_MANIFEST_CACHE_SIZE_CONFIG); if (rawValue == -1) { return Optional.empty(); @@ -306,7 +306,7 @@ Optional segmentManifestCacheSize() { return Optional.of(rawValue); } - Optional segmentManifestCacheRetention() { + public Optional segmentManifestCacheRetention() { final long rawValue = getLong(SEGMENT_MANIFEST_CACHE_RETENTION_MS_CONFIG); if (rawValue == -1) { return Optional.empty(); @@ -314,34 +314,34 @@ Optional segmentManifestCacheRetention() { return Optional.of(Duration.ofMillis(rawValue)); } - String keyPrefix() { + public String keyPrefix() { return getString(OBJECT_KEY_PREFIX_CONFIG); } - int chunkSize() { + public int chunkSize() { return getInt(CHUNK_SIZE_CONFIG); } - boolean compressionEnabled() { + public boolean compressionEnabled() { return getBoolean(COMPRESSION_ENABLED_CONFIG); } - boolean compressionHeuristicEnabled() { + public boolean compressionHeuristicEnabled() { return getBoolean(COMPRESSION_HEURISTIC_ENABLED_CONFIG); } - boolean encryptionEnabled() { + public boolean encryptionEnabled() { return getBoolean(ENCRYPTION_CONFIG); } - String encryptionKeyPairId() { + public String encryptionKeyPairId() { if (!encryptionEnabled()) { return null; } return encryptionConfig.activeKeyPairId(); } - Map encryptionKeyRing() { + public Map encryptionKeyRing() { if (!encryptionEnabled()) { return null; } diff --git a/core/src/test/java/io/aiven/kafka/tieredstorage/NoopStorageBackend.java b/core/src/test/java/io/aiven/kafka/tieredstorage/config/NoopStorageBackend.java similarity index 98% rename from core/src/test/java/io/aiven/kafka/tieredstorage/NoopStorageBackend.java rename to core/src/test/java/io/aiven/kafka/tieredstorage/config/NoopStorageBackend.java index 46a372e6a..9b255b743 100644 --- a/core/src/test/java/io/aiven/kafka/tieredstorage/NoopStorageBackend.java +++ b/core/src/test/java/io/aiven/kafka/tieredstorage/config/NoopStorageBackend.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.aiven.kafka.tieredstorage; +package io.aiven.kafka.tieredstorage.config; import java.io.InputStream; import java.util.Map; diff --git a/core/src/test/java/io/aiven/kafka/tieredstorage/RemoteStorageManagerConfigTest.java b/core/src/test/java/io/aiven/kafka/tieredstorage/config/RemoteStorageManagerConfigTest.java similarity index 99% rename from core/src/test/java/io/aiven/kafka/tieredstorage/RemoteStorageManagerConfigTest.java rename to core/src/test/java/io/aiven/kafka/tieredstorage/config/RemoteStorageManagerConfigTest.java index b5fcab83d..bd786efbc 100644 --- a/core/src/test/java/io/aiven/kafka/tieredstorage/RemoteStorageManagerConfigTest.java +++ b/core/src/test/java/io/aiven/kafka/tieredstorage/config/RemoteStorageManagerConfigTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.aiven.kafka.tieredstorage; +package io.aiven.kafka.tieredstorage.config; import java.nio.file.Path; import java.time.Duration;