Skip to content

Commit

Permalink
add s3 option
Browse files Browse the repository at this point in the history
  • Loading branch information
jortiz16 committed Feb 5, 2016
1 parent 0323a6c commit ddf5517
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/edu/washington/escience/myria/io/UriSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ public class UriSink implements DataSink {
@JsonProperty
private final URI uri;

public UriSink(@JsonProperty(value = "uri", required = true) final String uri) throws CatalogException {
public UriSink(@JsonProperty(value = "uri", required = true) String uri) throws CatalogException {
if (uri.contains("s3")) {
uri = uri.replace("s3", "s3n");
}
this.uri = URI.create(Objects.requireNonNull(uri, "Parameter uri cannot be null"));
if (!this.uri.getScheme().equals("hdfs")) {
throw new CatalogException("URI must be an HDFS URI");
if (!this.uri.getScheme().equals("hdfs") && !this.uri.getScheme().equals("s3n")) {
throw new CatalogException("URI must be an HDFS or S3 URI");
}
}

Expand Down

2 comments on commit ddf5517

@senderista
Copy link
Contributor

Choose a reason for hiding this comment

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

s3a not s3n

@jortiz16
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops

Please sign in to comment.