Skip to content

Commit

Permalink
update the cache config
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n committed Sep 30, 2023
1 parent a3f53c0 commit 2a8adad
Showing 1 changed file with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,29 @@ public void setTasks(List<WorkflowTask> tasks) {
@ProtoField(id = 29)
private String joinStatus;

@ProtoField(id = 30)
private Map<String, Object> cacheKey = new HashMap<>();
public static class CacheConfig {

@ProtoField(id = 31)
private long cacheTTL;
private String key;
private int ttlInSecond;

public String getKey() {
return key;
}

public void setKey(String key) {
this.key = key;
}

public int getTtlInSecond() {
return ttlInSecond;
}

public void setTtlInSecond(int ttlInSecond) {
this.ttlInSecond = ttlInSecond;
}
}

private CacheConfig cacheConfig;

/*
Map of events to be emitted when the task status changed.
Expand Down Expand Up @@ -398,20 +416,12 @@ public void setScriptExpression(String expression) {
this.scriptExpression = expression;
}

public Map<String, Object> getCacheKey() {
return cacheKey;
}

public void setCacheKey(Map<String, Object> cacheKey) {
this.cacheKey = cacheKey;
}

public long getCacheTTL() {
return cacheTTL;
public CacheConfig getCacheConfig() {
return cacheConfig;
}

public void setCacheTTL(long cacheTTL) {
this.cacheTTL = cacheTTL;
public void setCacheConfig(CacheConfig cacheConfig) {
this.cacheConfig = cacheConfig;
}

/**
Expand Down Expand Up @@ -781,6 +791,7 @@ && isOptional() == that.isOptional()
&& Objects.equals(isAsyncComplete(), that.isAsyncComplete())
&& Objects.equals(getDefaultExclusiveJoinTask(), that.getDefaultExclusiveJoinTask())
&& Objects.equals(getRetryCount(), that.getRetryCount())
&& Objects.equals(getCacheConfig(), that.getCacheConfig())
&& Objects.equals(getOnStateChange(), that.getOnStateChange());
}

Expand Down Expand Up @@ -813,6 +824,7 @@ public int hashCode() {
isOptional(),
getDefaultExclusiveJoinTask(),
getOnStateChange(),
getCacheConfig(),
getRetryCount());
}
}

0 comments on commit 2a8adad

Please sign in to comment.