Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Generate unique filename to upload a topology package #601

Merged
merged 4 commits into from
May 8, 2016

Conversation

maosongfu
Copy link
Contributor

@maosongfu maosongfu commented May 8, 2016

  1. Add a UploaderUtils, providing utils method to generate unique filename to upload a topology package
  2. Add unit tests for it
  3. Refactor IUploader implementation to use this utils method to generate consistent filename

Maosong Fu added 2 commits May 7, 2016 21:52
… package

1. Add a UploaderUtils, providing utils method to generate unique filename to upload a topology package
2. Add unit tests for it
3. Refactor IUploader implementation to use this utils method to generate consistent filename
@maosongfu maosongfu changed the title enerate unique filename to upload a topology package Generate unique filename to upload a topology package May 8, 2016
public static String generateFilename(
String topologyName,
String role) {
return generateFilename(topologyName, role, "", -1);
Copy link
Contributor

Choose a reason for hiding this comment

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

let us version 0 (since version numbers are never negative)

Copy link
Contributor

Choose a reason for hiding this comment

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

let us also use some value for tag as well.

@kramasamy
Copy link
Contributor

👍

@maosongfu maosongfu merged commit d6aa278 into master May 8, 2016
@maosongfu maosongfu deleted the mfu/generateUniqueUploadedFilename branch May 8, 2016 06:37
@maosongfu
Copy link
Contributor Author

@ajorgensen Could u please check whether your S3Uploader can also make use of this utils method?

String tag,
int version) {
return String.format("%s-%s-%s-%d-%d",
topologyName, role, tag, version, new Random().nextLong());
Copy link
Contributor

Choose a reason for hiding this comment

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

What if instead of random you use timestamp or some other temporal value? That way my would be easier to tell which artifact is the newest. Curios your thoughts on that.

@ajorgensen
Copy link
Contributor

@maosongfu I am away until Tuesday but I can take a look at it then.

saileshmittal pushed a commit that referenced this pull request May 18, 2016
* Provide utils method to generate unique filename to upload a topology package
1. Add a UploaderUtils, providing utils method to generate unique filename to upload a topology package
2. Add unit tests for it
3. Refactor IUploader implementation to use this utils method to generate consistent filename
saileshmittal pushed a commit that referenced this pull request May 19, 2016
* Provide utils method to generate unique filename to upload a topology package
1. Add a UploaderUtils, providing utils method to generate unique filename to upload a topology package
2. Add unit tests for it
3. Refactor IUploader implementation to use this utils method to generate consistent filename
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants