Fixed according to comments
This commit is contained in:
parent
ca60afe068
commit
11e04af141
@ -166,7 +166,8 @@ cassandra:
|
|||||||
ts_key_value_partitioning: "${TS_KV_PARTITIONING:MONTHS}"
|
ts_key_value_partitioning: "${TS_KV_PARTITIONING:MONTHS}"
|
||||||
ts_key_value_ttl: "${TS_KV_TTL:0}"
|
ts_key_value_ttl: "${TS_KV_TTL:0}"
|
||||||
events_ttl: "${TS_EVENTS_TTL:0}"
|
events_ttl: "${TS_EVENTS_TTL:0}"
|
||||||
debug_events_ttl: "${DEBUG_EVENTS_TTL:WEEK}"
|
# Specify TTL of debug log in seconds. The current value corresponds to one week
|
||||||
|
debug_events_ttl: "${DEBUG_EVENTS_TTL:604800}"
|
||||||
buffer_size: "${CASSANDRA_QUERY_BUFFER_SIZE:200000}"
|
buffer_size: "${CASSANDRA_QUERY_BUFFER_SIZE:200000}"
|
||||||
concurrent_limit: "${CASSANDRA_QUERY_CONCURRENT_LIMIT:1000}"
|
concurrent_limit: "${CASSANDRA_QUERY_CONCURRENT_LIMIT:1000}"
|
||||||
permit_max_wait_time: "${PERMIT_MAX_WAIT_TIME:120000}"
|
permit_max_wait_time: "${PERMIT_MAX_WAIT_TIME:120000}"
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public class CassandraBaseEventDao extends CassandraAbstractSearchTimeDao<EventE
|
|||||||
private int eventsTtl;
|
private int eventsTtl;
|
||||||
|
|
||||||
@Value("${cassandra.query.debug_events_ttl}")
|
@Value("${cassandra.query.debug_events_ttl}")
|
||||||
private String debugEventsTtl;
|
private int debugEventsTtl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Event save(TenantId tenantId, Event event) {
|
public Event save(TenantId tenantId, Event event) {
|
||||||
@ -197,7 +197,7 @@ public class CassandraBaseEventDao extends CassandraAbstractSearchTimeDao<EventE
|
|||||||
insert = insert.ifNotExists();
|
insert = insert.ifNotExists();
|
||||||
}
|
}
|
||||||
|
|
||||||
int selectedTtl = entity.getEventType().matches(DataConstants.DEBUG_RULE_NODE) ? toMillis(debugEventsTtl) : ttl;
|
int selectedTtl = entity.getEventType().equals(DataConstants.DEBUG_RULE_NODE) ? debugEventsTtl : ttl;
|
||||||
|
|
||||||
if(selectedTtl > 0){
|
if(selectedTtl > 0){
|
||||||
insert.using(ttl(selectedTtl));
|
insert.using(ttl(selectedTtl));
|
||||||
@ -211,14 +211,4 @@ public class CassandraBaseEventDao extends CassandraAbstractSearchTimeDao<EventE
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private int toMillis(String timeInterval) {
|
|
||||||
switch (timeInterval) {
|
|
||||||
case "DAY":
|
|
||||||
return 24 * 3600;
|
|
||||||
case "WEEK":
|
|
||||||
return 7 * 24 * 3600;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user