Skip to content
Permalink
Browse files

Fix WebUnderFileSystem after removing UFS Singleton

Fix the master build

pr-link: #9096
change-id: cid-2e80bc24938aba3f6a5590cc606918e15e95ff4f
  • Loading branch information...
apc999 authored and alluxio-bot committed May 15, 2019
1 parent fe853db commit 9c74c07c44fab39fb2cc823fb5b8bb74e04a61d6
@@ -12,7 +12,6 @@
package alluxio.underfs.web;

import alluxio.AlluxioURI;
import alluxio.conf.AlluxioConfiguration;
import alluxio.conf.PropertyKey;
import alluxio.underfs.ConsistentUnderFileSystem;
import alluxio.underfs.UfsDirectoryStatus;
@@ -62,12 +61,10 @@
*
* @param uri the {@link AlluxioURI} for this UFS
* @param ufsConf UFS configuration
* @param alluxioConf Alluxio configuration
*/
public WebUnderFileSystem(AlluxioURI uri, UnderFileSystemConfiguration ufsConf,
AlluxioConfiguration alluxioConf) {
super(uri, ufsConf, alluxioConf);
mTimeout = (int) mAlluxioConf.getMs(PropertyKey.UNDERFS_WEB_CONNECTION_TIMEOUT);
public WebUnderFileSystem(AlluxioURI uri, UnderFileSystemConfiguration ufsConf) {
super(uri, ufsConf);
mTimeout = (int) mUfsConf.getMs(PropertyKey.UNDERFS_WEB_CONNECTION_TIMEOUT);
}

@Override
@@ -111,7 +108,7 @@ public long getBlockSizeByte(String path) throws IOException {
throw new FileNotFoundException(path);
}

return mAlluxioConf.getBytes(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT);
return mUfsConf.getBytes(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT);
}

@Override
@@ -171,7 +168,7 @@ private UfsStatus getStatus(String path, String fileName) throws IOException {
contentLength = Long.parseLong(header.getValue());
} else if (headerName.equalsIgnoreCase("Last-Modified")) {
lastModified = parseTimestamp(header.getValue(),
mAlluxioConf.get(PropertyKey.UNDERFS_WEB_HEADER_LAST_MODIFIED));
mUfsConf.get(PropertyKey.UNDERFS_WEB_HEADER_LAST_MODIFIED));
}
}

@@ -210,7 +207,7 @@ public boolean isDirectory(String path) throws IOException {
Elements titleElements = Jsoup.connect(path).get().select("title");
if (titleElements.size() > 0) {
String title = titleElements.get(0).text();
List<String> titles = mAlluxioConf.getList(PropertyKey.UNDERFS_WEB_TITLES, ",");
List<String> titles = mUfsConf.getList(PropertyKey.UNDERFS_WEB_TITLES, ",");
for (final String t : titles) {
if (title.contains(t)) {
return true;
@@ -276,7 +273,7 @@ private long parseTimestamp(String datetime, String format) {
return null;
}

List<String> parentNames = mAlluxioConf.getList(PropertyKey.UNDERFS_WEB_PARENT_NAMES, ",");
List<String> parentNames = mUfsConf.getList(PropertyKey.UNDERFS_WEB_PARENT_NAMES, ",");
int flagIndex = -1;
for (int i = 0; flagIndex == -1 && i < listElements.size(); i++) {
for (final String flag : parentNames) {
@@ -13,7 +13,6 @@

import alluxio.AlluxioURI;
import alluxio.Constants;
import alluxio.conf.AlluxioConfiguration;
import alluxio.underfs.UnderFileSystem;
import alluxio.underfs.UnderFileSystemConfiguration;
import alluxio.underfs.UnderFileSystemFactory;
@@ -34,10 +33,9 @@
public WebUnderFileSystemFactory() {}

@Override
public UnderFileSystem create(String path, UnderFileSystemConfiguration conf,
AlluxioConfiguration alluxioConf) {
public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) {
Preconditions.checkNotNull(path, "path");
return new WebUnderFileSystem(new AlluxioURI(path), conf, alluxioConf);
return new WebUnderFileSystem(new AlluxioURI(path), conf);
}

@Override

0 comments on commit 9c74c07

Please sign in to comment.
You can’t perform that action at this time.