diff --git a/application/src/main/java/org/thingsboard/server/controller/EventController.java b/application/src/main/java/org/thingsboard/server/controller/EventController.java index dd73c8c1ec..f1a2528c83 100644 --- a/application/src/main/java/org/thingsboard/server/controller/EventController.java +++ b/application/src/main/java/org/thingsboard/server/controller/EventController.java @@ -242,7 +242,7 @@ public void clearEvents(@Parameter(description = ENTITY_TYPE_PARAM_DESCRIPTION, checkParameter("EntityId", strEntityId); checkParameter("EntityType", strEntityType); EntityId entityId = EntityIdFactory.getByTypeAndId(strEntityType, strEntityId); - // TODO: voba - merge comment + // Edge-only: only READ operation // checkEntityId(entityId, Operation.WRITE); checkEntityId(entityId, Operation.READ); diff --git a/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java b/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java index 76aa30bd52..309aef5833 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java @@ -335,7 +335,7 @@ public void createOAuth2Templates() throws Exception { @Override public void loadDemoData() throws Exception { - /* voba - merge comment + /* Edge-only: no ability to load demo data on Edge Tenant demoTenant = new Tenant(); demoTenant.setRegion("Global"); demoTenant.setTitle("Tenant"); diff --git a/application/src/main/resources/tb-edge.yml b/application/src/main/resources/tb-edge.yml index e981a9edee..7dca798de3 100644 --- a/application/src/main/resources/tb-edge.yml +++ b/application/src/main/resources/tb-edge.yml @@ -262,9 +262,122 @@ ui: database: ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by a single API call to fetch telemetry records ts: - type: "${DATABASE_TS_TYPE:sql}" # sql or timescale (for hybrid mode, DATABASE_TS_TYPE value should be timescale) + type: "${DATABASE_TS_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale) ts_latest: - type: "${DATABASE_TS_LATEST_TYPE:sql}" # sql or timescale (for hybrid mode, DATABASE_TS_TYPE value should be timescale) + type: "${DATABASE_TS_LATEST_TYPE:sql}" # cassandra, sql, or timescale (for hybrid mode, DATABASE_TS_TYPE value should be cassandra, or timescale) + +# Cassandra driver configuration parameters +cassandra: + # Thingsboard cluster name + cluster_name: "${CASSANDRA_CLUSTER_NAME:Thingsboard Cluster}" + # Thingsboard keyspace name + keyspace_name: "${CASSANDRA_KEYSPACE_NAME:thingsboard}" + # Specify node list + url: "${CASSANDRA_URL:127.0.0.1:9042}" + # Specify the local data center name + local_datacenter: "${CASSANDRA_LOCAL_DATACENTER:datacenter1}" + ssl: + # Enable/disable secure connection + enabled: "${CASSANDRA_USE_SSL:false}" + # Enable/disable validation of Cassandra server hostname + # If enabled, the hostname of the Cassandra server must match the CN of the server certificate + hostname_validation: "${CASSANDRA_SSL_HOSTNAME_VALIDATION:true}" + # Set trust store for client authentication of the server (optional, uses trust store from default SSLContext if not set) + trust_store: "${CASSANDRA_SSL_TRUST_STORE:}" + # The password for Cassandra trust store key + trust_store_password: "${CASSANDRA_SSL_TRUST_STORE_PASSWORD:}" + # Set key store for server authentication of the client (optional, uses key store from default SSLContext if not set) + # A key store is only needed if the Cassandra server requires client authentication + key_store: "${CASSANDRA_SSL_KEY_STORE:}" + # The password for the Cassandra key store + key_store_password: "${CASSANDRA_SSL_KEY_STORE_PASSWORD:}" + # Comma-separated list of cipher suites (optional, uses Java default cipher suites if not set) + cipher_suites: "${CASSANDRA_SSL_CIPHER_SUITES:}" + # Enable/disable JMX + jmx: "${CASSANDRA_USE_JMX:false}" + # Enable/disable metrics collection. + metrics: "${CASSANDRA_USE_METRICS:false}" + # NONE SNAPPY LZ4 + compression: "${CASSANDRA_COMPRESSION:none}" + # Specify cassandra cluster initialization timeout in milliseconds (if no hosts are available during startup) + init_timeout_ms: "${CASSANDRA_CLUSTER_INIT_TIMEOUT_MS:300000}" + # Specify cassandra cluster initialization retry interval (if no hosts available during startup) + init_retry_interval_ms: "${CASSANDRA_CLUSTER_INIT_RETRY_INTERVAL_MS:3000}" + # Cassandra max local requests per connection + max_requests_per_connection_local: "${CASSANDRA_MAX_REQUESTS_PER_CONNECTION_LOCAL:32768}" + # Cassandra max remote requests per connection + max_requests_per_connection_remote: "${CASSANDRA_MAX_REQUESTS_PER_CONNECTION_REMOTE:32768}" + # Credential parameters + credentials: "${CASSANDRA_USE_CREDENTIALS:false}" + # Specify your username + username: "${CASSANDRA_USERNAME:}" + # Specify your password + password: "${CASSANDRA_PASSWORD:}" + # Astra DB connect https://astra.datastax.com/ + cloud: + # /etc/thingsboard/astra/secure-connect-thingsboard.zip + secure_connect_bundle_path: "${CASSANDRA_CLOUD_SECURE_BUNDLE_PATH:}" + # DucitQPHMzPCBOZqFYexAfKk + client_id: "${CASSANDRA_CLOUD_CLIENT_ID:}" + # ZnF7FpuHp43FP5BzM+KY8wGmSb4Ql6BhT4Z7sOU13ze+gXQ-n7OkFpNuB,oACUIQObQnK0g4bSPoZhK5ejkcF9F.j6f64j71Sr.tiRe0Fsq2hPS1ZCGSfAaIgg63IydG + client_secret: "${CASSANDRA_CLOUD_CLIENT_SECRET:}" + + # Cassandra cluster connection socket parameters # + socket: + # Sets the timeout, in milliseconds, of a native connection from ThingsBoard to Cassandra. The default value is 5000 + connect_timeout: "${CASSANDRA_SOCKET_TIMEOUT:5000}" + # Timeout before closing the connection. Value set in milliseconds + read_timeout: "${CASSANDRA_SOCKET_READ_TIMEOUT:20000}" + # Gets if TCP keep-alive must be used + keep_alive: "${CASSANDRA_SOCKET_KEEP_ALIVE:true}" + # Enable/Disable reuse-address. The socket option allows for the reuse of local addresses and ports + reuse_address: "${CASSANDRA_SOCKET_REUSE_ADDRESS:true}" + # Sets the linger-on-close timeout. By default, this option is not set by the driver. The actual value will be the default from the underlying Netty transport + so_linger: "${CASSANDRA_SOCKET_SO_LINGER:}" + # Enable/Disable Nagle's algorithm + tcp_no_delay: "${CASSANDRA_SOCKET_TCP_NO_DELAY:false}" + # Sets a hint to the size of the underlying buffers for incoming network I/O. By default, this option is not set by the driver. The actual value will be the default from the underlying Netty transport + receive_buffer_size: "${CASSANDRA_SOCKET_RECEIVE_BUFFER_SIZE:}" + # Returns the hint to the size of the underlying buffers for outgoing network I/O. By default, this option is not set by the driver. The actual value will be the default from the underlying Netty transport + send_buffer_size: "${CASSANDRA_SOCKET_SEND_BUFFER_SIZE:}" + + # Cassandra cluster connection query parameters + query: + # Consistency levels in Cassandra can be configured to manage availability versus data accuracy. The consistency level defaults to ONE for all write and read operations + read_consistency_level: "${CASSANDRA_READ_CONSISTENCY_LEVEL:ONE}" + # Consistency levels in Cassandra can be configured to manage availability versus data accuracy. The consistency level defaults to ONE for all write and read operations + write_consistency_level: "${CASSANDRA_WRITE_CONSISTENCY_LEVEL:ONE}" + # The fetch size specifies how many rows will be returned at once by Cassandra (in other words, it’s the size of each page) + default_fetch_size: "${CASSANDRA_DEFAULT_FETCH_SIZE:2000}" + # Specify partitioning size for timestamp key-value storage. Example: MINUTES, HOURS, DAYS, MONTHS, INDEFINITE + ts_key_value_partitioning: "${TS_KV_PARTITIONING:MONTHS}" + # Enable/Disable timestamp key-value partioning on read queries + use_ts_key_value_partitioning_on_read: "${USE_TS_KV_PARTITIONING_ON_READ:true}" + # The number of partitions that are cached in memory of each service. It is useful to decrease the load of re-inserting the same partitions again + ts_key_value_partitions_max_cache_size: "${TS_KV_PARTITIONS_MAX_CACHE_SIZE:100000}" + # Timeseries Time To Live (in seconds) for Cassandra Record. 0 - record has never expired + ts_key_value_ttl: "${TS_KV_TTL:0}" + # Maximum number of Cassandra queries that are waiting for execution + buffer_size: "${CASSANDRA_QUERY_BUFFER_SIZE:200000}" + # Maximum number of concurrent Cassandra queries + concurrent_limit: "${CASSANDRA_QUERY_CONCURRENT_LIMIT:1000}" + # Max time in milliseconds query waits for execution + permit_max_wait_time: "${PERMIT_MAX_WAIT_TIME:120000}" + # Amount of threads to dispatch cassandra queries + dispatcher_threads: "${CASSANDRA_QUERY_DISPATCHER_THREADS:2}" + callback_threads: "${CASSANDRA_QUERY_CALLBACK_THREADS:4}" # Buffered rate executor (read, write) for managing I/O rate. See "nosql-*-callback" threads in JMX + result_processing_threads: "${CASSANDRA_QUERY_RESULT_PROCESSING_THREADS:50}" # Result set transformer and processing. See "cassandra-callback" threads in JMX + # Cassandra query queue polling interval in milliseconds + poll_ms: "${CASSANDRA_QUERY_POLL_MS:50}" + # Interval in milliseconds for printing Cassandra query queue statistic + rate_limit_print_interval_ms: "${CASSANDRA_QUERY_RATE_LIMIT_PRINT_MS:10000}" + # set all data type values except target to null for the same ts on save + set_null_values_enabled: "${CASSANDRA_QUERY_SET_NULL_VALUES_ENABLED:true}" + # log one of cassandra queries with specified frequency (0 - logging is disabled) + print_queries_freq: "${CASSANDRA_QUERY_PRINT_FREQ:0}" + tenant_rate_limits: + # Whether to print rate-limited tenant names when printing Cassandra query queue statistic + print_tenant_names: "${CASSANDRA_QUERY_TENANT_RATE_LIMITS_PRINT_TENANT_NAMES:false}" # SQL configuration parameters sql: diff --git a/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlIntegrationTest.java index 28c6121df1..7f228488b5 100644 --- a/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlIntegrationTest.java @@ -18,8 +18,6 @@ import org.thingsboard.server.dao.service.DaoNoSqlTest; import org.thingsboard.server.transport.coap.telemetry.timeseries.AbstractCoapTimeseriesIntegrationTest; -// Edge-only: merge comment -// NoSQL is not supported on edge -// @DaoNoSqlTest +@DaoNoSqlTest public class CoapTimeseriesNoSqlIntegrationTest extends AbstractCoapTimeseriesIntegrationTest { } diff --git a/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlJsonIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlJsonIntegrationTest.java index e247d8c034..4f1772383c 100644 --- a/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlJsonIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlJsonIntegrationTest.java @@ -18,8 +18,6 @@ import org.thingsboard.server.dao.service.DaoNoSqlTest; import org.thingsboard.server.transport.coap.telemetry.timeseries.AbstractCoapTimeseriesJsonIntegrationTest; -// Edge-only: merge comment -// NoSQL is not supported on edge -// @DaoNoSqlTest +@DaoNoSqlTest public class CoapTimeseriesNoSqlJsonIntegrationTest extends AbstractCoapTimeseriesJsonIntegrationTest { } diff --git a/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlProtoIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlProtoIntegrationTest.java index 6cd57bdd50..05f18d66ec 100644 --- a/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlProtoIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/coap/telemetry/timeseries/nosql/CoapTimeseriesNoSqlProtoIntegrationTest.java @@ -18,8 +18,6 @@ import org.thingsboard.server.dao.service.DaoNoSqlTest; import org.thingsboard.server.transport.coap.telemetry.timeseries.AbstractCoapTimeseriesProtoIntegrationTest; -// Edge-only: merge comment -// NoSQL is not supported on edge -// @DaoNoSqlTest +@DaoNoSqlTest public class CoapTimeseriesNoSqlProtoIntegrationTest extends AbstractCoapTimeseriesProtoIntegrationTest { } diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlIntegrationTest.java index 1e3a623bbb..9b6d2879dd 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlIntegrationTest.java @@ -18,8 +18,6 @@ import org.thingsboard.server.dao.service.DaoNoSqlTest; import org.thingsboard.server.transport.mqtt.mqttv3.telemetry.timeseries.AbstractMqttTimeseriesIntegrationTest; -// Edge-only: merge comment -// NoSQL is not supported on edge -// @DaoNoSqlTest +@DaoNoSqlTest public class MqttTimeseriesNoSqlIntegrationTest extends AbstractMqttTimeseriesIntegrationTest { } diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlJsonIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlJsonIntegrationTest.java index 25ded31d61..90e994b5a8 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlJsonIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlJsonIntegrationTest.java @@ -18,8 +18,6 @@ import org.thingsboard.server.dao.service.DaoNoSqlTest; import org.thingsboard.server.transport.mqtt.mqttv3.telemetry.timeseries.AbstractMqttTimeseriesJsonIntegrationTest; -// Edge-only: merge comment -// NoSQL is not supported on edge -// @DaoNoSqlTest +@DaoNoSqlTest public class MqttTimeseriesNoSqlJsonIntegrationTest extends AbstractMqttTimeseriesJsonIntegrationTest { } diff --git a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlProtoIntegrationTest.java b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlProtoIntegrationTest.java index 16b05547a4..021f505d68 100644 --- a/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlProtoIntegrationTest.java +++ b/application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/telemetry/timeseries/nosql/MqttTimeseriesNoSqlProtoIntegrationTest.java @@ -18,8 +18,6 @@ import org.thingsboard.server.dao.service.DaoNoSqlTest; import org.thingsboard.server.transport.mqtt.mqttv3.telemetry.timeseries.AbstractMqttTimeseriesProtoIntegrationTest; -// Edge-only: merge comment -// NoSQL is not supported on edge -// @DaoNoSqlTest +@DaoNoSqlTest public class MqttTimeseriesNoSqlProtoIntegrationTest extends AbstractMqttTimeseriesProtoIntegrationTest { } diff --git a/dao/src/test/java/org/thingsboard/server/dao/TimescaleDaoServiceTestSuite.java b/dao/src/test/java/org/thingsboard/server/dao/TimescaleDaoServiceTestSuite.java index 97e91d734b..c7f465dfe9 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/TimescaleDaoServiceTestSuite.java +++ b/dao/src/test/java/org/thingsboard/server/dao/TimescaleDaoServiceTestSuite.java @@ -19,9 +19,7 @@ import org.junit.extensions.cpsuite.ClasspathSuite.ClassnameFilters; import org.junit.runner.RunWith; -// Edge-only: merge comment -// Timescale DB is not supported on edge -// @RunWith(ClasspathSuite.class) +@RunWith(ClasspathSuite.class) @ClassnameFilters({ "org.thingsboard.server.dao.service.*.nosql.*ServiceTimescaleTest", }) diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java index 66b2cdf442..9fe3f85463 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/DeviceServiceTest.java @@ -562,12 +562,6 @@ public void testFindDeviceById() { @Test public void testFindDeviceTypesByTenantId() throws Exception { - - // TODO: @voba device profiles are not created on edge at the moment - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeA"); - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeB"); - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeC"); - List devices = new ArrayList<>(); try { for (int i = 0; i < 3; i++) { @@ -734,11 +728,6 @@ public void testFindDevicesByTenantIdAndName() { @Test public void testFindDevicesByTenantIdAndType() { - - // TODO: @voba device profiles are not created on edge at the moment - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeA"); - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeB"); - String title1 = "Device title 1"; String type1 = "typeA"; List devicesType1 = new ArrayList<>(); @@ -948,10 +937,6 @@ public void testFindDevicesByTenantIdCustomerIdAndName() { @Test public void testFindDevicesByTenantIdCustomerIdAndType() { - // TODO: @voba device profiles are not created on edge at the moment - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeC"); - deviceProfileService.findOrCreateDeviceProfile(tenantId, "typeD"); - Customer customer = new Customer(); customer.setTitle("Test customer"); customer.setTenantId(tenantId); diff --git a/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AdminSettingsClientTest.java b/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AdminSettingsClientTest.java index 7b8422e4b6..517946994d 100644 --- a/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AdminSettingsClientTest.java +++ b/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AdminSettingsClientTest.java @@ -24,6 +24,7 @@ public class AdminSettingsClientTest extends AbstractContainerTest { @Test public void testTenantAdminSettings() { - // TODO: voba + } + } diff --git a/rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleNode.java b/rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleNode.java index 4e0db7c912..930d608ea1 100644 --- a/rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleNode.java +++ b/rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/RuleNode.java @@ -66,7 +66,7 @@ boolean ruleChainNode() default false; - // TODO: voba - merge comment + // Edge-only: RuleChainType.EDGE exists only on Cloud side //RuleChainType[] ruleChainTypes() default {RuleChainType.CORE, RuleChainType.EDGE}; RuleChainType[] ruleChainTypes() default {RuleChainType.CORE}; diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html index f413b43352..335e621f1e 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html @@ -128,7 +128,7 @@ close{{ 'action.cancel' | translate }} -