org.apache.flink.runtime.zookeeper.filesystem.FileSystemStateStorageHelper Java Examples

The following examples show how to use org.apache.flink.runtime.zookeeper.filesystem.FileSystemStateStorageHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ZooKeeperUtils.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link FileSystemStateStorageHelper} instance.
 *
 * @param configuration {@link Configuration} object
 * @param prefix Prefix for the created files
 * @param <T> Type of the state objects
 * @return {@link FileSystemStateStorageHelper} instance
 * @throws IOException if file system state storage cannot be created
 */
public static <T extends Serializable> FileSystemStateStorageHelper<T> createFileSystemStateStorage(
		Configuration configuration,
		String prefix) throws IOException {

	String rootPath = configuration.getValue(HighAvailabilityOptions.HA_STORAGE_PATH);

	if (rootPath == null || StringUtils.isBlank(rootPath)) {
		throw new IllegalConfigurationException("Missing high-availability storage path for metadata." +
				" Specify via configuration key '" + HighAvailabilityOptions.HA_STORAGE_PATH + "'.");
	} else {
		return new FileSystemStateStorageHelper<T>(rootPath, prefix);
	}
}
 
Example #2
Source File: ZooKeeperUtils.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link FileSystemStateStorageHelper} instance.
 *
 * @param configuration {@link Configuration} object
 * @param prefix Prefix for the created files
 * @param <T> Type of the state objects
 * @return {@link FileSystemStateStorageHelper} instance
 * @throws IOException if file system state storage cannot be created
 */
public static <T extends Serializable> FileSystemStateStorageHelper<T> createFileSystemStateStorage(
		Configuration configuration,
		String prefix) throws IOException {

	String rootPath = configuration.getValue(HighAvailabilityOptions.HA_STORAGE_PATH);

	if (rootPath == null || StringUtils.isBlank(rootPath)) {
		throw new IllegalConfigurationException("Missing high-availability storage path for metadata." +
				" Specify via configuration key '" + HighAvailabilityOptions.HA_STORAGE_PATH + "'.");
	} else {
		return new FileSystemStateStorageHelper<T>(rootPath, prefix);
	}
}
 
Example #3
Source File: ZooKeeperUtils.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a {@link FileSystemStateStorageHelper} instance.
 *
 * @param configuration {@link Configuration} object
 * @param prefix Prefix for the created files
 * @param <T> Type of the state objects
 * @return {@link FileSystemStateStorageHelper} instance
 * @throws IOException if file system state storage cannot be created
 */
public static <T extends Serializable> FileSystemStateStorageHelper<T> createFileSystemStateStorage(
		Configuration configuration,
		String prefix) throws IOException {

	return new FileSystemStateStorageHelper<>(HighAvailabilityServicesUtils.getClusterHighAvailableStoragePath(configuration), prefix);
}