@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 testTaskCompressionOnUpdate() throws JsonProcessingException {
    task.setInputData(
        Collections.singletonMap(
            "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"));
    maestroExecutionDao.updateTask(task);

    String taskPayload = getTaskPayload();
    JsonNode root = mapper.readTree(taskPayload);
    Assert.assertEquals(
        "{\"compressed\":\"H4sIAAAAAAAA/6tWSiQWKFkRrVapFgC8tuw9WAAAAA==\",\"compressor\":\"gzip\"}",
        root.get("inputData").toString());

    Task dbTask = maestroExecutionDao.getTask(task.getTaskId());
    Assert.assertEquals(task.getInputData(), dbTask.getInputData());
  }