com.bigdata.rdf.sparql.ast.hints
Class AbstractChunkSizeHint

java.lang.Object
  extended by com.bigdata.rdf.sparql.ast.hints.AbstractChunkSizeHint
All Implemented Interfaces:
IQueryHint<Integer>

public abstract class AbstractChunkSizeHint
extends Object

Version:
$Id: AbstractChunkSizeHint.java 6080 2012-03-07 18:38:55Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
AbstractChunkSizeHint(String name, Integer defaultValue)
           
 
Method Summary
protected  void _setAnnotation(IEvaluationContext ctx, QueryHintScope scope, ASTBase op, String name, T value)
          Set an annotation on the AST node.
protected  void _setQueryHint(IEvaluationContext ctx, QueryHintScope scope, ASTBase op, String name, T value)
          Set the query hint.
 T getDefault()
          The default value for this query hint (many query hints provide overrides of defaults).
 String getName()
          The name of the query hint.
 void handle(AST2BOpContext context, QueryHintScope scope, ASTBase op, Integer value)
          Handle the query hint.
 Integer validate(String value)
          Validate the value, returning an object of the appropriate type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractChunkSizeHint

public AbstractChunkSizeHint(String name,
                             Integer defaultValue)
Parameters:
name -
defaultValue -
Method Detail

handle

public void handle(AST2BOpContext context,
                   QueryHintScope scope,
                   ASTBase op,
                   Integer value)
Description copied from interface: IQueryHint
Handle the query hint.

Note: The name of the query hint is no longer strongly coupled to the name of the annotation. This method may be used to attach zero or more annotations as appropriate to the AST structure. It may also be used to change defaults in the AST2BOpContext or take similar actions.

Parameters:
context - The query evaluation context.
scope - The QueryHintScope specified for the query hint.
op - An AST node to which the hint should bind.
value - The value specified for the query hint.

validate

public Integer validate(String value)
Description copied from interface: IQueryHint
Validate the value, returning an object of the appropriate type.

Parameters:
value - The value.
Returns:
The validated value.

getName

public final String getName()
Description copied from interface: IQueryHint
The name of the query hint.

Specified by:
getName in interface IQueryHint<T>

getDefault

public final T getDefault()
Description copied from interface: IQueryHint
The default value for this query hint (many query hints provide overrides of defaults).

Specified by:
getDefault in interface IQueryHint<T>

_setQueryHint

protected final void _setQueryHint(IEvaluationContext ctx,
                                   QueryHintScope scope,
                                   ASTBase op,
                                   String name,
                                   T value)
Set the query hint.

Note: Query hints are Properties objects and their values are Strings. The value will be converted to a String.

Note: Unlike annotations, query hints are propagated en-mass from an AST node to the generated pipeline operator.

Parameters:
name - The name of the query hint.
value - The value for the query hint.

_setAnnotation

protected final void _setAnnotation(IEvaluationContext ctx,
                                    QueryHintScope scope,
                                    ASTBase op,
                                    String name,
                                    T value)
Set an annotation on the AST node.

Note: Annotations are attached directly to the AST node. They are interpreted during query plan generation. Unlike the query hints, the annotations are not automatically transferred to the generated pipeline operators. Instead, they typically control the behavior of the IASTOptimizers.

Parameters:
op - The AST node.
name - The name of the annotation.
value - The value of the annotation.


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.