Skip to content

Conversation

@asafMasa
Copy link
Contributor

@asafMasa asafMasa commented Nov 2, 2023

Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

@shimoncohen shimoncohen self-requested a review November 11, 2023 21:17
@shimoncohen shimoncohen added the enhancement New feature or request label Nov 11, 2023
Prefix = prefix,
StartAfter = startAfter,
ContinuationToken = continuationToken,
MaxKeys = maxKeys.Value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only add this parameter it maxKeys is not null.


protected Data(IServiceProvider container, DataType type, string path, int batchSize, Grid? grid,
GridOrigin? origin, bool isBase, Extent? extent = null)
GridOrigin? origin, bool isBase, Extent? extent = null, string? bucket = null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, data should not contain a bucket value.

public interface IUtilsFactory
{
T GetDataUtils<T>(string path) where T : IDataUtils;
T GetDataUtils<T>(string? bucket, string path) where T : IDataUtils;
Copy link
Collaborator

@shimoncohen shimoncohen Dec 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this shouldn't get a bucket value, this is too specific!

IData CreateDataSource(string type, string path, int batchSize, Grid? grid = null, GridOrigin? origin = null, Extent? extent = null, bool isBase = false);
IData CreateDataSource(string type, string path, int batchSize, bool isBase, Extent extent, int maxZoom, int minZoom = 0, Grid? grid = null, GridOrigin? origin = null);
IData CreateDataSource(string type, string path, string bucket, int batchSize, Grid? grid = null, GridOrigin? origin = null, Extent? extent = null, bool isBase = false);
IData CreateDataSource(string type, string path, string bucket, int batchSize, bool isBase, Extent extent, int maxZoom, int minZoom = 0, Grid? grid = null, GridOrigin? origin = null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said before, this is too specific.

{
IData CreateDataSource(string type, string path, int batchSize, Grid? grid = null, GridOrigin? origin = null, Extent? extent = null, bool isBase = false);
IData CreateDataSource(string type, string path, int batchSize, bool isBase, Extent extent, int maxZoom, int minZoom = 0, Grid? grid = null, GridOrigin? origin = null);
IData CreateDataSource(string type, string path, string bucket, int batchSize, Grid? grid = null, GridOrigin? origin = null, Extent? extent = null, bool isBase = false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said before, this is too specific.

this._bucket = bucket;
}

public string Bucket
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

@@ -40,12 +36,6 @@ public S3(IPathUtils pathUtils, IServiceProvider container, string path, int bat

protected override void Initialize()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove completly if not needed...

var listObjectsTask = this._client.ListObjectsV2Async(listRequests);
var response = listObjectsTask.Result;

ListObjectsV2Response response = this.Utils.ListObject(ref this._continuationToken, path, path, missingTiles);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the thought, but because of the generic use this is a mistake.
You could move this function to this class instead.

this.Extent = extent;
this.Origin = origin;
this.Grid = grid;
this.Bucket = bucket;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all sources should have a bucket value.

Comment on lines +184 to +204
MergeJob? jobData = jobUtils.GetJob(task.JobId);
if (jobData == null)
{
this._logger.LogWarning($"[{methodName}] no job data found for task!");
// TODO: should we fail the task?
}
if (!(jobData.Status == Status.PENDING || jobData.Status == Status.IN_PROGRESS))
{
this._logger.LogWarning($"[{methodName}] job status is {jobData.Status}, stop the task and set it's status accordingly");

// TODO: should we deal differenttly with completed or failed?

UpdateParams updateParams = new UpdateParams()
{
Status = jobData.Status
};
taskUtils.UpdateProgress(task.JobId, task.Id, updateParams);
continue;
}

string? managerCallbackUrl = jobData?.Parameters?.ManagerCallbackUrl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has nothing to do with this PR, does it?

{
this._logger.LogWarning($"[{methodName}] job status is {jobData.Status}, stop the task and set it's status accordingly");

// TODO: should we deal differenttly with completed or failed?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dif·fer·ent·ly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants