public void abort() {
        TaskResult taskResult = getResult();
        if (taskResult == TaskResult.NOT_FINISHED || taskResult == TaskResult.NONE_SUCCESS) {
            AbortCompactionRequest abortRequest = new AbortCompactionRequest();
            abortRequest.txnId = request.txnId;
            try {
                Future<AbortCompactionResponse> ignored = rpcChannel.abortCompaction(abortRequest);
                LOG.info("aborted compaction task, txn_id: {}, node: {}", request.txnId, nodeId);
            } catch (Exception e) {
                LOG.warn("fail to abort compaction task, txn_id: {}, node: {} error: {}", request.txnId,
                        nodeId, e.getMessage());
            }
        }
    }
@Test
    public void testAbort(@Mocked LakeService lakeService) {
        CompactRequest request = new CompactRequest();
        request.tabletIds = Arrays.asList(1L);
        request.txnId = 1000L;
        request.version = 10L;
        CompactionTask task = new CompactionTask(10043, lakeService, request);
        new Expectations() {
            {
                lakeService.abortCompaction((AbortCompactionRequest) any);
                result = null; // unused
            }
        };

        task.abort();
    }