for (AnalysisEngineDescription d : analysisEngineDescriptions) { allowMultipleDeploy &= d.getAnalysisEngineMetaData().getOperationalProperties() .isMultipleDeploymentAllowed(); .setMultipleDeploymentAllowed(allowMultipleDeploy);
OperationalProperties componentProps = md.getOperationalProperties(); if (componentProps != null) { if (aggProps.isMultipleDeploymentAllowed() && !componentProps.isMultipleDeploymentAllowed()) { throw new ResourceInitializationException( ResourceInitializationException.INVALID_MULTIPLE_DEPLOYMENT_ALLOWED, getAnalysisEngineMetaData().getSourceUrlString() }); if (!aggProps.getModifiesCas() && componentProps.getModifiesCas()) { throw new ResourceInitializationException( ResourceInitializationException.INVALID_MODIFIES_CAS, new Object[] { getAnalysisEngineMetaData().getSourceUrlString() }); if (componentProps.getOutputsNewCASes()) { atLeastOneCasMultiplier = true; if (aggProps.getOutputsNewCASes() && !atLeastOneCasMultiplier) { throw new ResourceInitializationException( ResourceInitializationException.INVALID_OUTPUTS_NEW_CASES, new Object[] {
/** * Overridden to set default operational properties if they are not specified in descriptor. */ public void buildFromXMLElement(Element aElement, XMLParser aParser, ParsingOptions aOptions) throws InvalidXMLException { super.buildFromXMLElement(aElement, aParser, aOptions); if (getCollectionReaderMetaData().getOperationalProperties() == null) { OperationalProperties opProps = UIMAFramework.getResourceSpecifierFactory() .createOperationalProperties(); opProps.setModifiesCas(true); opProps.setMultipleDeploymentAllowed(false); opProps.setOutputsNewCASes(true); getCollectionReaderMetaData().setOperationalProperties(opProps); } }
/** * Overridden to set default operational properties if they are not specified in descriptor. * @param aElement - * @param aParser - * @param aOptions - * @throws InvalidXMLException - */ @Override public void buildFromXMLElement(Element aElement, XMLParser aParser, ParsingOptions aOptions) throws InvalidXMLException { super.buildFromXMLElement(aElement, aParser, aOptions); if (getAnalysisEngineMetaData().getOperationalProperties() == null) { OperationalProperties opProps = UIMAFramework.getResourceSpecifierFactory() .createOperationalProperties(); opProps.setModifiesCas(true); opProps.setMultipleDeploymentAllowed(true); getAnalysisEngineMetaData().setOperationalProperties(opProps); } }
ops.setModifiesCas(setValueChangedBoolean(modifiesCas.getSelection(), ops.getModifiesCas())); } else if (event.widget == multipleDeploymentAllowed) { ops.setMultipleDeploymentAllowed(setValueChangedBoolean(multipleDeploymentAllowed .getSelection(), ops.isMultipleDeploymentAllowed())); } else if (event.widget == outputsNewCASes) { ops.setOutputsNewCASes(setValueChangedBoolean(outputsNewCASes.getSelection(), ops .getOutputsNewCASes())); } else if (event.widget == implName) { editor.getAeDescription().setAnnotatorImplementationName(
if (!dlgOperProps.isMultipleDeploymentAllowed()) isMultipleDeploymentAllowed = false; if (dlgOperProps.getModifiesCas()) modifiesCas = true; } else if (!dlgOperProps.isMultipleDeploymentAllowed()) isMultipleDeploymentAllowed = false; aggOperProps.setMultipleDeploymentAllowed(isMultipleDeploymentAllowed); aggOperProps.setModifiesCas(modifiesCas);
public void initialize(FlowControllerContext aContext) throws ResourceInitializationException { super.initialize(aContext); FlowConstraints flowConstraints = aContext.getAggregateMetadata().getFlowConstraints(); mSequence = new ArrayList<String>(); if (flowConstraints instanceof FixedFlow) { String[] sequence = ((FixedFlow) flowConstraints).getFixedFlow(); mSequence.addAll(Arrays.asList(sequence)); } else { throw new ResourceInitializationException(ResourceInitializationException.FLOW_CONTROLLER_REQUIRES_FLOW_CONSTRAINTS, new Object[]{this.getClass().getName(), "fixedFlow", aContext.getAggregateMetadata().getSourceUrlString()}); } // Check if first delegate is a CasMultiplier. // Any other CMs will have no special treatment, // i.e. parent will follow children thru the rest of the pipeline Iterator<Entry<String, AnalysisEngineMetaData>> aeIter = getContext().getAnalysisEngineMetaDataMap().entrySet().iterator(); while (aeIter.hasNext()) { Entry<String, AnalysisEngineMetaData> entry = aeIter.next(); AnalysisEngineMetaData md = entry.getValue(); OperationalProperties op = md.getOperationalProperties(); if (op.getOutputsNewCASes()) { if (mSequence.get(0).equals(entry.getKey())) { mStartsWithCasMultiplier = true; } } } }
.setMultipleDeploymentAllowed(multipleDeploymentAllowed);
.getOperationalProperties().setOutputsNewCASes(true);
/** * Returns true. By contract, CAS Consumers must be read only. * * @see org.apache.uima.collection.base_cpm.CasProcessor#isReadOnly() */ public final boolean isReadOnly() { OperationalProperties opProps = getProcessingResourceMetaData().getOperationalProperties(); return opProps == null ? true : !opProps.getModifiesCas(); }
.unmodifiableMap(mComponentAnalysisEngineMetaDataMap); mOutputNewCASes = aAggregateMetadata.getOperationalProperties().getOutputsNewCASes();
/** * Initializes this instance with configuration defined in the CPE descriptor. * * @param aCasProcessorType - */ public NetworkCasProcessorImpl(CpeCasProcessor aCasProcessorType) { casProcessorType = aCasProcessorType; retryCount = casProcessorType.getErrorHandling().getMaxConsecutiveRestarts().getRestartCount(); if (retryCount == 0) { retryCount = DEFAULT_RETRY_COUNT; } // Instantiate metadata object to store configuration information metadata = new ProcessingResourceMetaData_impl(); // Each CasProcessor has name name = casProcessorType.getName(); metadata.setName(name); OperationalProperties operationalProperties = new OperationalProperties_impl(); operationalProperties.setModifiesCas(true); operationalProperties.setMultipleDeploymentAllowed(true); metadata.setOperationalProperties(operationalProperties); ConfigurationParameterSettings settings = new ConfigurationParameterSettings_impl(); settings.setParameterValue(Constants.CAS_PROCESSOR_CONFIG, casProcessorType); metadata.setConfigurationParameterSettings(settings); }
public boolean isStateless() { if (resourceMetadata == null) { try { resourceMetadata = textAnalysisProxy.getAnalysisEngineMetaData(); } catch (ResourceServiceException e) { //can't throw exception from here so just log it and return the default UIMAFramework.getLogger(this.getClass()).log(Level.SEVERE, e.getMessage(), e); return true; } } OperationalProperties opProps = resourceMetadata.getOperationalProperties(); if (opProps != null) { return !opProps.isMultipleDeploymentAllowed(); } return true; //default }
aggDesc.getAnalysisEngineMetaData().getOperationalProperties().setMultipleDeploymentAllowed( false); progressMonitor.setProgress(1);
@Override public AnalysisEngine buildPipeline(AnyObject config, String pipeline, int stageId, FixedFlow funnel, boolean outputNewCASes) throws Exception { loadTypePriorities(config); Iterable<AnyObject> iterable = config.getIterable(pipeline); FlowControllerDescription fcd = FlowControllerFactory .createFlowControllerDescription(FixedFlowController797182.class); AnalysisEngineDescription aee = buildPipeline(stageId, iterable, fcd); if (funnel != null) { FixedFlow fc = (FixedFlow) aee.getAnalysisEngineMetaData().getFlowConstraints(); funnel.setFixedFlow(fc.getFixedFlow()); aee.getAnalysisEngineMetaData().setFlowConstraints(funnel); } aee.getAnalysisEngineMetaData().getOperationalProperties().setOutputsNewCASes(outputNewCASes); aee.getAnalysisEngineMetaData().setName(pipeline); return AnalysisEngineFactory.createAggregate(aee); }
public boolean isReadOnly() { OperationalProperties opProps = getAnalysisEngineMetaData().getOperationalProperties(); return opProps == null ? false : !opProps.getModifiesCas(); }
/** * Overridden to set default operational properties if they are not specified in descriptor. */ public void buildFromXMLElement(Element aElement, XMLParser aParser, ParsingOptions aOptions) throws InvalidXMLException { super.buildFromXMLElement(aElement, aParser, aOptions); if (getCasConsumerMetaData().getOperationalProperties() == null) { OperationalProperties opProps = UIMAFramework.getResourceSpecifierFactory() .createOperationalProperties(); opProps.setModifiesCas(false); opProps.setMultipleDeploymentAllowed(false); opProps.setOutputsNewCASes(false); getCasConsumerMetaData().setOperationalProperties(opProps); } }
for (AnalysisEngineDescription d : analysisEngineDescriptions) { allowMultipleDeploy &= d.getAnalysisEngineMetaData().getOperationalProperties() .isMultipleDeploymentAllowed(); .setMultipleDeploymentAllowed(allowMultipleDeploy);
setButtonSelection(modifiesCas, ops.getModifiesCas()); setButtonSelection(multipleDeploymentAllowed, ops.isMultipleDeploymentAllowed()); setButtonSelection(outputsNewCASes, ops.getOutputsNewCASes()); } else { setButtonSelection(modifiesCas, true);