Change heart-beat default database

pull/65/head
Chamindu Senanayake 2 years ago
parent 42d9781d38
commit 17ae023f5c

@ -89,15 +89,17 @@ public class IoTSStartupHandler implements ServerStartupObserver {
taskInfo.setProperties(dt.getProperties()); taskInfo.setProperties(dt.getProperties());
taskManager.registerTask(taskInfo); taskManager.registerTask(taskInfo);
taskManager.rescheduleTask(generatedTaskId); taskManager.rescheduleTask(generatedTaskId);
log.debug("Task - '" + generatedTaskId + "' updated according to the dynamic task table");
} }
if (dt.isEnabled() if (dt.isEnabled()
&& taskManager.getTaskState(generatedTaskId) == TaskManager.TaskState.PAUSED) { && taskManager.getTaskState(generatedTaskId) == TaskManager.TaskState.PAUSED) {
taskManager.resumeTask(generatedTaskId); taskManager.resumeTask(generatedTaskId);
log.debug("Task - '" + generatedTaskId + "' enabled according to the dynamic task table");
} else if (!dt.isEnabled() } else if (!dt.isEnabled()
&& taskManager.getTaskState(generatedTaskId) != TaskManager.TaskState.PAUSED) { && taskManager.getTaskState(generatedTaskId) != TaskManager.TaskState.PAUSED) {
taskManager.pauseTask(generatedTaskId); taskManager.pauseTask(generatedTaskId);
log.debug("Task - '" + generatedTaskId + "' disabled according to the dynamic task table");
} }
log.info("Task - '" + generatedTaskId + "' updated according to the dynamic task table");
break; break;
} }
} }
@ -108,7 +110,7 @@ public class IoTSStartupHandler implements ServerStartupObserver {
dt.getProperties(), triggerInfo); dt.getProperties(), triggerInfo);
taskManager.registerTask(taskInfo); taskManager.registerTask(taskInfo);
taskManager.scheduleTask(generatedTaskId); taskManager.scheduleTask(generatedTaskId);
log.info("New task -'" + generatedTaskId + "' created according to the dynamic task table"); log.debug("New task -'" + generatedTaskId + "' created according to the dynamic task table");
} }
} }
@ -122,7 +124,7 @@ public class IoTSStartupHandler implements ServerStartupObserver {
} }
if (!isExist) { if (!isExist) {
taskManager.deleteTask(taskInfo.getName()); taskManager.deleteTask(taskInfo.getName());
log.info("Task '" + taskInfo.getName() + "' deleted according to the dynamic task table"); log.debug("Task '" + taskInfo.getName() + "' deleted according to the dynamic task table");
} }
} }
log.info("Task Comparison Completed and all tasks in current node are updated"); log.info("Task Comparison Completed and all tasks in current node are updated");

@ -39,10 +39,10 @@
<{{property_name}}>{{property_value}}</{{property_name}}> <{{property_name}}>{{property_value}}</{{property_name}}>
{% endfor %} {% endfor %}
{% else %} {% else %}
<url>jdbc:mysql://localhost:3306/heart_beat</url> <url>jdbc:h2:./repository/database/HEART_BEAT_DB;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE</url>
<username>root</username> <username>wso2carbon</username>
<password>root</password> <password>wso2carbon</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName> <driverClassName>org.h2.Driver</driverClassName>
<maxActive>50</maxActive> <maxActive>50</maxActive>
<maxWait>60000</maxWait> <maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow> <testOnBorrow>true</testOnBorrow>

@ -29,10 +29,10 @@
</jndiConfig> </jndiConfig>
<definition type="RDBMS"> <definition type="RDBMS">
<configuration> <configuration>
<url>jdbc:mysql://localhost:3306/heart_beat</url> <url>jdbc:h2:./repository/database/HEART_BEAT_DB;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE</url>
<username>root</username> <username>wso2carbon</username>
<password>root</password> <password>wso2carbon</password>
<driverClassName>com.mysql.jdbc.Driver</driverClassName> <driverClassName>org.h2.Driver</driverClassName>
<maxActive>50</maxActive> <maxActive>50</maxActive>
<maxWait>60000</maxWait> <maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow> <testOnBorrow>true</testOnBorrow>

Loading…
Cancel
Save