Search in sources :

Example 1 with DistroFailedTaskHandler

use of com.alibaba.nacos.core.distributed.distro.component.DistroFailedTaskHandler in project nacos by alibaba.

the class AbstractDistroExecuteTask method handleFailedTask.

/**
 * Handle failed task.
 */
protected void handleFailedTask() {
    String type = getDistroKey().getResourceType();
    DistroFailedTaskHandler failedTaskHandler = distroComponentHolder.findFailedTaskHandler(type);
    if (null == failedTaskHandler) {
        Loggers.DISTRO.warn("[DISTRO] Can't find failed task for type {}, so discarded", type);
        return;
    }
    failedTaskHandler.retry(getDistroKey(), getDataOperation());
}
Also used : DistroFailedTaskHandler(com.alibaba.nacos.core.distributed.distro.component.DistroFailedTaskHandler)

Example 2 with DistroFailedTaskHandler

use of com.alibaba.nacos.core.distributed.distro.component.DistroFailedTaskHandler in project nacos by alibaba.

the class DistroClientComponentRegistryTest method testDoRegister.

@Test
public void testDoRegister() {
    distroClientComponentRegistry.doRegister();
    DistroDataStorage dataStorage = componentHolder.findDataStorage(DistroClientDataProcessor.TYPE);
    Assert.assertNotNull(dataStorage);
    DistroDataProcessor dataProcessor = componentHolder.findDataProcessor(DistroClientDataProcessor.TYPE);
    Assert.assertNotNull(dataProcessor);
    DistroFailedTaskHandler failedTaskHandler = componentHolder.findFailedTaskHandler(DistroClientDataProcessor.TYPE);
    Assert.assertNotNull(failedTaskHandler);
    DistroTransportAgent transportAgent = componentHolder.findTransportAgent(DistroClientDataProcessor.TYPE);
    Assert.assertNotNull(transportAgent);
}
Also used : DistroTransportAgent(com.alibaba.nacos.core.distributed.distro.component.DistroTransportAgent) DistroDataProcessor(com.alibaba.nacos.core.distributed.distro.component.DistroDataProcessor) DistroFailedTaskHandler(com.alibaba.nacos.core.distributed.distro.component.DistroFailedTaskHandler) DistroDataStorage(com.alibaba.nacos.core.distributed.distro.component.DistroDataStorage) Test(org.junit.Test)

Aggregations

DistroFailedTaskHandler (com.alibaba.nacos.core.distributed.distro.component.DistroFailedTaskHandler)2 DistroDataProcessor (com.alibaba.nacos.core.distributed.distro.component.DistroDataProcessor)1 DistroDataStorage (com.alibaba.nacos.core.distributed.distro.component.DistroDataStorage)1 DistroTransportAgent (com.alibaba.nacos.core.distributed.distro.component.DistroTransportAgent)1 Test (org.junit.Test)1