Skip to content

Commit

Permalink
remove bgzf reading from s3 resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Dec 16, 2016
1 parent 126a1cf commit 9b494b3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 172 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static com.hubspot.singularity.WebExceptions.checkNotFound;
import static com.hubspot.singularity.WebExceptions.timeout;

import java.net.URL;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -42,7 +41,6 @@
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.google.inject.Inject;
import com.hubspot.mesos.JavaUtils;
import com.hubspot.mesos.json.MesosFileChunkObject;
import com.hubspot.singularity.SingularityAuthorizationScope;
import com.hubspot.singularity.SingularityDeployHistory;
import com.hubspot.singularity.SingularityRequest;
Expand All @@ -65,7 +63,6 @@
import com.hubspot.singularity.data.TaskManager;
import com.hubspot.singularity.data.history.HistoryManager;
import com.hubspot.singularity.data.history.RequestHistoryHelper;
import com.hubspot.singularity.helpers.BlockCompressedFileHelper;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
Expand Down Expand Up @@ -381,38 +378,6 @@ public List<SingularityS3Log> getS3LogsForRequest(
}
}

@GET
@Path("/request/{requestId}/read")
@ApiOperation("Retrieve the list of logs stored in S3 for a specific request.")
public MesosFileChunkObject readS3LogForRequest(
@ApiParam("The request ID to search for") @PathParam("requestId") String requestId,
@ApiParam("S3 Key for the log to read") @QueryParam("key") String key,
@ApiParam("Offset to read in the log file") @QueryParam("offset") Optional<Long> offset,
@ApiParam("Length in bytes to read") @QueryParam("length") Optional<Integer> length,
@ApiParam("Read backwards from offset") @QueryParam("reverse") Optional<Boolean> reverse) throws Exception {
checkS3();
checkForCompressedFile(key);

try {
SingularityS3Log s3Log = getS3Log(configuration.get(), requestId, key);

if (!offset.isPresent() && length.or(0) == 0) {
// Imitate the mesos slave api and return the file size when no length is requested
return new MesosFileChunkObject("", s3Log.getSize(), Optional.<Long>absent());
}

if (reverse.or(false)) {
return BlockCompressedFileHelper.readInReverseFromOffset(new URL(s3Log.getDownloadUrl()), offset, length.or(DEFAULT_READ_LENGTH));
} else {
return BlockCompressedFileHelper.getChunkAtOffset(new URL(s3Log.getDownloadUrl()), offset, length.or(DEFAULT_READ_LENGTH));
}
} catch (TimeoutException te) {
throw timeout("Timed out waiting for response from S3 for %s", requestId);
} catch (Throwable t) {
throw Throwables.propagate(t);
}
}

@GET
@Path("/request/{requestId}/deploy/{deployId}")
@ApiOperation("Retrieve the list of logs stored in S3 for a specific deploy.")
Expand Down
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,6 @@
<artifactId>rfc5545-datetime</artifactId>
<version>0.2.2</version>
</dependency>

<dependency>
<groupId>com.github.samtools</groupId>
<artifactId>htsjdk</artifactId>
<version>2.6.1</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 9b494b3

Please sign in to comment.