-
Notifications
You must be signed in to change notification settings - Fork 9k
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
HDFS-6874. Add GETFILEBLOCKLOCATIONS operation to HttpFS. #3322
Conversation
Change-Id: I9d0320cfc3286911784636254f2d99225e43ce8b
Change-Id: I520391820a98c87d3342983bdac144e5123a2e36
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jojochuang for rebasing the patch and addressing the most recent comments.
offset, length); | ||
} | ||
} catch (RemoteException e) { | ||
if (isGetFileBlockLocationsException(e)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (isGetFileBlockLocationsException(e)) { | |
// parsing the exception is needed only if the client thinks the service is compatible | |
if (isServerHCFSCompatible && isGetFileBlockLocationsException(e)) { |
...ject/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestHttpFSServer.java
Show resolved
Hide resolved
...ct/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
Outdated
Show resolved
Hide resolved
...-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/HttpFSServer.java
Outdated
Show resolved
Hide resolved
Change-Id: If6568f9d2227579f78f864794f3287ea0211c14a
💔 -1 overall
This message was automatically generated. |
...s-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
Outdated
Show resolved
Hide resolved
...hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
Outdated
Show resolved
Hide resolved
...hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
Outdated
Show resolved
Hide resolved
...hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/web/JsonUtilClient.java
Show resolved
Hide resolved
...ct/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
Outdated
Show resolved
Hide resolved
...ct/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
Outdated
Show resolved
Hide resolved
...ject/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/server/TestHttpFSServer.java
Show resolved
Hide resolved
Path path = new Path(pathStr); | ||
DistributedFileSystem dfs = (DistributedFileSystem) FileSystem | ||
.get(path.toUri(), TestHdfsHelper.getHdfsConf()); | ||
// Enable snapshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no i don't understand this. it doesn't look like snapshot is used at all.
Assert.assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode()); | ||
BlockLocation[] locations1 = | ||
dfs.getFileBlockLocations(new Path(file1), 0, 1); | ||
Assert.assertNotNull(locations1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it makes no sense to check nullity of locations1 using hdfs. The code doesn't change the file, so why check it?
Assert.assertEquals(HttpURLConnection.HTTP_OK, conn1.getResponseCode()); | ||
BlockLocation[] locations2 = | ||
dfs.getFileBlockLocations(new Path(file1), 0, 1); | ||
Assert.assertNotNull(locations2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, too.
Change-Id: I3f95a9839115f928de6b189783f283669b18e61a
💔 -1 overall
This message was automatically generated. |
Hey @jojochuang Have you checked whether the failed unit tests are related to the changes? [ERROR] Errors:
[ERROR] org.apache.hadoop.fs.http.client.TestHttpFSFWithSWebhdfsFileSystem.testOperationDoAs[43](org.apache.hadoop.fs.http.client.TestHttpFSFWithSWebhdfsFileSystem)
[ERROR] Run 1: TestHttpFSFWithSWebhdfsFileSystem>BaseTestHttpFSWith.testOperationDoAs:1391->BaseTestHttpFSWith.access$100:115->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2043 » SSL
[ERROR] Run 2: TestHttpFSFWithSWebhdfsFileSystem>BaseTestHttpFSWith.testOperationDoAs:1391->BaseTestHttpFSWith.access$100:115->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2043 » SSL
[ERROR] Run 3: TestHttpFSFWithSWebhdfsFileSystem>BaseTestHttpFSWith.testOperationDoAs:1391->BaseTestHttpFSWith.access$100:115->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2043 » SSL
[INFO]
[ERROR] org.apache.hadoop.fs.http.client.TestHttpFSFWithSWebhdfsFileSystem.testOperation[43](org.apache.hadoop.fs.http.client.TestHttpFSFWithSWebhdfsFileSystem)
[ERROR] Run 1: TestHttpFSFWithSWebhdfsFileSystem>BaseTestHttpFSWith.testOperation:1380->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2043 » SSL
[ERROR] Run 2: TestHttpFSFWithSWebhdfsFileSystem>BaseTestHttpFSWith.testOperation:1380->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2043 » SSL
[ERROR] Run 3: TestHttpFSFWithSWebhdfsFileSystem>BaseTestHttpFSWith.testOperation:1380->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2043 » SSL
[INFO]
[ERROR] org.apache.hadoop.fs.http.client.TestHttpFSFileSystemLocalFileSystem.testOperationDoAs[43](org.apache.hadoop.fs.http.client.TestHttpFSFileSystemLocalFileSystem)
[ERROR] Run 1: TestHttpFSFileSystemLocalFileSystem>BaseTestHttpFSWith.testOperationDoAs:1391->BaseTestHttpFSWith.access$100:115->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2014 » ClassCast
[ERROR] Run 2: TestHttpFSFileSystemLocalFileSystem>BaseTestHttpFSWith.testOperationDoAs:1391->BaseTestHttpFSWith.access$100:115->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2014 » ClassCast
[ERROR] Run 3: TestHttpFSFileSystemLocalFileSystem>BaseTestHttpFSWith.testOperationDoAs:1391->BaseTestHttpFSWith.access$100:115->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2014 » ClassCast
[INFO]
[ERROR] org.apache.hadoop.fs.http.client.TestHttpFSFileSystemLocalFileSystem.testOperation[43](org.apache.hadoop.fs.http.client.TestHttpFSFileSystemLocalFileSystem)
[ERROR] Run 1: TestHttpFSFileSystemLocalFileSystem>BaseTestHttpFSWith.testOperation:1380->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2014 » ClassCast
[ERROR] Run 2: TestHttpFSFileSystemLocalFileSystem>BaseTestHttpFSWith.testOperation:1380->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2014 » ClassCast
[ERROR] Run 3: TestHttpFSFileSystemLocalFileSystem>BaseTestHttpFSWith.testOperation:1380->BaseTestHttpFSWith.operation:1351->BaseTestHttpFSWith.testGetFileBlockLocationsFallback:2014 » ClassCast
|
Hey Ahmed. Thanks a lot but I think this is going to require another few iterations. |
Hi @jojochuang. Thank you so much for working on this. Wanted to check if you are planning to take this forward or shall I plan to work on this. |
Although the Jira pulls Github comments, this kind of question would better be posted on Jira. |
Thanks @amahussein for pointing it out. Let me ask on JIRA. |
Fixed by #4750 |
Description of PR
This is a rebase of the patch file 11 attached to HDFS-6874.
The GETFILEBLOCKLOCATIONS is HCFS compatible. Add support of it to httpfs to makes it possible for more applications to run directly against HttpFS server.
Add GETFILEBLOCKLOCATIONS op support for httpfs server (HttpFSServer). Add the same for httpfs client (HttpFSFileSystem)
Let webhdfs client (WebHdfsFileSystem ) tries the new GETFILEBLOCKLOCATIONS op if the server supports it. Otherwise, fall back to the old GET_FILE_BLOCK_LOCATIONS op. The selection is cached so the second invocation doesn't need to trial and error again.
How was this patch tested?
Unit tests.