Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(store): add stream cache config #623

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
public class ProxyConfig extends BaseConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(ProxyConfig.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.automq.rocketmq.common.config;

@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
public class S3StreamConfig {
private String s3Endpoint;
private String s3Region = "cn-hangzhou";
Expand All @@ -35,6 +36,12 @@ public class S3StreamConfig {
private long streamObjectCompactionMaxSizeBytes = 10737418240L;
private int streamObjectCompactionLivingTimeMinutes = 60;

private int objectBlockSize = 1048576;

// Cache
private int walCacheSize = 1024 * 1024 * 1024;
private int blockCacheSize = 1024 * 1024 * 1024;

private int walObjectCompactionInterval = 20;
private long walObjectCompactionCacheSize = 200 * 1024 * 1024;
private int walObjectCompactionUploadConcurrency = 8;
Expand Down Expand Up @@ -95,6 +102,18 @@ public int streamObjectCompactionLivingTimeMinutes() {
return streamObjectCompactionLivingTimeMinutes;
}

public int objectBlockSize() {
return objectBlockSize;
}

public int walCacheSize() {
return walCacheSize;
}

public int blockCacheSize() {
return blockCacheSize;
}

public int walObjectCompactionInterval() {
return walObjectCompactionInterval;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package com.automq.rocketmq.common.config;

@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
public class StoreConfig {
private static final int PROCESSOR_NUMBER = Runtime.getRuntime().availableProcessors();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ private Config configFrom(S3StreamConfig streamConfig) {
config.networkBaselineBandwidth(streamConfig.networkBaselineBandwidth());
config.refillPeriodMs(streamConfig.refillPeriodMs());

config.objectBlockSize(streamConfig.objectBlockSize());

// Cache
config.walCacheSize(streamConfig.walCacheSize());
config.blockCacheSize(streamConfig.blockCacheSize());

// Compaction config
config.streamObjectCompactionIntervalMinutes(streamConfig.streamObjectCompactionIntervalMinutes());
config.streamObjectCompactionMaxSizeBytes(streamConfig.streamObjectCompactionMaxSizeBytes());
Expand Down