Skip to content

Commit

Permalink
Fix compile errors after merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiLandiak committed Aug 6, 2024
1 parent 3fae737 commit d274803
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ListenableFuture<Void> saveCloudEventAsync(TenantId tenantId,

EdgeSettings findEdgeSettings(TenantId tenantId);

ListenableFuture<List<String>> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings);
ListenableFuture<List<Long>> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings);

void cleanupEvents(long ttl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.AttributeScope;
import org.thingsboard.server.common.data.DataConstants;
import org.thingsboard.server.common.data.cloud.CloudEvent;
import org.thingsboard.server.common.data.cloud.CloudEventType;
Expand Down Expand Up @@ -141,7 +142,7 @@ private long countEventsByTenantIdAndEntityIdAndActionAndTypeAndStartTimeAndEndT
public EdgeSettings findEdgeSettings(TenantId tenantId) {
try {
Optional<AttributeKvEntry> attr =
attributesService.find(tenantId, tenantId, DataConstants.SERVER_SCOPE, DataConstants.EDGE_SETTINGS_ATTR_KEY).get();
attributesService.find(tenantId, tenantId, AttributeScope.SERVER_SCOPE, DataConstants.EDGE_SETTINGS_ATTR_KEY).get();
if (attr.isPresent()) {
log.trace("Found current edge settings {}", attr.get().getValueAsString());
return JacksonUtil.fromString(attr.get().getValueAsString(), EdgeSettings.class);
Expand All @@ -156,13 +157,13 @@ public EdgeSettings findEdgeSettings(TenantId tenantId) {
}

@Override
public ListenableFuture<List<String>> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings) {
public ListenableFuture<List<Long>> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings) {
try {
BaseAttributeKvEntry edgeSettingAttr =
new BaseAttributeKvEntry(new StringDataEntry(DataConstants.EDGE_SETTINGS_ATTR_KEY, JacksonUtil.toString(edgeSettings)), System.currentTimeMillis());
List<AttributeKvEntry> attributes =
Collections.singletonList(edgeSettingAttr);
return attributesService.save(tenantId, tenantId, DataConstants.SERVER_SCOPE, attributes);
return attributesService.save(tenantId, tenantId, AttributeScope.SERVER_SCOPE, attributes);
} catch (Exception e) {
log.error("Exception while saving edge settings", e);
throw new RuntimeException("Exception while saving edge settings", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class JpaBaseCloudEventDao extends JpaAbstractDao<CloudEventEntity, Cloud

private static final String TABLE_NAME = ModelConstants.CLOUD_EVENT_COLUMN_FAMILY_NAME;

private TbSqlBlockingQueueWrapper<CloudEventEntity> queue;
private TbSqlBlockingQueueWrapper<CloudEventEntity, Void> queue;

@Override
protected Class<CloudEventEntity> getEntityClass() {
Expand Down

0 comments on commit d274803

Please sign in to comment.