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

Added command line switch that allows saving to proto format #49

Merged
merged 6 commits into from
Aug 30, 2018
Merged

Added command line switch that allows saving to proto format #49

merged 6 commits into from
Aug 30, 2018

Conversation

lucaspcram
Copy link
Contributor

@lucaspcram lucaspcram commented Aug 20, 2018

An optional command line switch useJavaFormat=true can be provided to generate atlas files using the old java serialization format. When this switch is not provided it will be set to false by default, and the new protobuf format will be used.

MikeGost
MikeGost previously approved these changes Aug 21, 2018
Copy link
Contributor

@MikeGost MikeGost left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @lucaspcram! Nit - 2 extra lines.

*/
public class AtlasProtoOutputFormat extends AbstractFileOutputFormat<Atlas>
{

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: extra line

}
return this.format.getRecordWriter(fileSystem, job, name, progress);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: extra line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch thanks!

@lucaspcram
Copy link
Contributor Author

I changed the switch so the generation is proto by default. Now you must provide a switch -useJavaFormat=true to use the old java format.

Copy link
Contributor

@MikeGost MikeGost left a comment

Choose a reason for hiding this comment

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

Still approving despite dismissal :)

Copy link
Contributor

@jwpgage jwpgage left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks @lucaspcram

Copy link
Collaborator

@matthieun matthieun left a comment

Choose a reason for hiding this comment

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

Thanks @lucaspcram! Any way those changes could be unit-tested (or integration tested)? The other ones are not, but we need to find new ways!

@lucaspcram
Copy link
Contributor Author

lucaspcram commented Aug 28, 2018

@matthieun I would imagine that the best way to (integration) test this would be to kick off a local Spark job, create a single atlas file (maybe we need a test PBF file in this repo?), and then verify its format using atlas. Would require some changes to PackedAtlas to allow for retrieval of serialization type.

Or are you thinking of something simpler that could fit in a unit test?

Copy link
Collaborator

@matthieun matthieun left a comment

Choose a reason for hiding this comment

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

Ok, thanks. This is not an easy path testing this right in this PR.

@matthieun
Copy link
Collaborator

Added #51

@matthieun matthieun merged commit 1e8aa1a into osmlab:dev Aug 30, 2018
@matthieun matthieun added this to the 4.0.9 milestone Aug 30, 2018
@lucaspcram lucaspcram deleted the protoswitch branch August 30, 2018 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants