-
Notifications
You must be signed in to change notification settings - Fork 28
AWS S3 support #433
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
base: master
Are you sure you want to change the base?
AWS S3 support #433
Conversation
val protocol = getProtocol(marSavePath) | ||
|
||
if ("file".equalsIgnoreCase(protocol)) { | ||
print("Local") |
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.
remove or enhance these prints (or log)
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.
removed the debug statements
jarFileList = jarFileList ::: List(new File(modelSrcDir.toString)) | ||
} | ||
else { | ||
print("not local") |
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.
ditto
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.
removed
* @return The protocol for the given source. | ||
*/ | ||
def getProtocol(source: String): String = { | ||
require(source != null, "marfile source must not be null") |
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.
check for empty as well?
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.
ok
def getProtocol(source: String): String = { | ||
require(source != null, "marfile source must not be null") | ||
|
||
var protocol: String = null |
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.
make protocol a val and assign to the try statement directly
catch { | ||
case ex: Exception => | ||
if (source.startsWith("//")) { | ||
throw new IllegalArgumentException("Relative context: " + source) |
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.
"Relative context" - not sure how that message helps?
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.
changed it to: "Does not support Relative context: " + source
result = file.toURI.toURL.getProtocol | ||
} | ||
catch { | ||
case ex: Exception => result = "unknown" |
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.
I'm not a fan of this catch and return "unknown" --this mean you've go to have logic somewhere else to make sense of it. It's stronger to let the exception run free or at least have this method return a Try object.
val protocol = ScoringModelUtils.getProtocol(storagePath) | ||
|
||
if ("file".equalsIgnoreCase(protocol)) { | ||
print("Local") |
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.
improve print message.
Does this really mean local? What about s3? --does it fall under local or hdsf? Could provide more help in making the right set of options, besides local and hdfs?
Also, this reveals to me that the protocol/path work you've added above is not unique to ScoringModelUtils, but more generally to sparktk saveload. That logic should move to this more generic location. What do you think?
No description provided.