flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From azagrebin <...@git.apache.org>
Subject [GitHub] flink pull request #6277: [FLINK-9511] Implement TTL config
Date Tue, 10 Jul 2018 08:31:58 GMT
Github user azagrebin commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6277#discussion_r201257564
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/state/StateTtlConfiguration.java
---
    @@ -93,4 +97,82 @@ public Time getTtl() {
     	public TtlTimeCharacteristic getTimeCharacteristic() {
     		return timeCharacteristic;
     	}
    +
    +	@Override
    +	public String toString() {
    +		return "StateTtlConfiguration{" +
    +			"ttlUpdateType=" + ttlUpdateType +
    +			", stateVisibility=" + stateVisibility +
    +			", timeCharacteristic=" + timeCharacteristic +
    +			", ttl=" + ttl +
    +			'}';
    +	}
    +
    +	public static Builder newBuilder(Time ttl) {
    +		return new Builder(ttl);
    +	}
    +
    +	/**
    +	 * Builder for the {@link StateTtlConfiguration}.
    +	 */
    +	public static class Builder {
    +
    +		private TtlUpdateType ttlUpdateType = OnCreateAndWrite;
    +		private TtlStateVisibility stateVisibility = NeverReturnExpired;
    +		private TtlTimeCharacteristic timeCharacteristic = ProcessingTime;
    +		private Time ttl;
    +
    +		public Builder(Time ttl) {
    --- End diff --
    
    Actually, I do not see a problem to have processing time as a default value for `TimeCharacteristic`.
I think event time is more specific and users who need it will deliberately look for it. First
release of TTL feature will even have only processing time option atm.


---

Mime
View raw message