THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Download FileConcatenatorPGE
- Extract project
No Format tar xf fileconcatenator-pge.tar –C /usr/local/src
...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="UTF-8"?> <pgeConfig> <!-- How to run the PGE --> <exe dir="[JobDir]" shell="/bin/bash"> <!-- cd to PGE root --> <cmd>cd [PGE_ROOT]/file_concatenator</cmd> <cmd>cp [InputFile1] [OutputFile]</cmd> <cmd>cat [InputFile2] >> [OutputFile]</cmd> </exe> <!-- Files to ingest --> <output> <!-- one or more of these --> <dir path="[JobDir]" createBeforeExe="false"> <!-- one or more of these ** regExp or name can be used--> <files regExp=".*\.txt" metFileWriterClass="org.apache.oodt.pge.examples.fileconcatenator.writers.ConcactenatingFilenameExtractorWriter" args="[PGE_ROOT]/file_concatenator/extractors/concatenatingfilename.extractor.config.xml"/> <files regExp=".*\.txt" metFileWriterClass="org.apache.oodt.cas.pge.writers.metlist.MetadataListPcsMetFileWriter" args="[PGE_ROOT]/file_concatenator/extractors/metlistwriter/metout.xml"/> </dir> </output> <!-- Custom metadata to add to output files --> <customMetadata> <!-- helpful keys --> <metadata key="LessThan" val="<"/> <metadata key="LessThanOrEqualTo" val="[LessThan]="/> <metadata key="GreaterThan" val=">"/> <metadata key="GreaterThanOrEqualTo" val="[GreaterThan]="/> <metadata key="Exclamation" val="!"/> <metadata key="Ampersand" val="&"/> <metadata key="NotEqualTo" val="[Ampersand]="/> <metadata key="LogicalAnd" val="[Ampersand][Ampersand]"/> <metadata key="CshPipeToStdOutAndError" val="[GreaterThan][Ampersand][Exclamation]"/> <metadata key="ProductionDateTime" val="[DATE.UTC]"/> <metadata key="JobDir" val="[PGE_ROOT]/file_concatenator/output/jobs/job-[ProductionDateTime]"/> <metadata key="InputFile1" val="[PGE_ROOT]/file_concatenator/files/concatenatingInputFile1.txt"/> <metadata key="InputFile2" val="[PGE_ROOT]/file_concatenator/files/concatenatingInputFile2.txt"/> <metadata key="OutputFile" val="[JobDir]/concatenatedOutputFile-[ProductionDateTime].txt"/> </customMetadata> </pgeConfig> |
...
- Navigate to your deployed CAS-Workflow’s policy directory
No Format cd $WORKFLOW_HOME/policy
- Modify events.xml
Add the following entry to this file:Code Block title events.xml <event name="fileconcatenator-pge"> <workflow id="urn:oodt:FileConcatenatorWorkflow"/> </event>
- Create a new policy file titled: fileconcatenator-pge.workflow.xml.
Add the following entries to this file:Code Block title fileconcatenator-pge.workflow.xml <cas:workflow xmlns:cas="http://oodt.jpl.nasa.gov/1.0/cas" name="FileConcatenatorWorkflow" id="urn:oodt:FileConcatenatorWorkflow"> <tasks> <task id="urn:oodt:FileConcatenator"/> </tasks> </cas:workflow>
- Modify tasks.xml
Add the following entries to this file:Code Block title tasks.xml <task id="urn:oodt:FileConcatenator" name="FileConcatenator" class="org.apache.oodt.pge.examples.fileconcatenator.FileConcatenatorPGETask"> <conditions/> <configuration> <property name="PGETask_Name" value="FileConcatenator"/> <property name="PGETask_ConfigFilePath" value="[PGE_ROOT]/file_concatenator/pge-configs/PGEConfig.xml" envReplace="true"/> <property name="PGETask_DumpMetadata" value="true"/> <property name="PCS_WorkflowManagerUrl" value="[WORKFLOW_URL]" envReplace="true" /> <property name="PCS_FileManagerUrl" value="[FILEMGR_URL]" envReplace="true"/> <property name="PCS_MetFileExtension" value="met"/> <property name="PCS_ClientTransferServiceFactory" value="org.apache.oodt.cas.filemgr.datatransfer.LocalDataTransferFactory"/> <property name="PCS_ActionRepoFile" value="file:[CRAWLER_HOME]/policy/crawler-config.xml" envReplace="true"/> </configuration> <requiredMetFields> <metfield name="RunID"/> </requiredMetFields> </task>
- Modify workflow-lifecycles.xml
Add the following entries to this file (if not already present):Code Block title workflow-lifecycles.xml <stage name="pge_setup_build_config_file"> <status>BUILDING CONFIG FILE</status> </stage> <stage name="pge_staging_input"> <status>STAGING INPUT</status> </stage> <stage name="pge_exec"> <status>PGE EXEC</status> </stage> <stage name="pcs_crawl"> <status>CRAWLING</status> </stage>
- Modify workflow-instance-met.xml
Add the following entry to this file:Code Block title workflow-instance-met.xml <workflow id="urn:oodt:FileConcatenatorWorkflow"> <field name="RunID"/> </workflow>
- Restart CAS-Workflow
No Format cd $WORKFLOW_HOME/bin ./wmgr restart
...