-
Notifications
You must be signed in to change notification settings - Fork 2
feat: support multibuckets by recieving bucket from task parameters #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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() | |||
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
| 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.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dif·fer·ent·ly