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

Implemented HTTPRangedByteAccess. #277

Merged
merged 1 commit into from
Jun 26, 2014

Conversation

tdanford
Copy link
Contributor

HTTPRangedByteAccess supports HTTP range requests for ranges of resources. Includes a test
that executes against a few bytes of the test mouse chromosome on the berkeley server.

(Matt or Frank, check out the additional test case in ByteAccessSuite, let me know if using the URL of the mouse_chrM.bam, which is the same bam as used in the integration tests, is okay here in the unit tests too.)

This branch is a precursor to fixing the tests / integration tests on the big Parquet / RDD PR.

@fnothaft
Copy link
Member

@tdanford URL is fine to use, but (as someone who often works without internet access) I would prefer to have any test that needs internet access be part of the integration tests and not the unit tests.

@@ -16,8 +16,12 @@
package org.bdgenomics.adam.util

import java.io._
Copy link
Member

Choose a reason for hiding this comment

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

Please alphabetize imports.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a tool to do this? (I can't find it, if it's in IntelliJ.) Alternatively, can Scalariform do it?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scalariform has "lost momentum," :-(

@tdanford
Copy link
Contributor Author

Sure thing, Frank, let's talk about it on the call in a few minutes -- assuming you're going to make the call?

/**
* HTTPRangedByteAccess supports Ranged GET queries against HTTP resources.
*
* @param uri The URL of the resource, which should support ranged queries
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this class be in a separate file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It ... could be, sure. All the other ByteAccess implementations are in this one though.

Happy to go either way.

Copy link
Member

Choose a reason for hiding this comment

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

I'm just thinking that it'd be preferable to separate them out into their own package and files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll do that then.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/28/

// on the range request, below -- that's just the length of the portion of the resource that
// was returned).
response.getAllHeaders.find(_.getName == "Content-Length") match {
case None => -1L
Copy link
Member

Choose a reason for hiding this comment

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

I think it'd be preferable to throw an exception here instead of a garbage value?

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/29/

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/30/


val response = httpClient.execute(get)

// We want a 206 response to a ranged request, not your normal 200!
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity, why is this?

Copy link
Member

Choose a reason for hiding this comment

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

The 206 is a Partial Content response. Although, I'm unsure of whether we'd get a 206 if the range is the whole entity. @tdanford do we always expect a 206, or is this just because we are doing a partial request?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, OK! Might make sense to clarify that in the comment, since people may not be familiar with a 206 code.

@carlyeks
Copy link
Member

I've updated the tests to have a "networkconnected" profile which will run any network dependent unit tests. Also, I've moved the byte access & byte locator classes to an o.b.a.io package.


class ByteAccessSuite extends FunSuite with BeforeAndAfter {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be changed to extend NetworkConnected now?

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/31/

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/32/

@massie
Copy link
Member

massie commented Jun 24, 2014

Jenkins, test this please.

@massie
Copy link
Member

massie commented Jun 24, 2014

I bumped up the PermGen on the Java commandline

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/33/

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/36/

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/38/

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/39/

@massie
Copy link
Member

massie commented Jun 25, 2014

@tdanford Please run "./scripts/format-source" and push the changes to the topic branch for this pull request. Sorry for the inconvenience.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/41/

@massie
Copy link
Member

massie commented Jun 25, 2014

Jenkins, test this please.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/43/

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/48/

@tdanford
Copy link
Contributor Author

Carl and I are at a loss, as to why this is still failing.

- HTTPRangedByteAccess supports HTTP range requests for ranges of
  resources. Includes a test that executes against a few bytes of the
  test mouse chromosome on the berkeley server.
- Added a new TestTags and moved the "NetworkConnected" ones into that
- Running the "networkconnected" profile as part of the Jenkins test
@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/51/

fnothaft added a commit that referenced this pull request Jun 26, 2014
@fnothaft fnothaft merged commit 9f5f322 into bigdatagenomics:master Jun 26, 2014
@fnothaft
Copy link
Member

Thanks @tdanford and @carlyeks!

@tdanford tdanford deleted the http-byte-access branch June 26, 2014 19:12
@tdanford
Copy link
Contributor Author

Thanks Frank!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants