use of com.thinkbiganalytics.nifi.v2.core.savepoint.DistributedSavepointController in project kylo by Teradata.
the class TriggerSavepointTest method setup.
@Before
public void setup() throws InitializationException {
runner = TestRunners.newTestRunner(TriggerSavepoint.class);
final SpringContextService springService = new MockSpringContextService();
DistributedMapCacheClient client = new MockDistributedMapCacheClient();
final Map<String, String> clientProperties = new HashMap<>();
runner.addControllerService("client", client, clientProperties);
runner.enableControllerService(client);
DistributedSavepointController service = new DistributedSavepointController();
final Map<String, String> serviceProperties = new HashMap<>();
serviceProperties.put("distributed-cache-service", "client");
runner.addControllerService("service", service, serviceProperties);
runner.addControllerService(SPRING_SERVICE_IDENTIFIER, springService);
runner.setProperty(service, DistributedSavepointController.SPRING_SERVICE, SPRING_SERVICE_IDENTIFIER);
runner.enableControllerService(springService);
runner.enableControllerService(service);
runner.setProperty(SetSavepoint.SAVEPOINT_SERVICE, "service");
runner.setProperty(TriggerSavepoint.SAVEPOINT_ID, "${savepointid}");
runner.setProperty(TriggerSavepoint.BEHAVIOR, TriggerSavepoint.RETRY);
this.provider = service.getProvider();
}
use of com.thinkbiganalytics.nifi.v2.core.savepoint.DistributedSavepointController in project kylo by Teradata.
the class SetSavepointTest method setup.
@Before
public void setup() throws InitializationException {
runner = TestRunners.newTestRunner(SetSavepoint.class);
final SpringContextService springService = new MockSpringContextService();
DistributedMapCacheClient client = new MockDistributedMapCacheClient();
final Map<String, String> clientProperties = new HashMap<>();
runner.addControllerService("client", client, clientProperties);
runner.enableControllerService(client);
DistributedSavepointController service = new DistributedSavepointController();
final Map<String, String> serviceProperties = new HashMap<>();
serviceProperties.put("distributed-cache-service", "client");
runner.addControllerService("service", service, serviceProperties);
runner.addControllerService(SPRING_SERVICE_IDENTIFIER, springService);
runner.setProperty(service, DistributedSavepointController.SPRING_SERVICE, SPRING_SERVICE_IDENTIFIER);
runner.enableControllerService(springService);
runner.enableControllerService(service);
runner.setProperty(SetSavepoint.SAVEPOINT_SERVICE, "service");
runner.setProperty(SetSavepoint.EXPIRATION_DURATION, "24h");
runner.setProperty(SetSavepoint.SAVEPOINT_ID, "${savepointid}");
this.savepointId = "sp1";
runner.setThreadCount(1);
// Setup existing cache entry.
provider = service.getProvider();
}
Aggregations