Skip to content
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

Feature/oasis refactor phase3 step2 #368

Merged
merged 3 commits into from
Jul 29, 2020

Conversation

CodeBear801
Copy link

@CodeBear801 CodeBear801 commented Jul 28, 2020

Issue

  • Targeting issue: the issue will be CLOSED once the PR merged. If there is no issue that addresses the problem, please open a corresponding issue and link it here. Uses the Closes keyword to close them automatically.

Closes #364

  • Any other related issue? Mention them here.

Description

A summary description for what the PR achieves.

Major changes:

  • Add new package graph and place
  • In place, abstract out services of this package into interface
    • iterator_interface.go
    • spatial_querier_interface.go

After refactoring, here is new hierarchy

directory level

.
├── entrypoint
├── graph
│   ├── chargingstrategy
│   └── stationgraph
├── internal
│   ├── entity
│   ├── mock
│   ├── osrmhelper
│   ├── resourcemanager
│   └── searchhelper
├── place
│   ├── iterator
│   │   ├── clouditerator
│   │   ├── iteratoralg
│   │   ├── iteratortype
│   │   └── localiterator
│   ├── spatialindexer
│   │   ├── placeloader
│   │   ├── ranker
│   │   └── s2indexer
│   ├── topograph
│   └── topoquerier
└── solution
    └── selectionstrategy

image

file level

.
├── entrypoint
│   ├── http_handler.go
│   └── http_response_formator.go
├── graph
│   ├── chargingstrategy
│   │   ├── doc.go
│   │   ├── fake_charge_strategy.go
│   │   ├── simple_charge_strategy.go
│   │   ├── simple_charge_strategy_test.go
│   │   └── strategy_interface.go
│   ├── doc.go
│   └── stationgraph
│       ├── dijkstra.go
│       ├── dijkstra_test.go
│       ├── doc.go
│       ├── edge.go
│       ├── edge_2_weight.go
│       ├── edge_2_weight_test.go
│       ├── graph_interface.go
│       ├── graph_mock.go
│       ├── node.go
│       ├── node_container.go
│       ├── node_container_test.go
│       ├── node_graph.go
│       ├── node_graph_test.go
│       ├── priority_queue.go
│       ├── priority_queue_test.go
│       ├── query_heap.go
│       ├── query_heap_test.go
│       ├── station_graph.go
│       └── station_graph_test.go
├── internal
│   ├── entity
│   │   ├── doc.go
│   │   ├── place_entity.go
│   │   └── solution_entity.go
│   ├── mock
│   │   ├── doc.go
│   │   ├── osrm_table.go
│   │   ├── spatialfinder_type.go
│   │   ├── spatialindexer_finder.go
│   │   └── spatialindexer_pointiterator.go
│   ├── osrmhelper
│   │   └── helper.go
│   ├── resourcemanager
│   │   └── resource_manager.go
│   └── searchhelper
│       └── helper.go
├── place
│   ├── doc.go
│   ├── iterator
│   │   ├── clouditerator
│   │   │   ├── basic_iterator.go
│   │   │   ├── basic_iterator_test.go
│   │   │   ├── cloud_based_iterator_impl.go
│   │   │   ├── dest_iterator.go
│   │   │   ├── dest_iterator_mock.go
│   │   │   ├── dest_iterator_test.go
│   │   │   ├── doc.go
│   │   │   ├── low_energy_location_iterator.go
│   │   │   ├── low_energy_location_iterator_mock.go
│   │   │   ├── low_energy_location_iterator_test.go
│   │   │   ├── orig_iterator.go
│   │   │   ├── orig_iterator_mock.go
│   │   │   └── orig_iterator_test.go
│   │   ├── doc.go
│   │   ├── iterator_factory.go
│   │   ├── iteratoralg
│   │   │   ├── dest_iterator.go
│   │   │   ├── orig_iterator.go
│   │   │   ├── querier_impl_by_stationfinder.go
│   │   │   ├── querier_impl_by_stationfinder_test.go
│   │   │   ├── stations_iterator_alg.go
│   │   │   └── stations_iterator_alg_test.go
│   │   ├── iteratortype
│   │   │   ├── const.go
│   │   │   ├── type.go
│   │   │   └── type_test.go
│   │   └── localiterator
│   │       ├── basic_local_iterator.go
│   │       ├── basic_local_iterator_test.go
│   │       ├── dest_station_local_iterator.go
│   │       ├── doc.go
│   │       ├── local_based_iterator_impl.go
│   │       ├── low_energy_location_local_iterator.go
│   │       └── orig_local_iterator.go
│   ├── iterator_interface.go
│   ├── spatial_querier_interface.go
│   ├── spatialindexer
│   │   ├── doc.go
│   │   ├── placeloader
│   │   │   ├── loader.go
│   │   │   ├── place_format.go
│   │   │   └── sample_input.json
│   │   ├── ranker
│   │   │   ├── doc.go
│   │   │   ├── osrm_ranker.go
│   │   │   ├── osrm_ranker_test.go
│   │   │   ├── rank_agent.go
│   │   │   ├── rank_agent_test.go
│   │   │   ├── rank_by_great_circle_distance_impl.go
│   │   │   ├── rank_by_osrm_shortest_path_impl.go
│   │   │   ├── rank_by_osrm_shortest_path_impl_test.go
│   │   │   ├── ranker_factory.go
│   │   │   ├── simple_ranker.go
│   │   │   └── simple_ranker_test.go
│   │   └── s2indexer
│   │       ├── builder.go
│   │       ├── builder_test.go
│   │       ├── dumper.go
│   │       ├── dumper_test.go
│   │       ├── indexer.go
│   │       ├── spatial_query.go
│   │       └── spatial_query_test.go
│   ├── topo_querier_interface.go
│   ├── topograph
│   │   ├── builder.go
│   │   ├── builder_test.go
│   │   ├── doc.go
│   │   ├── dumper.go
│   │   ├── dumper_test.go
│   │   ├── memory_topo_graph.go
│   │   ├── memory_topo_graph_mock.go
│   │   ├── statistic.go
│   │   └── statistic_test.go
│   └── topoquerier
│       ├── doc.go
│       ├── place_topo_querier.go
│       └── place_topo_querier_test.go
└── solution
    ├── doc.go
    ├── entity.go
    ├── generator_impl.go
    ├── interface.go
    ├── selection_strategy.go
    ├── selectionstrategy
    │   ├── doc.go
    │   ├── has_enough_energy.go
    │   ├── has_enough_energy_test.go
    │   ├── reachable_by_multiple_charge.go
    │   ├── reachable_by_multiple_charge_test.go
    │   ├── reachable_by_single_charge.go
    │   └── reachable_by_single_charge_test.go
    └── status_code.go

Tasklist

Prerequirements

  • Want to contribute? Great! First, please read this page Contribution Guidelines.
  • If your PR is still work in progress please attach the relevant label.

@CodeBear801 CodeBear801 self-assigned this Jul 28, 2020
@CodeBear801 CodeBear801 added the Refactor Rewrite existing code in order to improve its readability, reusability or structure label Jul 28, 2020
@CodeBear801 CodeBear801 added this to the v10.4.0 milestone Jul 28, 2020
@wangyoucao577
Copy link

image

Crazy...

@wangyoucao577 wangyoucao577 changed the title Feature/oasis reafactor phase3 step2 Feature/oasis refactor phase3 step2 Jul 29, 2020
@CodeBear801
Copy link
Author

image

Crazy...

Still on the way...

@CodeBear801 CodeBear801 merged commit d21e5dd into master Jul 29, 2020
@CodeBear801 CodeBear801 deleted the feature/oasis-reafactor-phase3-step2 branch July 29, 2020 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Rewrite existing code in order to improve its readability, reusability or structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Oasis service for Graph and Place layer
2 participants