Java Code Examples for org.apache.flink.api.common.time.Time#toString()

The following examples show how to use org.apache.flink.api.common.time.Time#toString() . 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: StreamQueryConfig.java    From Flink-CEPplus with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies a minimum and a maximum time interval for how long idle state, i.e., state which
 * was not updated, will be retained.
 * State will never be cleared until it was idle for less than the minimum time and will never
 * be kept if it was idle for more than the maximum time.
 *
 * <p>When new data arrives for previously cleaned-up state, the new data will be handled as if it
 * was the first data. This can result in previous results being overwritten.
 *
 * <p>Set to 0 (zero) to never clean-up the state.
 *
 * <p>NOTE: Cleaning up state requires additional bookkeeping which becomes less expensive for
 * larger differences of minTime and maxTime. The difference between minTime and maxTime must be
 * at least 5 minutes.
 *
 * @param minTime The minimum time interval for which idle state is retained. Set to 0 (zero) to
 *                never clean-up the state.
 * @param maxTime The maximum time interval for which idle state is retained. Must be at least
 *                5 minutes greater than minTime. Set to 0 (zero) to never clean-up the state.
 */
public StreamQueryConfig withIdleStateRetentionTime(Time minTime, Time maxTime) {

	if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
			!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
		throw new IllegalArgumentException(
				"Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() +
				"shoud be at least 5 minutes.");
	}
	minIdleStateRetentionTime = minTime.toMilliseconds();
	maxIdleStateRetentionTime = maxTime.toMilliseconds();
	return this;
}
 
Example 2
Source File: TableConfig.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies a minimum and a maximum time interval for how long idle state, i.e., state which
 * was not updated, will be retained.
 * State will never be cleared until it was idle for less than the minimum time and will never
 * be kept if it was idle for more than the maximum time.
 *
 * <p>When new data arrives for previously cleaned-up state, the new data will be handled as if it
 * was the first data. This can result in previous results being overwritten.
 *
 * <p>Set to 0 (zero) to never clean-up the state.
 *
 * <p>NOTE: Cleaning up state requires additional bookkeeping which becomes less expensive for
 * larger differences of minTime and maxTime. The difference between minTime and maxTime must be
 * at least 5 minutes.
 *
 * @param minTime The minimum time interval for which idle state is retained. Set to 0 (zero) to
 *                never clean-up the state.
 * @param maxTime The maximum time interval for which idle state is retained. Must be at least
 *                5 minutes greater than minTime. Set to 0 (zero) to never clean-up the state.
 */
public void setIdleStateRetentionTime(Time minTime, Time maxTime) {
	if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
		!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
		throw new IllegalArgumentException(
			"Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() +
				"shoud be at least 5 minutes.");
	}
	minIdleStateRetentionTime = minTime.toMilliseconds();
	maxIdleStateRetentionTime = maxTime.toMilliseconds();
}
 
Example 3
Source File: StreamQueryConfig.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies a minimum and a maximum time interval for how long idle state, i.e., state which
 * was not updated, will be retained.
 * State will never be cleared until it was idle for less than the minimum time and will never
 * be kept if it was idle for more than the maximum time.
 *
 * <p>When new data arrives for previously cleaned-up state, the new data will be handled as if it
 * was the first data. This can result in previous results being overwritten.
 *
 * <p>Set to 0 (zero) to never clean-up the state.
 *
 * <p>NOTE: Cleaning up state requires additional bookkeeping which becomes less expensive for
 * larger differences of minTime and maxTime. The difference between minTime and maxTime must be
 * at least 5 minutes.
 *
 * @param minTime The minimum time interval for which idle state is retained. Set to 0 (zero) to
 *                never clean-up the state.
 * @param maxTime The maximum time interval for which idle state is retained. Must be at least
 *                5 minutes greater than minTime. Set to 0 (zero) to never clean-up the state.
 */
public StreamQueryConfig withIdleStateRetentionTime(Time minTime, Time maxTime) {

	if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
			!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
		throw new IllegalArgumentException(
				"Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() +
				"shoud be at least 5 minutes.");
	}
	minIdleStateRetentionTime = minTime.toMilliseconds();
	maxIdleStateRetentionTime = maxTime.toMilliseconds();
	return this;
}
 
Example 4
Source File: TableConfig.java    From flink with Apache License 2.0 3 votes vote down vote up
/**
 * Specifies a minimum and a maximum time interval for how long idle state, i.e., state which
 * was not updated, will be retained.
 * State will never be cleared until it was idle for less than the minimum time and will never
 * be kept if it was idle for more than the maximum time.
 *
 * <p>When new data arrives for previously cleaned-up state, the new data will be handled as if it
 * was the first data. This can result in previous results being overwritten.
 *
 * <p>Set to 0 (zero) to never clean-up the state.
 *
 * <p>NOTE: Cleaning up state requires additional bookkeeping which becomes less expensive for
 * larger differences of minTime and maxTime. The difference between minTime and maxTime must be
 * at least 5 minutes.
 *
 * @param minTime The minimum time interval for which idle state is retained. Set to 0 (zero) to
 *                never clean-up the state.
 * @param maxTime The maximum time interval for which idle state is retained. Must be at least
 *                5 minutes greater than minTime. Set to 0 (zero) to never clean-up the state.
 */
public void setIdleStateRetentionTime(Time minTime, Time maxTime) {
	if (maxTime.toMilliseconds() - minTime.toMilliseconds() < 300000 &&
		!(maxTime.toMilliseconds() == 0 && minTime.toMilliseconds() == 0)) {
		throw new IllegalArgumentException(
			"Difference between minTime: " + minTime.toString() + " and maxTime: " + maxTime.toString() +
				"shoud be at least 5 minutes.");
	}
	minIdleStateRetentionTime = minTime.toMilliseconds();
	maxIdleStateRetentionTime = maxTime.toMilliseconds();
}