-
Notifications
You must be signed in to change notification settings - Fork 2
fix: perform get tile with known format to reduce requests(MAPCO-8749) #175
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
Draft
nitzanmorr
wants to merge
14
commits into
master
Choose a base branch
from
get-tile-with-known-format
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
80e63a0
feat: get tiles directly with the right file extension instead of lis…
nitzanmorr 598de3d
fix: add missing format parameter
nitzanmorr f65e285
fix: add missing format parameter
nitzanmorr 43234bd
test: modify tests to compile with new arguments
nitzanmorr 63a52d4
test: modified FileClientTest mocks to work with the changed getTile …
nitzanmorr a211cbe
test: fixed xyztest
nitzanmorr 4db37c5
test: fixed xyz tests
nitzanmorr 817465f
test: fixed wmts tests
nitzanmorr 4a686ba
test: fixed gpkg tests
nitzanmorr eb96c69
test: fixed s3 tests
nitzanmorr 78453d0
test: fixed fs tests
nitzanmorr 548f953
test: fixed s3 utils tests
nitzanmorr 61e0d87
test: fixed tms tests
nitzanmorr 3c65876
fix: add TileFormat parameter to merger cli
nitzanmorr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,10 +54,10 @@ public void Start(IData baseData, IData newData, BatchStatusManager batchStatusM | |
| } | ||
|
|
||
| this._logger.LogInformation($"[{MethodBase.GetCurrentMethod()?.Name}] Total amount of tiles to merge: {totalTileCount - tileProgressCount}"); | ||
|
|
||
| ParallelRun(baseData, newData, batchStatusManager, | ||
| tileProgressCount, totalTileCount, resumeBatchIdentifier, resumeMode, pollForBatch); | ||
|
|
||
| batchStatusManager.CompleteLayer(newData.Path); | ||
| newData.Reset(); | ||
| // base data wrap up is in program as the same base data object is used in multiple calls | ||
|
|
@@ -79,7 +79,7 @@ public void Start(IData baseData, IData newData, BatchStatusManager batchStatusM | |
| newData.setBatchIdentifier(resumeBatchIdentifier); | ||
| } | ||
| } | ||
|
|
||
| var incompleteBatch = batchStatusManager.GetFirstIncompleteBatch(newData.Path); | ||
| if (incompleteBatch is not null) | ||
| { | ||
|
|
@@ -88,21 +88,21 @@ public void Start(IData baseData, IData newData, BatchStatusManager batchStatusM | |
| } | ||
|
|
||
| List<Tile> newTiles = newData.GetNextBatch(out string? currentBatchIdentifier, out string? nextBatchIdentifier, totalTileCount); | ||
|
|
||
| if (!resumeMode && newTiles.Count != 0) | ||
| { | ||
| batchStatusManager.AssignBatch(newData.Path, currentBatchIdentifier); | ||
| batchStatusManager.SetCurrentBatch(newData.Path, nextBatchIdentifier); | ||
| } | ||
|
|
||
| return (newTiles, currentBatchIdentifier); | ||
| } | ||
| } | ||
| private void ProcessBatch(IData baseData, List<Tile> newTiles, ref long tileProgressCount, long totalTileCount,ref bool pollForBatch) | ||
|
|
||
| private void ProcessBatch(IData baseData, List<Tile> newTiles, ref long tileProgressCount, long totalTileCount, ref bool pollForBatch) | ||
| { | ||
| ConcurrentBag<Tile> tiles = new ConcurrentBag<Tile>(); | ||
|
|
||
| if (newTiles.Count == 0) | ||
| { | ||
| pollForBatch = false; | ||
|
|
@@ -118,7 +118,7 @@ private void ProcessBatch(IData baseData, List<Tile> newTiles, ref long tileProg | |
| var targetCoords = newTile.GetCoord(); | ||
| List<CorrespondingTileBuilder> correspondingTileBuilders = new List<CorrespondingTileBuilder>() | ||
| { | ||
| () => baseData.GetCorrespondingTile(targetCoords, shouldUpscale), | ||
| () => baseData.GetCorrespondingTile(targetCoords, null, shouldUpscale), | ||
| () => newTile | ||
| }; | ||
|
|
||
|
|
@@ -137,7 +137,7 @@ private void ProcessBatch(IData baseData, List<Tile> newTiles, ref long tileProg | |
| } | ||
|
|
||
| private void ParallelRun(IData baseData, IData newData, | ||
| BatchStatusManager batchStatusManager, long tileProgressCount, long totalTileCount, string? resumeBatchIdentifier, bool resumeMode,bool pollForBatch) | ||
| BatchStatusManager batchStatusManager, long tileProgressCount, long totalTileCount, string? resumeBatchIdentifier, bool resumeMode, bool pollForBatch) | ||
| { | ||
| var numOfThreads = this._configManager.GetConfiguration<int>("GENERAL", "parallel", "numOfThreads"); | ||
| Parallel.For(0, numOfThreads, new ParallelOptions { MaxDegreeOfParallelism = -1 }, _ => | ||
|
|
@@ -151,7 +151,7 @@ private void ParallelRun(IData baseData, IData newData, | |
| } | ||
| }); | ||
| } | ||
|
|
||
| public void Validate(IData baseData, IData newData, string? incompleteBatchIdentifier) | ||
| { | ||
| List<Tile> newTiles; | ||
|
|
@@ -170,7 +170,7 @@ public void Validate(IData baseData, IData newData, string? incompleteBatchIdent | |
| for (int i = 0; i < newTiles.Count; i++) | ||
| { | ||
| Tile newTile = newTiles[i]; | ||
| bool baseTileExists = baseData.TileExists(newTile.GetCoord()); | ||
| bool baseTileExists = baseData.TileExists(newTile.GetCoord(), null); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tile format parameter should not be null, as it would break the cli when using S3 or FS. The format should be a cli argument. |
||
|
|
||
| if (baseTileExists) | ||
| { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The tile format parameter should not be null, as it would break the cli when using S3 or FS. The format should be a cli argument.