/** * Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer. * * @param type The class of the types serialized with the given serializer. * @param serializerClass The class of the serializer to use. */ public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) { config.registerTypeWithKryoSerializer(type, serializerClass); }
/** * Gets the parallelism with which operation are executed by default. * Operations can individually override this value to use a specific * parallelism. * * @return The parallelism used by operations, unless they override that * value. */ public int getParallelism() { return config.getParallelism(); }
/** * Gets the maximum degree of parallelism defined for the program. * * <p>The maximum degree of parallelism specifies the upper limit for dynamic scaling. It also * defines the number of key groups used for partitioned state. * * @return Maximum degree of parallelism */ public int getMaxParallelism() { return config.getMaxParallelism(); }
public void setDetachedPlan(FlinkPlan plan) { if (detachedPlan == null) { detachedPlan = plan; } else { throw new InvalidProgramException(DetachedJobExecutionResult.DETACHED_MESSAGE + DetachedJobExecutionResult.EXECUTE_TWICE_MESSAGE); } }
public StreamMockEnvironment( Configuration jobConfig, Configuration taskConfig, long memorySize, MockInputSplitProvider inputSplitProvider, int bufferSize, TaskStateManager taskStateManager) { this(jobConfig, taskConfig, new ExecutionConfig(), memorySize, inputSplitProvider, bufferSize, taskStateManager); }
/** * Creates a new (statistically) random JobID. * * @return A new random JobID. */ public static JobID generate() { return new JobID(); }
public int getMaximumParallelism() { MaxDopVisitor visitor = new MaxDopVisitor(); accept(visitor); return Math.max(visitor.maxDop, this.defaultParallelism); }
/** * Creates a new Execution Environment. */ protected ExecutionEnvironment() { jobID = JobID.generate(); }
/** * Adds a new Kryo default serializer to the Runtime. * * <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable), * because it may be distributed to the worker nodes by java serialization. * * @param type The class of the types serialized with the given serializer. * @param serializer The serializer to use. */ public <T extends Serializer<?> & Serializable>void addDefaultKryoSerializer(Class<?> type, T serializer) { config.addDefaultKryoSerializer(type, serializer); }
@Override public String getTaskName() { return taskInfo.getTaskName(); }
/** * Registers all files that were registered at this execution environment's cache registry of the * given plan's cache registry. * * @param p The plan to register files at. * @throws IOException Thrown if checks for existence and sanity fail. */ protected void registerCachedFilesWithPlan(Plan p) throws IOException { for (Tuple2<String, DistributedCacheEntry> entry : cacheFile) { p.registerCachedFile(entry.f0, entry.f1); } }
@Override protected org.apache.flink.api.common.operators.SingleInputOperator<T, T, ?> translateToDataFlow(Operator<T> input) { // All the translation magic happens when the iteration end is encountered. throw new InvalidProgramException("A data set that is part of an iteration was used as a sink or action." + " Did you forget to close the iteration?"); } }
@Override public ExecutionConfig getExecutionConfig() { return new ExecutionConfig(); }
/** * Creates a new JobID from the given byte sequence. The byte sequence must be * exactly 16 bytes long. The first eight bytes make up the lower part of the ID, * while the next 8 bytes make up the upper part of the ID. * * @param bytes The byte sequence. * * @return A new JobID corresponding to the ID encoded in the bytes. */ public static JobID fromByteArray(byte[] bytes) { return new JobID(bytes); }
/** * Adds a new Kryo default serializer to the Runtime. * * @param type * The class of the types serialized with the given serializer. * @param serializerClass * The class of the serializer to use. */ public void addDefaultKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) { config.addDefaultKryoSerializer(type, serializerClass); }
/** * Registers the given type with a Kryo Serializer. * * <p>Note that the serializer instance must be serializable (as defined by java.io.Serializable), * because it may be distributed to the worker nodes by java serialization. * * @param type The class of the types serialized with the given serializer. * @param serializer The serializer to use. */ public <T extends Serializer<?> & Serializable>void registerTypeWithKryoSerializer(Class<?> type, T serializer) { config.registerTypeWithKryoSerializer(type, serializer); }
@Override public JobID getJobID() { throw new InvalidProgramException(DETACHED_MESSAGE + JOB_RESULT_MESSAGE); } }
/** * Adds a new Kryo default serializer to the Runtime. * * @param type The class of the types serialized with the given serializer. * @param serializerClass The class of the serializer to use. */ public void addDefaultKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) { config.addDefaultKryoSerializer(type, serializerClass); }
@Override public CrossOperator<I1, I2, OUT> withForwardedFieldsFirst(String... forwardedFieldsFirst) { throw new InvalidProgramException("The semantic properties (forwarded fields) are automatically calculated."); }
@Override public Map<String, Object> getAllAccumulatorResults() { throw new InvalidProgramException(DETACHED_MESSAGE + JOB_RESULT_MESSAGE); }