Skip to content
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

Remove compressed log viewing endpoint #1380

Merged
merged 2 commits into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions SingularityService/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,6 @@
<artifactId>joda-time</artifactId>
</dependency>

<dependency>
<groupId>com.github.samtools</groupId>
<artifactId>htsjdk</artifactId>
</dependency>

</dependencies>

<build>
Expand Down

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