Skip to content

Commit

Permalink
[server] Introduce "server.background.threads" conf for thread number…
Browse files Browse the repository at this point in the history
… of server scheduler (#126)

This closes #125
  • Loading branch information
RocMarshal authored Dec 17, 2024
1 parent 2b2c7cb commit de510aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ public class ConfigOptions {
+ WRITER_ID_EXPIRATION_TIME.key()
+ " passing. The default value is 10 minutes.");

public static final ConfigOption<Integer> BACKGROUND_THREADS =
key("server.background.threads")
.intType()
.defaultValue(10)
.withDescription(
"The number of threads to use for various background processing tasks.");

// ------------------------------------------------------------------
// ZooKeeper Settings
// ------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;

import static com.alibaba.fluss.config.ConfigOptions.BACKGROUND_THREADS;

/**
* Tablet server implementation. The tablet server is responsible to manage the log tablet and kv
* tablet.
Expand Down Expand Up @@ -151,8 +153,7 @@ protected void startServices() throws Exception {

this.metadataCache = new ServerMetadataCacheImpl();

// TODO set scheduler thread number.
this.scheduler = new FlussScheduler(10);
this.scheduler = new FlussScheduler(conf.get(BACKGROUND_THREADS));
scheduler.startup();

this.logManager =
Expand Down
1 change: 1 addition & 0 deletions website/docs/maintenance/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ during the Fluss cluster working.
| data.dir | String | /tmp/fluss-data | This configuration controls the directory where fluss will store its data. The default value is /tmp/fluss-data |
| server.writer-id.expiration-time | Duration | 7d | The time that the tablet server will wait without receiving any write request from a client before expiring the related status. The default value is 7 days. |
| server.writer-id.expiration-check-interval | Duration | 10min | The interval at which to remove writer ids that have expired due to 'server.writer-id.expiration-time passing. The default value is 10 minutes. |
| server.background.threads | Integer | 10 | The number of threads to use for various background processing tasks. The default value is 10. |
### Zookeeper
Expand Down

0 comments on commit de510aa

Please sign in to comment.