Commit f0186c9084c21c1a9081d1b6c6b643bad437d755
1 parent
4d6ee559
Telemetry subscription service methods typo fix.
Showing
1 changed file
with
4 additions
and
6 deletions
@@ -40,7 +40,6 @@ import org.thingsboard.server.common.msg.cluster.SendToClusterMsg; | @@ -40,7 +40,6 @@ import org.thingsboard.server.common.msg.cluster.SendToClusterMsg; | ||
40 | import org.thingsboard.server.common.msg.cluster.ServerAddress; | 40 | import org.thingsboard.server.common.msg.cluster.ServerAddress; |
41 | import org.thingsboard.server.dao.attributes.AttributesService; | 41 | import org.thingsboard.server.dao.attributes.AttributesService; |
42 | import org.thingsboard.server.dao.entityview.EntityViewService; | 42 | import org.thingsboard.server.dao.entityview.EntityViewService; |
43 | -import org.thingsboard.server.dao.model.ModelConstants; | ||
44 | import org.thingsboard.server.dao.timeseries.TimeseriesService; | 43 | import org.thingsboard.server.dao.timeseries.TimeseriesService; |
45 | import org.thingsboard.server.gen.cluster.ClusterAPIProtos; | 44 | import org.thingsboard.server.gen.cluster.ClusterAPIProtos; |
46 | import org.thingsboard.server.service.cluster.routing.ClusterRoutingService; | 45 | import org.thingsboard.server.service.cluster.routing.ClusterRoutingService; |
@@ -57,7 +56,6 @@ import javax.annotation.PostConstruct; | @@ -57,7 +56,6 @@ import javax.annotation.PostConstruct; | ||
57 | import javax.annotation.PreDestroy; | 56 | import javax.annotation.PreDestroy; |
58 | import java.util.ArrayList; | 57 | import java.util.ArrayList; |
59 | import java.util.Collections; | 58 | import java.util.Collections; |
60 | -import java.util.HashMap; | ||
61 | import java.util.HashSet; | 59 | import java.util.HashSet; |
62 | import java.util.Iterator; | 60 | import java.util.Iterator; |
63 | import java.util.List; | 61 | import java.util.List; |
@@ -328,9 +326,9 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | @@ -328,9 +326,9 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | ||
328 | Set<Subscription> subscriptions = e.getValue(); | 326 | Set<Subscription> subscriptions = e.getValue(); |
329 | Optional<ServerAddress> newAddressOptional = routingService.resolveById(e.getKey()); | 327 | Optional<ServerAddress> newAddressOptional = routingService.resolveById(e.getKey()); |
330 | if (newAddressOptional.isPresent()) { | 328 | if (newAddressOptional.isPresent()) { |
331 | - newAddressOptional.ifPresent(serverAddress -> checkSubsciptionsNewAddress(serverAddress, subscriptions)); | 329 | + newAddressOptional.ifPresent(serverAddress -> checkSubscriptionsNewAddress(serverAddress, subscriptions)); |
332 | } else { | 330 | } else { |
333 | - checkSubsciptionsPrevAddress(subscriptions); | 331 | + checkSubscriptionsPrevAddress(subscriptions); |
334 | } | 332 | } |
335 | if (subscriptions.size() == 0) { | 333 | if (subscriptions.size() == 0) { |
336 | log.trace("[{}] No more subscriptions for this device on current server.", e.getKey()); | 334 | log.trace("[{}] No more subscriptions for this device on current server.", e.getKey()); |
@@ -339,7 +337,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | @@ -339,7 +337,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | ||
339 | } | 337 | } |
340 | } | 338 | } |
341 | 339 | ||
342 | - private void checkSubsciptionsNewAddress(ServerAddress newAddress, Set<Subscription> subscriptions) { | 340 | + private void checkSubscriptionsNewAddress(ServerAddress newAddress, Set<Subscription> subscriptions) { |
343 | Iterator<Subscription> subscriptionIterator = subscriptions.iterator(); | 341 | Iterator<Subscription> subscriptionIterator = subscriptions.iterator(); |
344 | while (subscriptionIterator.hasNext()) { | 342 | while (subscriptionIterator.hasNext()) { |
345 | Subscription s = subscriptionIterator.next(); | 343 | Subscription s = subscriptionIterator.next(); |
@@ -357,7 +355,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | @@ -357,7 +355,7 @@ public class DefaultTelemetrySubscriptionService implements TelemetrySubscriptio | ||
357 | } | 355 | } |
358 | } | 356 | } |
359 | 357 | ||
360 | - private void checkSubsciptionsPrevAddress(Set<Subscription> subscriptions) { | 358 | + private void checkSubscriptionsPrevAddress(Set<Subscription> subscriptions) { |
361 | for (Subscription s : subscriptions) { | 359 | for (Subscription s : subscriptions) { |
362 | if (s.isLocal() && s.getServer() != null) { | 360 | if (s.isLocal() && s.getServer() != null) { |
363 | log.trace("[{}] Local subscription is no longer handled on remote server address [{}]", s.getWsSessionId(), s.getServer()); | 361 | log.trace("[{}] Local subscription is no longer handled on remote server address [{}]", s.getWsSessionId(), s.getServer()); |