@PublicEvolving public class EntropyInjector extends Object
EntropyInjectingFileSystem
.Modifier and Type | Method and Description |
---|---|
static OutputStreamAndPath |
createEntropyAware(FileSystem fs,
Path path,
FileSystem.WriteMode writeMode)
Handles entropy injection across regular and entropy-aware file systems.
|
static Path |
removeEntropyMarkerIfPresent(FileSystem fs,
Path path)
Removes the entropy marker string from the path, if the given file system is an
entropy-injecting file system (implements
EntropyInjectingFileSystem ) and
the entropy marker key is present. |
public static OutputStreamAndPath createEntropyAware(FileSystem fs, Path path, FileSystem.WriteMode writeMode) throws IOException
If the given file system is entropy-aware (a implements EntropyInjectingFileSystem
),
then this method replaces the entropy marker in the path with random characters.
The entropy marker is defined by EntropyInjectingFileSystem.getEntropyInjectionKey()
.
If the given file system does not implement EntropyInjectingFileSystem
,
then this method delegates to FileSystem.create(Path, WriteMode)
and
returns the same path in the resulting OutputStreamAndPath
.
IOException
public static Path removeEntropyMarkerIfPresent(FileSystem fs, Path path)
EntropyInjectingFileSystem
) and
the entropy marker key is present. Otherwise, this returns the path as is.path
- The path to filter.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.