Skip to content

Commit

Permalink
fix NPE on query serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobin Baker committed Jun 19, 2017
1 parent 07ceb18 commit 9f80f40
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/edu/washington/escience/myria/io/AmazonS3Source.java
Expand Up @@ -13,13 +13,11 @@
import javax.ws.rs.core.Response.Status;

import org.apache.commons.httpclient.URIException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider;

import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;

import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.GetObjectRequest;
import com.fasterxml.jackson.annotation.JsonCreator;
Expand Down Expand Up @@ -59,7 +57,8 @@ public AmazonS3Source(
@JsonProperty(value = "startRange") final Long startRange,
@JsonProperty(value = "endRange") final Long endRange)
throws URIException {
s3Uri = URI.create(Objects.requireNonNull(uri, "Parameter uri to UriSource may not be null"));
s3Uri =
URI.create(Objects.requireNonNull(uri, "Parameter uri to AmazonS3Source may not be null"));
if (!s3Uri.getScheme().equals("s3")) {
throw new URIException("URI must contain an S3 scheme");
}
Expand All @@ -72,6 +71,11 @@ public AmazonS3Source(
this.endRange = MoreObjects.firstNonNull(endRange, getFileSize());
}

@JsonProperty("s3Uri")
private String getUriString() {
return s3Uri.toString();
}

public AmazonS3Client getS3Client() throws MyriaApiException {
if (s3Client == null) {
/**
Expand Down

0 comments on commit 9f80f40

Please sign in to comment.