Java SDK Documentation  12.0.0
com.vertica.sdk.SourceFactory Class Reference
Inheritance diagram for com.vertica.sdk.SourceFactory:
Inheritance graph
Collaboration diagram for com.vertica.sdk.SourceFactory:
Collaboration graph

Public Member Functions

int getDesiredThreads (ServerInterface srvInterface, ExecutorPlanContext planCtxt) throws UdfException
 
void getParameterType (ServerInterface srvInterface, SizedColumnTypes parameterTypes)
 
void getPerInstanceResources (ServerInterface srvInterface, VResources res)
 
void getPerInstanceResources (ServerInterface srvInterface, VResources res, SizedColumnTypes argTypes)
 
void getPrototype (ServerInterface srvInterface, ColumnTypes argTypes, ColumnTypes returnType)
 
void getReturnType (ServerInterface srvInterface, SizedColumnTypes argTypes, SizedColumnTypes returnType)
 
UDXType getUDXFactoryType ()
 
boolean isSourceApportionable ()
 
void plan (ServerInterface srvInterface, NodeSpecifyingPlanContext planCtxt) throws UdfException
 
SourceIterator prepare (ServerInterface srvInterface, NodeSpecifyingPlanContext planCtxt) throws UdfException
 
SourceIterator prepare (ServerInterface srvInterface, ExecutorPlanContext planCtxt) throws UdfException
 
ArrayList< UDSourceprepareUDSources (ServerInterface srvInterface, NodeSpecifyingPlanContext planCtxt) throws UdfException
 
ArrayList< UDSourceprepareUDSources (ServerInterface srvInterface, ExecutorPlanContext planCtxt) throws UdfException
 

Protected Attributes

long libOid
 
String sqlName
 

Detailed Description

Produces and initializes UDSources to process input data sources.

Subclassing SourceFactory is the preferred way to implement a factory corresponding to a UDSource. If you need more flexibility, implement both IterativeSourceFactory and SourceIterator. (See the documentation of IterativeSourceFactory.)

Member Function Documentation

int com.vertica.sdk.SourceFactory.getDesiredThreads ( ServerInterface  srvInterface,
ExecutorPlanContext  planCtxt 
) throws UdfException

Request the number of threads that the SourceFactory wants to use. This function is called on each node before prepareUDSources().

'planCtxt' contains the same parameters stored by plan() method. It also exposes the maximum number of allowed threads, via 'getMaxAllowedThreads()'. Further computations can be stored in its 'ExecutorParamWriter' object, for use in prepare().

void com.vertica.sdk.UDXFactory.getParameterType ( ServerInterface  srvInterface,
SizedColumnTypes  parameterTypes 
)
inherited

Function to tell Vertica the name and types of parameters that this function uses. Vertica will use this to warn function callers that certain parameters they provide are not affecting anything, or that certain parameters that are not being set are reverting to default values.

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica
parameterTypesSizedColumnTypes describing the parameters
void com.vertica.sdk.UDLFactory.getPerInstanceResources ( ServerInterface  srvInterface,
VResources  res,
SizedColumnTypes  argTypes 
)
inherited

Set the resource required for each instance of the UDX Object subclass

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica
resa VResources object used to tell Vertica what resources are needed by the UDX
argTypesProvides the data types of arguments that this UDx was called with. This may be used to calculate the resources required by the UDx.
void com.vertica.sdk.UDLFactory.getPrototype ( ServerInterface  srvInterface,
ColumnTypes  argTypes,
ColumnTypes  returnType 
)
virtualinherited

Provides the argument and return types of the UDL. UDL's take no input tuples; as such, their prototype is empty.

Implements com.vertica.sdk.UDXFactory.

void com.vertica.sdk.UDLFactory.getReturnType ( ServerInterface  srvInterface,
SizedColumnTypes  argTypes,
SizedColumnTypes  returnType 
)
virtualinherited

Not used in this form

Implements com.vertica.sdk.UDXFactory.

UDXType com.vertica.sdk.IterativeSourceFactory.getUDXFactoryType ( )
virtualinherited

User subclasses should use the appropriate subclass of UDXFactory and not override this method on their own.

Returns
the type of UDX Object instance this factory returns.

Implements com.vertica.sdk.UDXFactory.

boolean com.vertica.sdk.IterativeSourceFactory.isSourceApportionable ( )
inherited
Returns
if this source factory has the capability to generate source with portions
void com.vertica.sdk.SourceFactory.plan ( ServerInterface  srvInterface,
NodeSpecifyingPlanContext  planCtxt 
) throws UdfException

Execute any planning logic required at query plan time. This method is run once per query, during query initialization. Its job is to perform parameter validation, and to modify the set of nodes that the COPY statement will run on.

plan() runs exactly once per query, on the initiator node. If it throws an exception, the query will not proceed; it will be aborted prior to distributing the query to the other nodes and running prepare().

Parameters
srvInterfaceInterface to server operations and functionality, including (not-per-column) parameter lookup
planCtxtContext for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan(). Also provides functionality for specifying which nodes this query will run on.
Exceptions
UdfExceptionUDF problem
SourceIterator com.vertica.sdk.IterativeSourceFactory.prepare ( ServerInterface  srvInterface,
NodeSpecifyingPlanContext  planCtxt 
) throws UdfException
inherited

Prepare this SourceFactory to start creating sources. This function will be called on each node, prior to the Load operator starting to execute and prior to any other virtual functions on this class being called.

Parameters
srvInterfaceInterface to server operations and functionality, including (not-per-column) parameter lookup.
planCtxtContext for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan() and getDesiredThreads(). It also provides functionality for determining which nodes this query is running on.
Returns
A SourceIterator object for use in the query.
Exceptions
UdfExceptionUDF problem

Referenced by com.vertica.sdk.IterativeSourceFactory.prepare().

SourceIterator com.vertica.sdk.SourceFactory.prepare ( ServerInterface  srvInterface,
ExecutorPlanContext  planCtxt 
) throws UdfException
ArrayList<UDSource> com.vertica.sdk.SourceFactory.prepareUDSources ( ServerInterface  srvInterface,
NodeSpecifyingPlanContext  planCtxt 
) throws UdfException

Create UDSources. This function will be called on each node, prior to the Load operator starting to execute.

Parameters
srvInterfaceInterface to server operations and functionality, including (not-per-column) parameter lookup.
planCtxtContext for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan() and getDesiredThreads(). It also provides functionality for determining which nodes this query is running on.
Returns
An ArrayList of UDSources to use for this query. Sources will be loaded in a pooled manner, several at a time.
Exceptions
UdfExceptionUDF problem

Referenced by com.vertica.sdk.SourceFactory.prepare(), and com.vertica.sdk.SourceFactory.prepareUDSources().

ArrayList<UDSource> com.vertica.sdk.SourceFactory.prepareUDSources ( ServerInterface  srvInterface,
ExecutorPlanContext  planCtxt 
) throws UdfException

Create UDSources. This function will be called on each node, prior to the Load operator starting to execute.

Parameters
srvInterfaceInterface to server operations and functionality, including (not-per-column) parameter lookup.
planCtxtContext for storing and retrieving arbitrary data, for use just by this instance of this query. The same context is shared with plan() and getDesiredThreads(). It provides functionality for determining which nodes this query is running on, as well as the number of threads allowed by the resource pool (via getMaxAllowedThreads()) and, more importantly, the actual load concurrency (via getLoadConcurrency()).
Returns
An ArrayList of UDSources to use for this query. Sources will be loaded in a pooled manner, several at a time.
Exceptions
UdfExceptionUDF problem