feat: support multibuckets by recieving bucket from task parameters#124
feat: support multibuckets by recieving bucket from task parameters#124
Conversation
asafMasa
commented
Nov 2, 2023
| Question | Answer |
|---|---|
| Bug fix | ✖ |
| New feature | ✔ |
| Breaking change | ✔ |
| Deprecations | ✖ |
| Documentation | ✖ |
| Tests added | ✖ |
| Chore | ✖ |
| Prefix = prefix, | ||
| StartAfter = startAfter, | ||
| ContinuationToken = continuationToken, | ||
| MaxKeys = maxKeys.Value |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
As said before, this is too specific.
| this._bucket = bucket; | ||
| } | ||
|
|
||
| public string Bucket |
| @@ -40,12 +36,6 @@ public S3(IPathUtils pathUtils, IServiceProvider container, string path, int bat | |||
|
|
|||
| protected override void Initialize() | |||
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Not all sources should have a bucket value.
| 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; |
There was a problem hiding this comment.
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? |