DockerContainerDeletionTask extends DeletionTask implements Runnable { public DeletionServiceDeleteTaskProto convertDeletionTaskToProto() { DeletionServiceDeleteTaskProto.Builder builder = getBaseDeletionTaskProtoBuilder(); builder.setTaskType(DeletionTaskType.DOCKER_CONTAINER.name()); if (getContainerId() != null) { builder.setDockerContainerId(getContainerId()); } return builder.build(); } DockerContainerDeletionTask(DeletionService deletionService,
      String user, String containerId);  DockerContainerDeletionTask(int taskId,
      DeletionService deletionService, String user, String containerId); String getContainerId(); @Override void run(); @Override String toString(); DeletionServiceDeleteTaskProto convertDeletionTaskToProto();  }
@Test public void testConvertDeletionTaskToProto() { YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto proto = deletionTask.convertDeletionTaskToProto(); assertEquals(ID, proto.getId()); assertEquals(USER, proto.getUser()); assertEquals(CONTAINER_ID, proto.getDockerContainerId()); assertEquals(DeletionTaskType.DOCKER_CONTAINER.name(), proto.getTaskType()); }