Class EntropyInjector
- java.lang.Object
-
- org.apache.flink.core.fs.EntropyInjector
-
@PublicEvolving public class EntropyInjector extends Object
This class offers utilities for entropy injection for FileSystems that implementEntropyInjectingFileSystem.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PathaddEntropy(FileSystem fs, Path path)Handles entropy injection across regular and entropy-aware file systems.static OutputStreamAndPathcreateEntropyAware(FileSystem fs, Path path, FileSystem.WriteMode writeMode)Handles entropy injection across regular and entropy-aware file systems.static booleanisEntropyInjecting(FileSystem fs, Path target)static PathremoveEntropyMarkerIfPresent(FileSystem fs, Path path)Removes the entropy marker string from the path, if the given file system is an entropy-injecting file system (implementsEntropyInjectingFileSystem) and the entropy marker key is present.
-
-
-
Method Detail
-
addEntropy
public static Path addEntropy(FileSystem fs, Path path) throws IOException
Handles entropy injection across regular and entropy-aware file systems.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 byEntropyInjectingFileSystem.getEntropyInjectionKey().If the given file system does not implement
EntropyInjectingFileSystem, then this method returns the same path.- Throws:
IOException
-
createEntropyAware
public static OutputStreamAndPath createEntropyAware(FileSystem fs, Path path, FileSystem.WriteMode writeMode) throws IOException
Handles entropy injection across regular and entropy-aware file systems.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 byEntropyInjectingFileSystem.getEntropyInjectionKey().If the given file system does not implement
EntropyInjectingFileSystem, then this method delegates toFileSystem.create(Path, WriteMode)and returns the same path in the resultingOutputStreamAndPath.- Throws:
IOException
-
removeEntropyMarkerIfPresent
public 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 (implementsEntropyInjectingFileSystem) and the entropy marker key is present. Otherwise, this returns the path as is.- Parameters:
path- The path to filter.- Returns:
- The path without the marker string.
-
isEntropyInjecting
public static boolean isEntropyInjecting(FileSystem fs, Path target)
-
-