Package org.apache.hadoop.fs.shell.find
Class FilterExpression
java.lang.Object
org.apache.hadoop.fs.shell.find.FilterExpression
- All Implemented Interfaces:
Configurable,Expression
Provides an abstract composition filter for the
Expression interface.
Allows other Expression implementations to be reused without
inheritance.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArguments(Deque<String> args) Adds arguments to this expression.voidaddChildren(Deque<Expression> expressions) Adds children to this expression.Apply the expression to the specified item, called once for each item.voidfinish()Finishes the expression, called once after processing all items.getConf()Return the configuration used by this object.String[]getHelp()Returns a description of the expression for use in help.intReturns the precedence of this expression (only applicable to operators).String[]getUsage()Returns brief usage instructions for this expression.booleanisAction()Indicates whether this expression performs an action, i.e. provides output back to the user.booleanIdentifies the expression as an operator rather than a primary.voidprepare()Prepares the expression for execution, called once after setting options and before processing any options.voidsetConf(Configuration conf) Set the configuration to be used by this object.voidsetOptions(FindOptions options) Set the options for this expression, called once before processing any items.toString()
-
Field Details
-
expression
-
-
Constructor Details
-
FilterExpression
-
-
Method Details
-
setOptions
Description copied from interface:ExpressionSet the options for this expression, called once before processing any items.- Specified by:
setOptionsin interfaceExpression- Parameters:
options- options.- Throws:
IOException- raised on errors performing I/O.
-
prepare
Description copied from interface:ExpressionPrepares the expression for execution, called once after setting options and before processing any options.- Specified by:
preparein interfaceExpression- Throws:
IOException- raised on errors performing I/O.
-
apply
Description copied from interface:ExpressionApply the expression to the specified item, called once for each item.- Specified by:
applyin interfaceExpression- Parameters:
item-PathDataitem to be processeddepth- distance of the item from the command line argument- Returns:
Resultof applying the expression to the item- Throws:
IOException- raised on errors performing I/O.
-
finish
Description copied from interface:ExpressionFinishes the expression, called once after processing all items.- Specified by:
finishin interfaceExpression- Throws:
IOException- raised on errors performing I/O.
-
getUsage
Description copied from interface:ExpressionReturns brief usage instructions for this expression. Multiple items should be returned if there are multiple ways to use this expression.- Specified by:
getUsagein interfaceExpression- Returns:
- array of usage instructions
-
getHelp
Description copied from interface:ExpressionReturns a description of the expression for use in help. Multiple lines should be returned array items. Lines should be formated to 60 characters or less.- Specified by:
getHelpin interfaceExpression- Returns:
- array of description lines
-
isAction
public boolean isAction()Description copied from interface:ExpressionIndicates whether this expression performs an action, i.e. provides output back to the user.- Specified by:
isActionin interfaceExpression- Returns:
- if is action true, not false.
-
isOperator
public boolean isOperator()Description copied from interface:ExpressionIdentifies the expression as an operator rather than a primary.- Specified by:
isOperatorin interfaceExpression- Returns:
- if is operator true, not false.
-
getPrecedence
public int getPrecedence()Description copied from interface:ExpressionReturns the precedence of this expression (only applicable to operators).- Specified by:
getPrecedencein interfaceExpression- Returns:
- precedence.
-
addChildren
Description copied from interface:ExpressionAdds children to this expression. Children are popped from the head of the deque.- Specified by:
addChildrenin interfaceExpression- Parameters:
expressions- deque of expressions from which to take the children
-
addArguments
Description copied from interface:ExpressionAdds arguments to this expression. Arguments are popped from the head of the deque and added to the front of the child list, ie last child added is the first evaluated.- Specified by:
addArgumentsin interfaceExpression- Parameters:
args- deque of arguments from which to take expression arguments
-
setConf
Description copied from interface:ConfigurableSet the configuration to be used by this object.- Specified by:
setConfin interfaceConfigurable- Parameters:
conf- configuration to be used
-
getConf
Description copied from interface:ConfigurableReturn the configuration used by this object.- Specified by:
getConfin interfaceConfigurable- Returns:
- Configuration
-
toString
-