flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2805] [blobmanager] Write JARs to file ...
Date Tue, 06 Oct 2015 14:29:07 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1227#discussion_r41270908
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobServer.java ---
    @@ -70,18 +82,65 @@
     	private final int maxConnections;
     
     	/**
    +	 * Shutdown hook thread to ensure deletion of the storage directory (or <code>null</code>
if
    +	 * {@link RecoveryMode#STANDALONE})
    +	 */
    +	private final Thread shutdownHook;
    +
    +	/**
     	 * Instantiates a new BLOB server and binds it to a free network port.
     	 * 
     	 * @throws IOException
     	 *         thrown if the BLOB server cannot bind to a free network port
     	 */
     	public BlobServer(Configuration config) throws IOException {
    +		checkNotNull(config, "Configuration");
    +
    +		this.recoveryMode = RecoveryMode.fromConfig(config);
     
     		// configure and create the storage directory
     		String storageDirectory = config.getString(ConfigConstants.BLOB_STORAGE_DIRECTORY_KEY,
null);
     		this.storageDir = BlobUtils.initStorageDirectory(storageDirectory);
     		LOG.info("Created BLOB server storage directory {}", storageDir);
     
    +		if (recoveryMode == RecoveryMode.STANDALONE) {
    +			recoveryBasePath = null;
    +		}
    +		else {
    +			// Initialize file state backend for recovery
    +			String stateBackend = config.getString(ConfigConstants.STATE_BACKEND,
    +					ConfigConstants.DEFAULT_STATE_BACKEND);
    +
    +			if (!stateBackend.toLowerCase().equals("filesystem")) {
    +				throw new IllegalConfigurationException(String.format("Illegal state backend " +
    +								"configuration '%s'. Please configure 'FILESYSTEM' as state " +
    +								"backend and specify the recovery path via '%s' key.",
    +						stateBackend, ConfigConstants.STATE_BACKEND_FS_RECOVERY_PATH));
    +			}
    --- End diff --
    
    You could do it similarly to the `RecoveryMode` enum.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message