Removed unnecessary unused case for DataUpdateService
This commit is contained in:
parent
a098e33d8d
commit
d0090f8b7a
@ -232,6 +232,7 @@ public class ThingsboardInstallService {
|
|||||||
log.info("Updating system data...");
|
log.info("Updating system data...");
|
||||||
systemDataLoaderService.updateSystemWidgets();
|
systemDataLoaderService.updateSystemWidgets();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//TODO update CacheCleanupService on the next version upgrade
|
//TODO update CacheCleanupService on the next version upgrade
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -202,16 +202,6 @@ public class DefaultDataUpdateService implements DataUpdateService {
|
|||||||
log.info("Skipping edge events migration");
|
log.info("Skipping edge events migration");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "3.5.0":
|
|
||||||
boolean skipEdgeEventsMigration = getEnv("TB_SKIP_EDGE_EVENTS_MIGRATION", false);
|
|
||||||
if (!skipEdgeEventsMigration) {
|
|
||||||
log.info("Updating data from version 3.4.2 to 3.5.0 ...");
|
|
||||||
log.info("Starting edge events migration. Can be skipped with TB_SKIP_EDGE_EVENTS_MIGRATION env variable set to true");
|
|
||||||
edgeEventDao.migrateEdgeEvents();
|
|
||||||
} else {
|
|
||||||
log.info("Skipping edge events migration");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
throw new RuntimeException("Unable to update data, unsupported fromVersion: " + fromVersion);
|
throw new RuntimeException("Unable to update data, unsupported fromVersion: " + fromVersion);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -178,6 +178,7 @@ public abstract class BaseAuditLogControllerTest extends AbstractControllerTest
|
|||||||
reset(partitioningRepository);
|
reset(partitioningRepository);
|
||||||
AuditLog auditLog = createAuditLog(ActionType.LOGIN, tenantAdminUserId);
|
AuditLog auditLog = createAuditLog(ActionType.LOGIN, tenantAdminUserId);
|
||||||
verify(partitioningRepository).createPartitionIfNotExists(eq("audit_log"), eq(auditLog.getCreatedTime()), eq(partitionDurationInMs));
|
verify(partitioningRepository).createPartitionIfNotExists(eq("audit_log"), eq(auditLog.getCreatedTime()), eq(partitionDurationInMs));
|
||||||
|
|
||||||
List<Long> partitions = partitioningRepository.fetchPartitions("audit_log");
|
List<Long> partitions = partitioningRepository.fetchPartitions("audit_log");
|
||||||
assertThat(partitions).singleElement().satisfies(partitionStartTs -> {
|
assertThat(partitions).singleElement().satisfies(partitionStartTs -> {
|
||||||
assertThat(partitionStartTs).isEqualTo(partitioningRepository.calculatePartitionStartTime(auditLog.getCreatedTime(), partitionDurationInMs));
|
assertThat(partitionStartTs).isEqualTo(partitioningRepository.calculatePartitionStartTime(auditLog.getCreatedTime(), partitionDurationInMs));
|
||||||
|
|||||||
@ -51,11 +51,9 @@ public class EdgeEventInsertRepository {
|
|||||||
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
protected void doInTransactionWithoutResult(TransactionStatus status) {
|
||||||
jdbcTemplate.batchUpdate(INSERT, new BatchPreparedStatementSetter() {
|
jdbcTemplate.batchUpdate(INSERT, new BatchPreparedStatementSetter() {
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void setValues(PreparedStatement ps, int i) throws SQLException {
|
public void setValues(PreparedStatement ps, int i) throws SQLException {
|
||||||
EdgeEventEntity edgeEvent = entities.get(i);
|
EdgeEventEntity edgeEvent = entities.get(i);
|
||||||
ps.setObject(1, edgeEvent.getId());
|
ps.setObject(1, edgeEvent.getId());
|
||||||
|
|
||||||
ps.setLong(2, edgeEvent.getCreatedTime());
|
ps.setLong(2, edgeEvent.getCreatedTime());
|
||||||
ps.setObject(3, edgeEvent.getEdgeId());
|
ps.setObject(3, edgeEvent.getEdgeId());
|
||||||
ps.setString(4, edgeEvent.getEdgeEventType().name());
|
ps.setString(4, edgeEvent.getEdgeEventType().name());
|
||||||
|
|||||||
@ -86,6 +86,7 @@ public class JpaBaseEdgeEventDao extends JpaAbstractSearchTextDao<EdgeEventEntit
|
|||||||
private long edge_events_ttl;
|
private long edge_events_ttl;
|
||||||
|
|
||||||
private static final String TABLE_NAME = ModelConstants.EDGE_EVENT_COLUMN_FAMILY_NAME;
|
private static final String TABLE_NAME = ModelConstants.EDGE_EVENT_COLUMN_FAMILY_NAME;
|
||||||
|
|
||||||
private TbSqlBlockingQueueWrapper<EdgeEventEntity> queue;
|
private TbSqlBlockingQueueWrapper<EdgeEventEntity> queue;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user