|
|
@ -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; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|