-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-15691 Add PathCapabilities to FS and FC to complement StreamCapabilities #568
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
Closed
steveloughran
wants to merge
4
commits into
apache:trunk
from
steveloughran:filesystem/HADOOP-15691-fs-path-capabilities
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5d68e43
HADOOP-15691 Add PathCapabilities to FS and FC to complement StreamCa…
steveloughran fda80f5
HADOOP-15691 path capabilities
steveloughran 600d11c
HADOOP-15691. Address comments
steveloughran 958c402
HADOOP-15691 -fix final nits.
steveloughran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
...mmon-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonPathCapabilities.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.fs; | ||
|
|
||
| /** | ||
| * Common path capabilities. | ||
| */ | ||
| public final class CommonPathCapabilities { | ||
|
|
||
| private CommonPathCapabilities() { | ||
| } | ||
|
|
||
| /** | ||
| * Does the store support | ||
| * {@code FileSystem.setAcl(Path, List)}, | ||
| * {@code FileSystem.getAclStatus(Path)} | ||
| * and related methods? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_ACLS = "fs.capability.paths.acls"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem.append(Path)}? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_APPEND = "fs.capability.paths.append"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem.getFileChecksum(Path)}? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_CHECKSUMS = "fs.capability.paths.checksums"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem.concat(Path, Path[])}? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_CONCAT = "fs.capability.paths.concat"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem.listCorruptFileBlocks(Path)} ()}? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_LIST_CORRUPT_FILE_BLOCKS = | ||
| "fs.capability.paths.list-corrupt-file-blocks"; | ||
|
|
||
| /** | ||
| * Does the store support | ||
| * {@code FileSystem.createPathHandle(FileStatus, Options.HandleOpt...)} | ||
| * and related methods? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_PATHHANDLES = "fs.capability.paths.pathhandles"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem.setPermission(Path, FsPermission)} | ||
| * and related methods? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_PERMISSIONS = "fs.capability.paths.permissions"; | ||
|
|
||
| /** | ||
| * Does this filesystem connector only support filesystem read operations? | ||
| * For example, the {@code HttpFileSystem} is always read-only. | ||
| * This is different from "is the specific instance and path read only?", | ||
| * which must be determined by checking permissions (where supported), or | ||
| * attempting write operations under a path. | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_READ_ONLY_CONNECTOR = | ||
| "fs.capability.paths.read-only-connector"; | ||
|
|
||
| /** | ||
| * Does the store support snapshots through | ||
| * {@code FileSystem.createSnapshot(Path)} and related methods?? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_SNAPSHOTS = "fs.capability.paths.snapshots"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem.setStoragePolicy(Path, String)} | ||
| * and related methods? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_STORAGEPOLICY = | ||
| "fs.capability.paths.storagepolicy"; | ||
|
|
||
| /** | ||
| * Does the store support symlinks through | ||
| * {@code FileSystem.createSymlink(Path, Path, boolean)} and related methods? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_SYMLINKS = | ||
| "fs.capability.paths.symlinks"; | ||
|
|
||
| /** | ||
| * Does the store support {@code FileSystem#truncate(Path, long)} ? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_TRUNCATE = | ||
| "fs.capability.paths.truncate"; | ||
|
|
||
| /** | ||
| * Does the store support XAttributes through | ||
| * {@code FileSystem#.setXAttr()} and related methods? | ||
| * Value: {@value}. | ||
| */ | ||
| public static final String FS_XATTRS = "fs.capability.paths.xattrs"; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Been talking about something like this for years, thanks for working on this. Taking a
Pathinstead of aschemeseems right: it is flexible (general design, specific implementation applies here). Was curious about examples where different paths in the same FS would have different capabilities. I suppose S3A could have different buckets in different regions or with different configurations (e.g. permissions, or S3Guard enabled/disabled, etc.) Just noticed you mentioned ViewFS as well. Another good case for per-path capabilities.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.
Files HDFS encryption zones behave differently; viewfs relays things, and any DFS whose mount points may have different semantics can do it. Oh, and WASB has an option for special path where leases need to be acquired before renames -HBase needs that