diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java index 701f585e77..bcef69b4bd 100644 --- a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java +++ b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java @@ -93,8 +93,8 @@ public final class PluginProcessingContext implements PluginContext { @Override public void saveAttributes(final TenantId tenantId, final EntityId entityId, final String scope, final List attributes, final PluginCallback callback) { validate(entityId, new ValidationCallback(callback, ctx -> { - ListenableFuture> attrKvListFuture = pluginCtx.attributesService.save(entityId, scope, attributes); - Futures.addCallback(attrKvListFuture, getListCallback(callback, v -> { + ListenableFuture> futures = pluginCtx.attributesService.save(entityId, scope, attributes); + Futures.addCallback(futures, getListCallback(callback, v -> { if (entityId.getEntityType() == EntityType.DEVICE) { onDeviceAttributesChanged(tenantId, new DeviceId(entityId.getId()), scope, attributes); } @@ -106,8 +106,8 @@ public final class PluginProcessingContext implements PluginContext { @Override public void removeAttributes(final TenantId tenantId, final EntityId entityId, final String scope, final List keys, final PluginCallback callback) { validate(entityId, new ValidationCallback(callback, ctx -> { - ListenableFuture> future = pluginCtx.attributesService.removeAll(entityId, scope, keys); - Futures.addCallback(future, getCallback(callback, v -> null), executor); + ListenableFuture> futures = pluginCtx.attributesService.removeAll(entityId, scope, keys); + Futures.addCallback(futures, getCallback(callback, v -> null), executor); if (entityId.getEntityType() == EntityType.DEVICE) { onDeviceAttributesDeleted(tenantId, new DeviceId(entityId.getId()), keys.stream().map(key -> new AttributeKey(scope, key)).collect(Collectors.toSet())); } diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java index 95f92702e0..a98f054391 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java +++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java @@ -125,11 +125,7 @@ public class CassandraBaseAttributesDao extends CassandraAbstractAsyncDao implem stmt.setToNull(8); } log.trace("Generated save stmt [{}] for entityId {} and attributeType {} and attribute", stmt, entityId, attributeType, attribute); - return getFuture(executeAsyncWrite(stmt), rs -> getAttributeKvEntryFromRs(rs)); - } - - private Void getAttributeKvEntryFromRs(ResultSet rs) { - return null; + return getFuture(executeAsyncWrite(stmt), rs -> null); } @Override @@ -148,7 +144,7 @@ public class CassandraBaseAttributesDao extends CassandraAbstractAsyncDao implem .and(eq(ATTRIBUTE_TYPE_COLUMN, attributeType)) .and(eq(ATTRIBUTE_KEY_COLUMN, key)); log.debug("Remove request: {}", delete.toString()); - return getFuture(getSession().executeAsync(delete), rs -> getAttributeKvEntryFromRs(rs)); + return getFuture(getSession().executeAsync(delete), rs -> null); } private PreparedStatement getSaveStmt() {