org.apache.pig.tools.parameters
Class PreprocessorContext

java.lang.Object
  extended by org.apache.pig.tools.parameters.PreprocessorContext

public class PreprocessorContext
extends Object


Constructor Summary
PreprocessorContext(int limit)
           
PreprocessorContext(Map<String,String> paramVal)
           
 
Method Summary
 Map<String,String> getParamVal()
           
 void loadParamVal(List<String> params, List<String> paramFiles)
           
 void processOrdLine(String key, String val)
          This method generates value for the specified key by performing substitution if needed within the value first.
 void processOrdLine(String key, String val, Boolean overwrite)
          This method generates value for the specified key by performing substitution if needed within the value first.
 void processShellCmd(String key, String val)
          This method generates parameter value by running specified command
 void processShellCmd(String key, String val, Boolean overwrite)
          This method generates parameter value by running specified command
 String substitute(String line)
           
 String substitute(String line, String parentKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreprocessorContext

public PreprocessorContext(int limit)
Parameters:
limit - - max number of parameters. Passing smaller number only impacts performance

PreprocessorContext

public PreprocessorContext(Map<String,String> paramVal)
Method Detail

getParamVal

public Map<String,String> getParamVal()

processShellCmd

public void processShellCmd(String key,
                            String val)
                     throws ParameterSubstitutionException
This method generates parameter value by running specified command

Parameters:
key - - parameter name
val - - string containing command to be executed
Throws:
ParameterSubstitutionException

processOrdLine

public void processOrdLine(String key,
                           String val)
                    throws ParameterSubstitutionException
This method generates value for the specified key by performing substitution if needed within the value first.

Parameters:
key - - parameter name
val - - value supplied for the key
Throws:
ParameterSubstitutionException

processShellCmd

public void processShellCmd(String key,
                            String val,
                            Boolean overwrite)
                     throws ParameterSubstitutionException
This method generates parameter value by running specified command

Parameters:
key - - parameter name
val - - string containing command to be executed
Throws:
ParameterSubstitutionException

processOrdLine

public void processOrdLine(String key,
                           String val,
                           Boolean overwrite)
                    throws ParameterSubstitutionException
This method generates value for the specified key by performing substitution if needed within the value first.

Parameters:
key - - parameter name
val - - value supplied for the key
overwrite - - specifies whether the value should be replaced if it already exists
Throws:
ParameterSubstitutionException

loadParamVal

public void loadParamVal(List<String> params,
                         List<String> paramFiles)
                  throws IOException,
                         org.apache.pig.tools.parameters.ParseException
Throws:
IOException
org.apache.pig.tools.parameters.ParseException

substitute

public String substitute(String line)
                  throws ParameterSubstitutionException
Throws:
ParameterSubstitutionException

substitute

public String substitute(String line,
                         String parentKey)
                  throws ParameterSubstitutionException
Throws:
ParameterSubstitutionException


Copyright © 2007-2012 The Apache Software Foundation