use of io.cdap.cdap.runtime.spi.runtimejob.RuntimeJobInfo in project cdap by caskdata.
the class RuntimeJobTwillPreparer method launch.
@Override
protected void launch(TwillRuntimeSpecification twillRuntimeSpec, RuntimeSpecification runtimeSpec, JvmOptions jvmOptions, Map<String, String> environments, Map<String, LocalFile> localFiles, TimeoutChecker timeoutChecker) throws Exception {
try (RuntimeJobManager jobManager = jobManagerSupplier.get()) {
timeoutChecker.throwIfTimeout();
Map<String, LocalFile> localizeFiles = new HashMap<>(localFiles);
for (Map.Entry<String, Location> secretFile : secretFiles.entrySet()) {
Location secretFileLocation = secretFile.getValue();
localizeFiles.put(secretFile.getKey(), new DefaultLocalFile(secretFile.getKey(), secretFileLocation.toURI(), secretFileLocation.lastModified(), secretFileLocation.length(), false, null));
}
RuntimeJobInfo runtimeJobInfo = createRuntimeJobInfo(runtimeSpec, localizeFiles, jvmOptions.getRunnableExtraOptions(runtimeSpec.getName()));
LOG.info("Starting runnable {} for runId {} with job manager.", runtimeSpec.getName(), getProgramRunId());
// launch job using job manager
jobManager.launch(runtimeJobInfo);
}
}
Aggregations