public class FileUtils extends Object
Constructor and Description |
---|
FileUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.flink.core.fs.Path |
getDataPath(String path)
Returns a subdirectory of the given path for saving/loading model data.
|
static String |
getPathForPipelineStage(int stageIdx,
int numStages,
String parentPath) |
static Map<String,?> |
loadMetadata(String path,
String expectedClassName)
Loads the metadata from the metadata file under the given path.
|
static org.apache.flink.core.fs.FileSystem |
mkdirs(org.apache.flink.core.fs.Path path) |
static void |
saveToFile(String pathStr,
String content,
boolean isOverwrite)
Saves a given string to the specified file.
|
public static void saveToFile(String pathStr, String content, boolean isOverwrite) throws IOException
IOException
public static org.apache.flink.core.fs.FileSystem mkdirs(org.apache.flink.core.fs.Path path) throws IOException
IOException
public static Map<String,?> loadMetadata(String path, String expectedClassName) throws IOException
The method throws RuntimeException if the expectedClassName is not empty AND it does not match the className of the previously saved stage.
path
- The parent directory of the metadata file to read from.expectedClassName
- The expected class name of the stage.IOException
public static String getPathForPipelineStage(int stageIdx, int numStages, String parentPath)
public static org.apache.flink.core.fs.Path getDataPath(String path)
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.