Browse Source
Merge pull request #3225 from YevhenBondarenko/master
Cassandra ts latest improvements
pull/3228/head
Igor Kulikov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
application/src/main/java/org/thingsboard/server/service/install/migrate/CassandraTsLatestToSqlMigrateService.java
|
|
|
@ -55,6 +55,8 @@ import static org.thingsboard.server.service.install.migrate.CassandraToSqlColum |
|
|
|
@Slf4j |
|
|
|
public class CassandraTsLatestToSqlMigrateService implements TsLatestMigrateService { |
|
|
|
|
|
|
|
private static final int LATEST_KEY_LENGTH = 255; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EntityDatabaseSchemaService entityDatabaseSchemaService; |
|
|
|
|
|
|
|
@ -168,6 +170,11 @@ public class CassandraTsLatestToSqlMigrateService implements TsLatestMigrateServ |
|
|
|
} |
|
|
|
|
|
|
|
protected Integer getOrSaveKeyId(String strKey) { |
|
|
|
if (strKey.length() > LATEST_KEY_LENGTH) { |
|
|
|
log.warn("Key is long. Max key length is 255\n{}", strKey); |
|
|
|
strKey = strKey.substring(0, LATEST_KEY_LENGTH); |
|
|
|
} |
|
|
|
|
|
|
|
Integer keyId = tsKvDictionaryMap.get(strKey); |
|
|
|
if (keyId == null) { |
|
|
|
Optional<TsKvDictionary> tsKvDictionaryOptional; |
|
|
|
|