Uh oh!
There was an error while loading. Please reload this page.
- 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
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
80e63a0598de3df65e28543234bd63a52d4a211cbe4db37c5817465f4a686baeb96c6978453d0548f95361e0d873c65876File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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); | ||
ContributorAuthor 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) | ||
| { | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.