Skip to content

Commit

Permalink
docs: Add documentation module
Browse files Browse the repository at this point in the history
Add module to generate config documentation
  • Loading branch information
jeqo committed Oct 1, 2024
1 parent c88962c commit 78ce346
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
Empty file added config.rst
Empty file.
29 changes: 29 additions & 0 deletions docs/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2024 Aiven Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'java-library'
}

dependencies {
implementation "org.apache.kafka:kafka-clients:$kafkaVersion"
implementation project(":core")
}

tasks.register('genConfigDocs', JavaExec) {
classpath = sourceSets.main.runtimeClasspath
mainClass = 'io.aiven.kafka.tieredstorage.misc.ConfigDocs'
standardOutput = new File("config.rst").newOutputStream()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright 2024 Aiven Oy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.aiven.kafka.tieredstorage.misc;

import org.apache.kafka.common.config.ConfigDef;

import io.aiven.kafka.tieredstorage.config.ChunkCacheConfig;
import io.aiven.kafka.tieredstorage.config.ChunkManagerFactoryConfig;
import io.aiven.kafka.tieredstorage.config.DiskChunkCacheConfig;
import io.aiven.kafka.tieredstorage.config.RemoteStorageManagerConfig;
import io.aiven.kafka.tieredstorage.fetch.index.MemorySegmentIndexesCache;
import io.aiven.kafka.tieredstorage.fetch.manifest.MemorySegmentManifestCache;

public class ConfigDocs {
public static void main(final String[] args) {
System.out.println("=================\n"
+ "RemoteStorageManagerConfig\n"
+ "=================");
final var rsmConfigDef = RemoteStorageManagerConfig.configDef();
System.out.println(rsmConfigDef.toEnrichedRst());

System.out.println("=================\n"
+ "SegmentManifestCacheConfig\n"
+ "=================");
System.out.println("Under ``" + RemoteStorageManagerConfig.SEGMENT_MANIFEST_CACHE_PREFIX + "``\n");
final var segmentManifestCacheDef = MemorySegmentManifestCache.configDef();
System.out.println(segmentManifestCacheDef.toEnrichedRst());

System.out.println("=================\n"
+ "SegmentIndexesCacheConfig\n"
+ "=================");
System.out.println("Under ``" + RemoteStorageManagerConfig.FETCH_INDEXES_CACHE_PREFIX + "``\n");
final var segmentIndexesCacheDef = MemorySegmentIndexesCache.configDef();
System.out.println(segmentIndexesCacheDef.toEnrichedRst());

System.out.println("=================\n"
+ "ChunkManagerFactoryConfig\n"
+ "=================");
final var chunkCacheFactoryDef = ChunkManagerFactoryConfig.configDef();
System.out.println(chunkCacheFactoryDef.toEnrichedRst());

System.out.println("=================\n"
+ "MemoryChunkCacheConfig\n"
+ "=================");
System.out.println("Under ``" + ChunkManagerFactoryConfig.FETCH_CHUNK_CACHE_PREFIX + "``\n");
final var memChunkCacheDef = ChunkCacheConfig.configDef(new ConfigDef());
System.out.println(memChunkCacheDef.toEnrichedRst());

System.out.println("=================\n"
+ "DiskChunkCacheConfig\n"
+ "=================");
System.out.println("Under ``" + ChunkManagerFactoryConfig.FETCH_CHUNK_CACHE_PREFIX + "``\n");
final var diskChunkCacheDef = DiskChunkCacheConfig.configDef();
System.out.println(diskChunkCacheDef.toEnrichedRst());
}
}
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ include 'storage:gcs'
include 'storage:s3'
include 'e2e'
include 'commons'
include 'docs'

0 comments on commit 78ce346

Please sign in to comment.