Search in sources :

Example 1 with FileExecutionGraphInfoStore

use of org.apache.flink.runtime.dispatcher.FileExecutionGraphInfoStore in project flink by apache.

the class SessionClusterEntrypoint method createSerializableExecutionGraphStore.

@Override
protected ExecutionGraphInfoStore createSerializableExecutionGraphStore(Configuration configuration, ScheduledExecutor scheduledExecutor) throws IOException {
    final JobManagerOptions.JobStoreType jobStoreType = configuration.get(JobManagerOptions.JOB_STORE_TYPE);
    final Time expirationTime = Time.seconds(configuration.getLong(JobManagerOptions.JOB_STORE_EXPIRATION_TIME));
    final int maximumCapacity = configuration.getInteger(JobManagerOptions.JOB_STORE_MAX_CAPACITY);
    switch(jobStoreType) {
        case File:
            {
                final File tmpDir = new File(ConfigurationUtils.parseTempDirectories(configuration)[0]);
                final long maximumCacheSizeBytes = configuration.getLong(JobManagerOptions.JOB_STORE_CACHE_SIZE);
                return new FileExecutionGraphInfoStore(tmpDir, expirationTime, maximumCapacity, maximumCacheSizeBytes, scheduledExecutor, Ticker.systemTicker());
            }
        case Memory:
            {
                return new MemoryExecutionGraphInfoStore(expirationTime, maximumCapacity, scheduledExecutor, Ticker.systemTicker());
            }
        default:
            {
                throw new IllegalArgumentException("Unsupported job store type " + jobStoreType);
            }
    }
}
Also used : MemoryExecutionGraphInfoStore(org.apache.flink.runtime.dispatcher.MemoryExecutionGraphInfoStore) FileExecutionGraphInfoStore(org.apache.flink.runtime.dispatcher.FileExecutionGraphInfoStore) Time(org.apache.flink.api.common.time.Time) File(java.io.File) JobManagerOptions(org.apache.flink.configuration.JobManagerOptions)

Aggregations

File (java.io.File)1 Time (org.apache.flink.api.common.time.Time)1 JobManagerOptions (org.apache.flink.configuration.JobManagerOptions)1 FileExecutionGraphInfoStore (org.apache.flink.runtime.dispatcher.FileExecutionGraphInfoStore)1 MemoryExecutionGraphInfoStore (org.apache.flink.runtime.dispatcher.MemoryExecutionGraphInfoStore)1