Repository navigation
Remove the unused KDTree and HexCellRegistry - #19
Merged
Merged
Conversation
928e7c3 moved MarkerManager's spatial search onto MarkerGridIndex. Since then the hex-cell registry was only built on demand by findByIdPrefix, which nothing calls: no SDK module, sample or doc uses it. KDTree existed only to serve the registry, and HexCellWithDistance only to carry their results. Remove all of them, the lazy registry plumbing in MarkerManager, and the registry's share of the memory estimate, along with the tests and doc pages that covered them. HexGeocell and HexCell stay; MarkerManager still takes a geocell. This removes public classes and a public method, so the API dump shrinks accordingly.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
削除するもの
使われていない hex セル索引と K-D 木を android-sdk-core から削除します。公開 API の破壊的変更です(公開クラスと公開メソッドの削除)。
com.mapconductor.core.geocell.KDTree(とKDTreeStats)com.mapconductor.core.geocell.HexCellRegistry(とRegistryStats)com.mapconductor.core.geocell.HexCellWithDistance(上記 2 つの戻り値専用)MarkerManager.findByIdPrefix(prefix)MarkerManager内のcellRegistry/ensureCellRegistryと、メモリ見積もりのうち hex 索引分HexCellRegistryRebuildTest/KDTreeRadiusTest、ドキュメントdocs/geocell/HexCellRegistry.kt.md/docs/geocell/KDTree.kt.mdHexGeocell/HexCell/HexGeocellInterfaceは残します(MarkerManagerなどがコンストラクタで geocell を受け取るため)。docs/marker/MarkerManager.kt.mdとMarkerGridIndexの KDoc は、削除したコードを説明しないように直しました。同じ削除を ios-sdk-core と js-sdk-core でも行っています。
理由
928e7c3(Index markers on a flat grid, not hex cells and a kd-tree)で
MarkerManagerの空間検索はMarkerGridIndexに移りました。それ以降HexCellRegistryを作るのはMarkerManager.findByIdPrefixだけで、その呼び出し元はどこにもありません(SDK の各モジュール、サンプル、ドキュメントすべてを確認済み)。KDTreeはHexCellRegistryからしか使われていません。確認
./gradlew testDebugUnitTest: 286 件すべて成功(削除したテスト 6 件を除いた数)apiCheck: 成功。api/android-sdk-core.apiは親リポジトリのgradle/api-surface.gradle.ktsと同じ手順でapiDumpし直したもので、差分は上記クラスとfindByIdPrefixの削除のみ(追加なし)runKtlintCheckOverMainSourceSet): 変更したファイルに新しい違反なし(MarkerManager.ktの 3 件は develop にもある既存のもの)/Users/masashi/mapconductor全体(build / node_modules / .build / dist を除く)でKDTree/KDTreeStats/HexCellRegistry/RegistryStats/HexCellWithDistance/findByIdPrefixを検索し、android-sdk-core 以外(他の android-sdk モジュール、サンプル、ドキュメント)にヒットなし