flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/savepoint/SavepointStore.java
/**
	 * Creates a savepoint directory.
	 *
	 * @param baseDirectory Base target directory for the savepoint
	 * @param jobId Optional JobID the savepoint belongs to
	 * @return The created savepoint directory
	 * @throws IOException FileSystem operation failures are forwarded
	 */
Creates a savepoint directory.
@param baseDirectory Base target directory for the savepoint
@param jobId Optional JobID the savepoint belongs to
@return The created savepoint directory
@throws IOException FileSystem operation failures are forwarded
Creates a savepoint directory . @param baseDirectory Base target directory for the savepoint @param jobId Optional JobID the savepoint belongs to @return The created savepoint directory @throws IOException FileSystem operation failures are forwarded
public static String createSavepointDirectory(@Nonnull String baseDirectory, @Nullable JobID jobId) throws IOException {
		final Path basePath = new Path(baseDirectory);
		final FileSystem fs = basePath.getFileSystem();
		final String prefix;
		if (jobId == null) {
			prefix = "savepoint-";
		} else {
			prefix = String.format("savepoint-%s-", jobId.toString().substring(0, 6));
		}
		Exception latestException = null;
		for (int attempt = 0; attempt < 10; attempt++) {
			Path path = new Path(basePath, FileUtils.getRandomFilename(prefix));
			try {
				if (fs.mkdirs(path)) {
					return path.toString();
				}
			} catch (Exception e) {
				latestException = e;
			}
		}
		throw new IOException("Failed to create savepoint directory at " + baseDirectory, latestException);
	}
public static String createSavepointDirectory ( @ Nonnull String baseDirectory , @ Nullable JobID jobId ) throws IOException { final Path basePath = new Path ( baseDirectory ) ; final FileSystem fs = basePath . getFileSystem ( ) ; final String prefix ; if ( jobId == null ) { prefix = "savepoint-" ; } else { prefix = String . format ( "savepoint-%s-" , jobId . toString ( ) . substring ( 0 , 6 ) ) ; } Exception latestException = null ; for ( int attempt = 0 ; attempt < 10 ; attempt ++ ) { Path path = new Path ( basePath , FileUtils . getRandomFilename ( prefix ) ) ; try { if ( fs . mkdirs ( path ) ) { return path . toString ( ) ; } } catch ( Exception e ) { latestException = e ; } } throw new IOException ( "Failed to create savepoint directory at " + baseDirectory , latestException ) ; }
Creates a savepoint directory.
Creates a savepoint directory .
// Try to create a FS output stream