public final class DirectoryPolicyImpl extends Object implements DirectoryPolicy
DirectoryPolicy.MarkerPolicy
Modifier and Type | Field and Description |
---|---|
static DirectoryPolicy |
DELETE
Delete all markers.
|
static DirectoryPolicy |
KEEP
Keep all markers.
|
static String |
UNKNOWN_MARKER_POLICY
Error string when unable to parse the marker policy option.
|
Constructor and Description |
---|
DirectoryPolicyImpl(DirectoryPolicy.MarkerPolicy markerPolicy,
Predicate<org.apache.hadoop.fs.Path> authoritativeness)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static Set<DirectoryPolicy.MarkerPolicy> |
availablePolicies()
Enumerate all available policies.
|
String |
describe()
Describe the policy for marker tools and logs.
|
static DirectoryPolicy |
getDirectoryPolicy(org.apache.hadoop.conf.Configuration conf,
Predicate<org.apache.hadoop.fs.Path> authoritativeness)
Create/Get the policy for this configuration.
|
DirectoryPolicy.MarkerPolicy |
getMarkerPolicy()
Get the marker policy.
|
boolean |
hasPathCapability(org.apache.hadoop.fs.Path path,
String capability)
Return path policy for store and paths.
|
boolean |
keepDirectoryMarkers(org.apache.hadoop.fs.Path path)
Should a directory marker be retained?
|
String |
toString() |
public static final String UNKNOWN_MARKER_POLICY
public static final DirectoryPolicy KEEP
public static final DirectoryPolicy DELETE
public DirectoryPolicyImpl(DirectoryPolicy.MarkerPolicy markerPolicy, Predicate<org.apache.hadoop.fs.Path> authoritativeness)
markerPolicy
- marker policyauthoritativeness
- function for authoritativenesspublic boolean keepDirectoryMarkers(org.apache.hadoop.fs.Path path)
DirectoryPolicy
keepDirectoryMarkers
in interface DirectoryPolicy
path
- path a file/directory is being created with.public DirectoryPolicy.MarkerPolicy getMarkerPolicy()
DirectoryPolicy
getMarkerPolicy
in interface DirectoryPolicy
public String describe()
DirectoryPolicy
describe
in interface DirectoryPolicy
public boolean hasPathCapability(org.apache.hadoop.fs.Path path, String capability)
hasPathCapability
in interface DirectoryPolicy
path
- pathcapability
- capabilitypublic static DirectoryPolicy getDirectoryPolicy(org.apache.hadoop.conf.Configuration conf, Predicate<org.apache.hadoop.fs.Path> authoritativeness)
conf
- configauthoritativeness
- Callback to evaluate authoritativeness of a
path.public static Set<DirectoryPolicy.MarkerPolicy> availablePolicies()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.