Add several TODO comments and minor reformatting

This commit is contained in:
James Seibel
2024-03-02 15:20:51 -06:00
parent 89012711ce
commit 2a39a4cdc4
5 changed files with 17 additions and 9 deletions
@@ -36,10 +36,15 @@ import java.util.HashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* WARNING: This is not THREAD-SAFE!
* <p>
* Used to map a numerical IDs to a Biome/BlockState pair.
*
* WARNING: This is not THREAD-SAFE! <br><br>
*
* Used to map a numerical IDs to a Biome/BlockState pair. <br><br>
*
* TODO the serializing of this map might be really big
* since it stringifies every block and biome name, which is quite bulky.
* It might be worth while to have a biome and block ID that then both get mapped
* to the data point ID to reduce file size.
*
* @author Leetom
*/
public class FullDataPointIdMap
@@ -181,7 +181,6 @@ public abstract class AbstractNewDataSourceHandler
return CompletableFuture.runAsync(() ->
{
this.updateDataSourceAtPos(inputDataSource.getSectionPos(), inputDataSource, true);
}, executor);
}
catch (RejectedExecutionException ignore)
@@ -31,6 +31,11 @@ import java.util.Objects;
*
* @author Leetom
* @version 2022-11-6
*
* @deprecated TODO replace entirely with DhSectionPos,
* we don't need to have a full fledged position object for
* positions inside a LOD, we only need this position object
* to get to/from the LOD section.
*/
@Deprecated
public class DhLodPos implements Comparable<DhLodPos>
@@ -32,12 +32,10 @@ import org.jetbrains.annotations.NotNull;
/**
* Just a simple ThreadFactory to name ExecutorService
* threads, which is helpful when debugging.
*
* @author James Seibel
*/
public class DhThreadFactory implements ThreadFactory
{
private static final Logger LOGGER = DhLoggerBuilder.getLogger(MethodHandles.lookup().lookupClass().getSimpleName());
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
public final String threadName;
public final int priority;
@@ -62,7 +62,7 @@ public class RateLimitedThreadPoolExecutor extends ThreadPoolExecutor
{
super(corePoolSize, corePoolSize,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<>(),
new LinkedBlockingQueue<>(), // TODO using a PriorityBlockingQueue would be nice to allow for prioritizing tasks, but then all tasks must be Comparable
threadFactory);
this.runTimeRatio = runTimeRatio;
@@ -75,6 +75,7 @@ public class RateLimitedThreadPoolExecutor extends ThreadPoolExecutor
// overrides //
//===========//
@Override
protected void beforeExecute(Thread thread, Runnable runnable)
{
super.beforeExecute(thread, runnable);