Remove ISourceProvider

This commit is contained in:
James Seibel
2024-03-17 17:36:28 -05:00
parent 6b13e9141c
commit 94e3426779
4 changed files with 9 additions and 31 deletions
@@ -34,8 +34,9 @@ import java.util.zip.Adler32;
import java.util.zip.CheckedOutputStream;
@Deprecated
public abstract class AbstractLegacyDataSourceHandler<TDataSource extends IDataSource<TDhLevel>, TDhLevel extends IDhLevel>
implements ISourceProvider<TDataSource, TDhLevel>
public abstract class AbstractLegacyDataSourceHandler<TDataSource
extends IDataSource<TDhLevel>, TDhLevel extends IDhLevel>
implements AutoCloseable
{
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
private static final Timer DELAYED_SAVE_TIMER = TimerUtil.CreateTimer("DataSourceSaveTimer");
@@ -128,7 +129,6 @@ public abstract class AbstractLegacyDataSourceHandler<TDataSource extends IDataS
*
* This call is concurrent. I.e. it supports being called by multiple threads at the same time.
*/
@Override
public CompletableFuture<TDataSource> getAsync(DhSectionPos pos)
{
ThreadPoolExecutor executor = ThreadPoolUtil.getFileHandlerExecutor();
@@ -190,7 +190,6 @@ public abstract class AbstractLegacyDataSourceHandler<TDataSource extends IDataS
// data updating //
//===============//
@Override
public CompletableFuture<Void> updateDataSourceAsync(FullDataSourceV2 inputDataSource)
{
ThreadPoolExecutor executor = ThreadPoolUtil.getFileHandlerExecutor();
@@ -24,8 +24,8 @@ public abstract class AbstractNewDataSourceHandler
<TDataSource extends IDataSource<TDhLevel>,
TDTO extends IBaseDTO<DhSectionPos>,
TRepo extends AbstractDhRepo<DhSectionPos, TDTO>,
TDhLevel extends IDhLevel>
implements ISourceProvider<TDataSource, TDhLevel>
TDhLevel extends IDhLevel>
implements AutoCloseable
{
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
@@ -112,7 +112,6 @@ public abstract class AbstractNewDataSourceHandler
*
* This call is concurrent. I.e. it supports being called by multiple threads at the same time.
*/
@Override
public CompletableFuture<TDataSource> getAsync(DhSectionPos pos)
{
ThreadPoolExecutor executor = ThreadPoolUtil.getFileHandlerExecutor();
@@ -160,7 +159,6 @@ public abstract class AbstractNewDataSourceHandler
// data updating //
//===============//
@Override
public CompletableFuture<Void> updateDataSourceAsync(FullDataSourceV2 inputDataSource)
{
ThreadPoolExecutor executor = ThreadPoolUtil.getUpdatePropagatorExecutor();
@@ -1,21 +0,0 @@
package com.seibel.distanthorizons.core.file;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2;
import com.seibel.distanthorizons.core.file.renderfile.IRenderSourceProvider;
import com.seibel.distanthorizons.core.level.IDhLevel;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import java.util.concurrent.CompletableFuture;
/**
* Base for all data source providers
*
* @see IRenderSourceProvider
*/
public interface ISourceProvider<TDataSource extends IDataSource<TDhLevel>, TDhLevel extends IDhLevel> extends AutoCloseable
{
CompletableFuture<TDataSource> getAsync(DhSectionPos pos);
CompletableFuture<Void> updateDataSourceAsync(FullDataSourceV2 inputData);
}
@@ -20,7 +20,6 @@
package com.seibel.distanthorizons.core.file.renderfile;
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2;
import com.seibel.distanthorizons.core.file.ISourceProvider;
import com.seibel.distanthorizons.core.level.IDhClientLevel;
import com.seibel.distanthorizons.core.pos.DhSectionPos;
import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource;
@@ -31,8 +30,11 @@ import java.util.concurrent.CompletableFuture;
/**
* Handles reading, writing, and updating {@link ColumnRenderSource}'s. <br>
* Should be backed by a database handled by a {@link RenderDataRepo}.
*
* @deprecated an interface isn't necessary for the single render source provider we have
*/
public interface IRenderSourceProvider extends ISourceProvider<ColumnRenderSource, IDhClientLevel>
@Deprecated
public interface IRenderSourceProvider extends AutoCloseable
{
CompletableFuture<ColumnRenderSource> getAsync(DhSectionPos pos);