@Override
  public void updateTask(Task task) {
    Map.Entry<String, Long> taskInDb = getTaskChecksumAndUpdateTime(task.getTaskId());
    String taskCheckSum = computeChecksum(task);
    if (taskInDb != null) {
      long updateInterval = task.getUpdateTime() - taskInDb.getValue();
      if (taskCheckSum.equals(taskInDb.getKey()) && updateInterval < maxTaskUpdateInterval) {
        LOG.debug(
            "task has the same checksum and update interval {} is less than max interval {} millis and skip update",
            updateInterval,
            maxTaskUpdateInterval);
        return;
      }
      LOG.info(
          "update task [{}] with checksum=[{}] with an update interval=[{}]",
          task.getTaskId(),
          taskCheckSum,
          updateInterval);
    }

    task.setWorkerId(taskCheckSum);
    super.updateTask(task);
  }
@Test
  public void testUpdateTaskMissingChecksum() {
    executionDao.updateTask(task);
    Task actual = maestroExecutionDao.getTask(TEST_TASK_ID);
    assertNull(actual.getWorkerId());
    assertEquals(0, actual.getPollCount());
    assertEquals(0, actual.getUpdateTime());

    // should update DB if there is no checksum
    maestroExecutionDao.updateTask(task);
    actual = maestroExecutionDao.getTask(TEST_TASK_ID);
    assertEquals("b1a2db354f803423e990fad1b9265b6f", actual.getWorkerId());
    assertEquals(1, actual.getPollCount());
    assertEquals(0, actual.getUpdateTime());
  }