/** * Creates an analysis job of this {@link AnalysisJobBuilder}. * * @param validate * whether or not to validate job configuration while building * @return * @throws IllegalStateException * if the job is invalidly configured. */ public AnalysisJob toAnalysisJob(final boolean validate) throws IllegalStateException { return toAnalysisJob(validate, new AnalysisJobImmutabilizer()); }
new AnalysisJobImmutabilizer().load(getComponentRequirement()); return new ImmutableAnalyzerJob(getName(), getDescriptor(), new ImmutableComponentConfiguration(jobProperties), componentRequirement, metadataProperties, outputDataStreamJobs);
public ComponentRequirement load(final ComponentRequirement req) { if (req instanceof SimpleComponentRequirement) { final FilterOutcome originalOutcome = ((SimpleComponentRequirement) req).getOutcome(); final FilterOutcome loadedOutcome = load(originalOutcome); if (loadedOutcome != originalOutcome) { return new SimpleComponentRequirement(loadedOutcome); } } else if (req instanceof CompoundComponentRequirement) { boolean changed = false; final CompoundComponentRequirement componentRequirement = (CompoundComponentRequirement) req; final Set<FilterOutcome> originalOutcomes = componentRequirement.getOutcomes(); final List<FilterOutcome> loadedOutcomes = new ArrayList<>(originalOutcomes.size()); for (final FilterOutcome originalOutcome : originalOutcomes) { final FilterOutcome loadedOutcome = load(originalOutcome); if (loadedOutcome != originalOutcome) { changed = true; } loadedOutcomes.add(loadedOutcome); } if (changed) { return new CompoundComponentRequirement(loadedOutcomes); } } return req; }
final TransformerJob componentJob = immutabilizer.getOrCreateTransformerJob(validate, tjb); transformerJobs.add(componentJob);
final Map<ConfiguredPropertyDescriptor, Object> configuredProperties = getConfiguredProperties(); final ComponentRequirement componentRequirement = immutabilizer.load(getComponentRequirement()); final OutputDataStreamJob[] outputDataStreamJobs = immutabilizer.load(getOutputDataStreamJobs(), validate); final ImmutableAnalyzerJob job = new ImmutableAnalyzerJob(getName(), getDescriptor(), new ImmutableComponentConfiguration(configuredProperties), componentRequirement,
@Override public AnalysisJob getJob() { return getJob(false, new AnalysisJobImmutabilizer()); }
public TransformerJob toTransformerJob(final boolean validate, final AnalysisJobImmutabilizer immutabilizer) { if (validate && !isConfigured(true)) { throw new IllegalStateException("Transformer job is not correctly configured"); } final ComponentRequirement componentRequirement = immutabilizer.load(getComponentRequirement()); final OutputDataStreamJob[] outputDataStreamJobs = immutabilizer.load(getOutputDataStreamJobs(), validate); return new ImmutableTransformerJob(getName(), getDescriptor(), new ImmutableComponentConfiguration(getConfiguredProperties()), getOutputColumns(), componentRequirement, getMetadataProperties(), outputDataStreamJobs); }
public TransformerJob toTransformerJob(final boolean validate) { return toTransformerJob(validate, new AnalysisJobImmutabilizer()); }
public FilterJob toFilterJob(final boolean validate, final AnalysisJobImmutabilizer immutabilizer) { if (validate && !isConfigured(true)) { throw new IllegalStateException("Filter job is not correctly configured"); } final ComponentRequirement componentRequirement = immutabilizer.load(getComponentRequirement()); final OutputDataStreamJob[] outputDataStreamJobs = immutabilizer.load(getOutputDataStreamJobs(), validate); if (_cachedJob == null) { _cachedJob = new ImmutableFilterJob(getName(), getDescriptor(), new ImmutableComponentConfiguration(getConfiguredProperties()), componentRequirement, getMetadataProperties(), outputDataStreamJobs); } else { final ImmutableFilterJob newFilterJob = new ImmutableFilterJob(getName(), getDescriptor(), new ImmutableComponentConfiguration(getConfiguredProperties()), componentRequirement, getMetadataProperties(), outputDataStreamJobs); if (!newFilterJob.equals(_cachedJob)) { _cachedJob = newFilterJob; } } return _cachedJob; }
public AnalyzerJob[] toAnalyzerJobs(final boolean validate) throws IllegalStateException { return toAnalyzerJobs(validate, new AnalysisJobImmutabilizer()); }
public FilterJob toFilterJob(final boolean validate) { return toFilterJob(validate, new AnalysisJobImmutabilizer()); }