Skip to content

feat: add concurrent upscale (MAPCO-3529) - #119

Merged
asafMasa merged 7 commits into
masterfrom
concurrentUpscale
Oct 24, 2023
Merged

feat: add concurrent upscale (MAPCO-3529)#119
asafMasa merged 7 commits into
masterfrom
concurrentUpscale

Conversation

@asafMasa

Copy link
Copy Markdown
Contributor
QuestionAnswer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Support concurrent get tiles for upscale

@asafMasaasafMasa added In Review code review in progress enhancement New feature or request labels Oct 10, 2023
@asafMasaasafMasa changed the title feat: add concurrent upscalefeat: add concurrent upscale (MAPCO-3529)Oct 10, 2023
Comment threadMergerLogic/DataTypes/Data.cs Outdated
Tile? lastTile = null;
coordsList.Add(new Coord(i, baseTileX, baseTileY));
}
var response = this.InternalGetExistingTile(coordsList.ToArray());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of adding this function please move it's code to here and remove it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

fixed

Comment threadMergerLogic/DataTypes/Data.cs Outdated
}

// Async method to request all tiles that can be used for "upscale" concurrently
var responseOfGetlastTileAsync = async delegate (Coord[] coordsArray)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Rename to getUpscaleTiles.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

fixed

Comment threadMergerLogic/DataTypes/Data.cs Outdated
Comment on lines +235 to +245
if (zOrderToTileDictionary.IsEmpty)
{
break;
return null;
}
}
string message = lastTile == null ? "null" : $"z:{lastTile.Z}, x:{lastTile.X}, y:{lastTile.Y}";
this._logger.LogDebug($"[{MethodBase.GetCurrentMethod().Name}] ended, lastTile: {message}");
return lastTile;
// Get first valid tile that can be upscaled
List<KeyValuePair<int, Tile?>> list = new List<KeyValuePair<int, Tile?>>(zOrderToTileDictionary.ToArray());
var orderedList = list.OrderBy(kvp => kvp.Key);
Tile? lastTile = orderedList.Last().Value;
string message = lastTile == null ? "null" : $"z:{lastTile.Z}, x:{lastTile.X}, y:{lastTile.Y}";
this._logger.LogDebug($"[{MethodBase.GetCurrentMethod().Name}] ended, lastTile: {message}");
return lastTile;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Move outside to the function.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done

Comment threadMergerLogic/DataTypes/Data.cs Outdated

// Go over zoom levels until a tile is found (may not find tile)
// Define all tiles coordinates that needs to be requested for upscale
List<Coord> coordsList = new List<Coord>(MaxZoomRead - (MaxZoomRead - coords.Z));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please change to coords.Z as limit.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

fixed

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

Labels

enhancementNew feature or requestIn Reviewcode review in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@asafMasa@shimoncohen@asafmas-rnd