Skip to content

Why do we have static edge and node IDs? #556

Closed

Description

@karussell

Although we have a multi threaded parsing process we still have static edge and node IDs. Of course, if the OSM source change the IDs will change but still "static per file" which is an important property for many scenarios. We are testing this already in the RoutingAlgorithmIT but I wasn't 100% sure how this can be achieved as the integration was done long ago by @NopMap. Now I wanted to clarify this and here are my findings confirming this:

  • there is a PbfStreamSplitter extracting raw data of every PBF blob (PbfBlobResult), but does so in sequence
  • the splitter creates new PbfBlobResult per area to a queue preserving the order: LinkedList<PbfBlobResult>. And if there are too many blobs the splitter will block. (Here the blocking is done manually, done in the copied copy from the external public domain library osmosis)
  • then every blob itself is sent in a chunk to the sink, i.e. OSMInputFile but only if the PbfBlobResult is complete, which ensures preserving the order.
  • another queue in OSMInputFile (LinkedBlockingQueue<OSMElement>) is used to return single OSMElements to the OSMReader. A blocking queue is used to avoid that the parsing code can flood the graph construction.

Activity

  1. zhiqiangZHAO commented on Nov 2, 2015

    @zhiqiangZHAO
    Contributor

    Hi Peter,

    Based on your description, I don't understand why GH use multi-thread. It seems a single thread procedure.

    And I want to confirm, do you mean for the exact same osm.pbf file, no matter when we run the GH, the internal edge ID is exact the same? Actually, I think the whole graph is exactly same.

  2. NopMap commented on Nov 2, 2015

    @NopMap
    Contributor

    The procedure is multi-threaded with multiple worker threads, seperating I/O operations from data processing and doing the processing of multiple chunks of data in parallel. Much faster than doing everything in a single thread, but does not scale indefinitely.

  3. zhiqiangZHAO commented on Nov 2, 2015

    @zhiqiangZHAO
    Contributor

    You think the bottleneck is the I/O, so you use multi-thread to read data chunk from disk. CPU is much faster than I/O, so you use single thread to process the OSMElement. Am I right?

  4. karussell commented on Nov 3, 2015

    @karussell
    MemberAuthor

    And I want to confirm, do you mean for the exact same osm.pbf file, no matter when we run the GH, the internal edge ID is exact the same? Actually, I think the whole graph is exactly same.

    yes

    CPU is much faster than I/O, so you use single thread to process the OSMElement. Am I right?

    not only because CPU is faster but also because the import is simpler and we don't need synchs

  5. zhiqiangZHAO commented on Nov 4, 2015

    @zhiqiangZHAO
    Contributor

    Hi Peter,

    Yes. Exactly. I we use single thread, no need to synch, and whole thing will be simpler.
    Like I can rebuild data, which kept the order.
    Thank you very much!

  6. karussell commented on Jan 13, 2017

    @karussell
    MemberAuthor

    Hmmh, I think 'if there are too many blobs the splitter will block' is not correct. At least I cannot see this blocking, which might be the reason of #916

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions