Make ARW to record class
This commit is contained in:
+4
-4
@@ -96,22 +96,22 @@ public class CpuAffinityConfig implements IConfigModule {
|
||||
|
||||
if (enabledForTickRegion) {
|
||||
tickRegionRunnableWrapper = new AffinityRunnableWrapper("tick_region", parseAffinity(tickRegionAffinity));
|
||||
LOGGER.info("Tick region thread now bound to: {}", tickRegionRunnableWrapper.getAffinity());
|
||||
LOGGER.info("Tick region thread now bound to: {}", tickRegionRunnableWrapper.affinity());
|
||||
}
|
||||
|
||||
if (enabledForChunkSystemIo) {
|
||||
chunkSystemIoRunnableWrapper = new AffinityRunnableWrapper("chunk_system_io", parseAffinity(chunkSystemIoAffinity));
|
||||
LOGGER.info("Chunk system I/O thread now bound to: {}", chunkSystemIoRunnableWrapper.getAffinity());
|
||||
LOGGER.info("Chunk system I/O thread now bound to: {}", chunkSystemIoRunnableWrapper.affinity());
|
||||
}
|
||||
|
||||
if (enabledForChunkSystemWorker) {
|
||||
chunkSystemWorkerRunnableWrapper = new AffinityRunnableWrapper("chunk_system_worker", parseAffinity(chunkSystemWorkerAffinity));
|
||||
LOGGER.info("Chunk system worker thread now bound to: {}", chunkSystemWorkerRunnableWrapper.getAffinity());
|
||||
LOGGER.info("Chunk system worker thread now bound to: {}", chunkSystemWorkerRunnableWrapper.affinity());
|
||||
}
|
||||
|
||||
if (enableForNettyIo) {
|
||||
nettyIoRunnableWrapper = new AffinityRunnableWrapper("netty_io", parseAffinity(nettyIoAffinity));
|
||||
LOGGER.info("Netty I/O thread now bound to: {}", nettyIoRunnableWrapper.getAffinity());
|
||||
LOGGER.info("Netty I/O thread now bound to: {}", nettyIoRunnableWrapper.affinity());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-10
@@ -5,14 +5,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.BitSet;
|
||||
|
||||
public class AffinityRunnableWrapper {
|
||||
private final BitSet affinity;
|
||||
private final String name;
|
||||
|
||||
public AffinityRunnableWrapper(String name, BitSet affinity) {
|
||||
this.name = name;
|
||||
this.affinity = affinity;
|
||||
}
|
||||
public record AffinityRunnableWrapper(String name, BitSet affinity) {
|
||||
|
||||
public Runnable wrap(Runnable original) {
|
||||
return () -> {
|
||||
@@ -22,13 +15,15 @@ public class AffinityRunnableWrapper {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public BitSet getAffinity() {
|
||||
public BitSet affinity() {
|
||||
return this.affinity;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user