Skip to content

DataAccess config for type and load - #2440

Merged
karussell merged 18 commits into
masterfrom
mmap_config
Nov 1, 2021
Merged

karussell merged 18 commits into
masterfrom
mmap_config

Conversation

@karussell

@karussell karussell commented Oct 25, 2021 •

Copy link
Copy Markdown
Member

Fixes #2416 and was discussed in #2432.

Use the following config:

graph.dataaccess.default_type: RAM_STORE

# default preload for MMAP is 0%
graph.dataaccess.type.nodes_ch.*: MMAP
graph.dataaccess.type.shortcuts_.*: MMAP

# first rule matches
graph.dataaccess.mmap.preload.nodes_ch_car.*: 100
graph.dataaccess.mmap.preload.nodes_ch.*: 30

graph.dataaccess.mmap.preload.shortcuts_.*: 30
# so this rule would be ignored for car:
graph.dataaccess.mmap.preload.shortcuts_car.*: 100

old config:

Details
graphhopper:

  graph.dataaccess.type.edges: MMAP;30
  graph.dataaccess.type.nodes: MMAP;30
  graph.dataaccess.type.shortcuts_mycar: MMAP;30
  graph.dataaccess.type.shortcuts_car_rarely_used: MMAP;0

  # the default type:
  graph.dataaccess.default_type: RAM_STORE
  # so all other DataAccess objects like nodes, edges, geometry, location_index, string_index_keys, string_index_vals of the base graph get this default type

dataAccessType = DAType.fromString(graphDATypeStr);
dataAccessDefaultType = DAType.fromString(ghConfig.getString("graph.dataaccess", "RAM_STORE"));
for (Map.Entry<String, Object> entry : ghConfig.asPMap().toMap().entrySet()) {
if (entry.getKey().equals("graph.dataaccess.segment_size")) continue;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Should we use a different prefix like graph.dataaccess.type... to avoid this? But then this would be a bit inconsistent with the default DAType ala graph.dataaccess: RAM_STORE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I like it better with the prefix. Maybe rename graph.dataaccess to graph.dataaccess.default_type?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok. Will do. Will also try to support some simple pattern matching to reduce config hassle for multiple CH profiles.

@karussell karussell added this to the 5.0 milestone Oct 26, 2021
@karussell

karussell commented Oct 29, 2021 •

Copy link
Copy Markdown
Member Author

Ok. When we use this new config style (with pattern matching) and a separate preload entry would this work better for you @easbar ?

graph.dataaccess.default_type: RAM_STORE

# default preload for MMAP is 0%
graph.dataaccess.type.nodes_ch.*: MMAP
graph.dataaccess.type.shortcuts_.*: MMAP

# first rule matches
graph.dataaccess.mmap.preload.nodes_ch_car.*: 100
graph.dataaccess.mmap.preload.nodes_ch.*: 30

graph.dataaccess.mmap.preload.shortcuts_.*: 30
# so this rule would be ignored for car:
graph.dataaccess.mmap.preload.shortcuts_car.*: 100

@easbar

easbar commented Oct 29, 2021

Copy link
Copy Markdown
Member

Yes!

@karussell
karussell merged commit e82ca45 into master Nov 1, 2021
@karussell
karussell deleted the mmap_config branch November 1, 2021 09:43
@easbar

easbar commented Nov 1, 2021

Copy link
Copy Markdown
Member

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When using MMAP provide an option to force load the graph

2 participants