code: @Override
  	public CheckpointStorageLocation initializeLocationForSavepoint(
  			@SuppressWarnings("unused") long checkpointId,
  			@Nullable String externalLocationPointer) throws IOException {
  
  		// determine where to write the savepoint to
  
  		final Path savepointBasePath;
  		if (externalLocationPointer != null) {
  			savepointBasePath = new Path(externalLocationPointer);
  		}
  		else if (defaultSavepointDirectory != null) {
  			savepointBasePath = defaultSavepointDirectory;
  		}
  		else {
  			throw new IllegalArgumentException("No savepoint location given and no default location configured.");
  		}
  
  		// generate the savepoint directory
  
  		final FileSystem fs = savepointBasePath.getFileSystem();
  		final String prefix = "savepoint-" + jobId.toString().substring(0, 6) + '-';
  
  		Exception latestException = null;
  		for (int attempt = 0; attempt < 10; attempt++) {
  			final Path path = new Path(savepointBasePath, FileUtils.getRandomFilename(prefix));
  
  			try {
  				if (fs.mkdirs(path)) {
  					// we make the path qualified, to make it independent of default schemes and authorities
  					final Path qp = path.makeQualified(fs);
  
  					return createSavepointLocation(fs, qp);
  				}
  			} catch (Exception e) {
  				latestException = e;
  			}
  		}
  
  		throw new IOException("Failed to create savepoint directory at " + savepointBasePath, latestException);
  	}
docs: Creates a file system based storage location for a savepoint.
  
  <p>This methods implements the logic that decides which location to use (given optional
  parameters for a configured location and a location passed for this specific savepoint)
  and how to name and initialize the savepoint directory.
  
  @param externalLocationPointer    The target location pointer for the savepoint.
  Must be a valid URI. Null, if not supplied.
  @param checkpointId               The checkpoint ID of the savepoint.
  
  @return The checkpoint storage location for the savepoint.
  
  @throws IOException Thrown if the target directory could not be created.