-
Notifications
You must be signed in to change notification settings - Fork 599
Generate unique filename to upload a topology package #601
Conversation
maosongfu
commented
May 8, 2016
•
edited
Loading
edited
- Add a UploaderUtils, providing utils method to generate unique filename to upload a topology package
- Add unit tests for it
- Refactor IUploader implementation to use this utils method to generate consistent filename
… 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
public static String generateFilename( | ||
String topologyName, | ||
String role) { | ||
return generateFilename(topologyName, role, "", -1); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
👍 |
@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()); |
There was a problem hiding this comment.
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.
@maosongfu I am away until Tuesday but I can take a look at it then. |
* 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
* 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