Browse Source

Merge branch 'rc' into feature/add_show_total_legend_setting_to_latest-chart-widgets

pull/13350/head
Paolo Cristiani 1 year ago
committed by GitHub
parent
commit
7ad2d51dc7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      application/src/main/java/org/thingsboard/server/service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java
  2. 8
      common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AbstractEntityFields.java
  3. 12
      dao/src/main/resources/sql/schema-entities-idx-psql-addon.sql
  4. 2
      msa/black-box-tests/src/test/java/org/thingsboard/server/msa/WsClient.java

2
application/src/main/java/org/thingsboard/server/service/ws/telemetry/sub/TelemetrySubscriptionUpdate.java

@ -15,6 +15,7 @@
*/
package org.thingsboard.server.service.ws.telemetry.sub;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.With;
@ -73,6 +74,7 @@ public class TelemetrySubscriptionUpdate {
this.errorMsg = errorMsg != null ? errorMsg : errorCode.getDefaultMsg();
}
@JsonIgnore
public Map<String, List<TsValue>> getValues() {
if (data == null || data.isEmpty()) {
return Collections.emptyMap();

8
common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/AbstractEntityFields.java

@ -17,7 +17,7 @@ package org.thingsboard.server.common.data.edqs.fields;
import lombok.Data;
import lombok.experimental.SuperBuilder;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.EntityId;
import java.util.UUID;
@ -36,7 +36,7 @@ public class AbstractEntityFields implements EntityFields {
this.id = id;
this.createdTime = createdTime;
this.tenantId = tenantId;
this.customerId = (customerId != null && customerId != CustomerId.NULL_UUID) ? customerId : null;
this.customerId = checkId(customerId);
this.name = name;
this.version = version;
}
@ -62,4 +62,8 @@ public class AbstractEntityFields implements EntityFields {
this(id, createdTime, tenantId, null, null, null);
}
protected UUID checkId(UUID id) {
return id != null && !id.equals(EntityId.NULL_UUID) ? id : null;
}
}

12
dao/src/main/resources/sql/schema-entities-idx-psql-addon.sql

@ -22,19 +22,19 @@
-- That why we need to define DESC index explicitly as (ts DESC NULLS LAST)
CREATE INDEX IF NOT EXISTS idx_rule_node_debug_event_main
ON rule_node_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95);
ON rule_node_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);
CREATE INDEX IF NOT EXISTS idx_rule_chain_debug_event_main
ON rule_chain_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95);
ON rule_chain_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);
CREATE INDEX IF NOT EXISTS idx_stats_event_main
ON stats_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95);
ON stats_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);
CREATE INDEX IF NOT EXISTS idx_lc_event_main
ON lc_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95);
ON lc_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);
CREATE INDEX IF NOT EXISTS idx_error_event_main
ON error_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95);
ON error_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);
CREATE INDEX IF NOT EXISTS idx_cf_debug_event_main
ON cf_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST) WITH (FILLFACTOR=95);
ON cf_debug_event (tenant_id ASC, entity_id ASC, ts DESC NULLS LAST);

2
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/WsClient.java

@ -61,7 +61,7 @@ public class WsClient extends WebSocketClient {
latch.countDown();
}
} catch (IOException e) {
log.error("ws message can't be read");
log.error("ws message can't be read", e);
}
}
}

Loading…
Cancel
Save