C++ SDK Documentation  24.2.0
Vertica::SourceIterator Class Referenceabstract

Constructs a set of Sources to be used by an IterativeSourceFactory. More...

Inheritance diagram for Vertica::SourceIterator:
Inheritance graph
Collaboration diagram for Vertica::SourceIterator:
Collaboration graph

Public Member Functions

void cancelUDX (ServerInterface &srvInterface)
 
virtual UnsizedUDSourcecreateNextSource (ServerInterface &srvInterface)=0
 Create the next UDSource to process. More...
 
virtual void destroy (ServerInterface &srvInterface, NodeSpecifyingPlanContext &planCtxt)
 Tear down this SourceIterator. More...
 
virtual size_t getNumberOfSources ()=0
 indicate an upper bound for the number of sources this factory will produce. More...
 
virtual size_t getSizeOfSource (size_t sourceNum)
 
bool isCanceled () const
 
virtual void setup (ServerInterface &srvInterface, NodeSpecifyingPlanContext &planCtxt)
 Set up this SourceIterator. More...
 

Protected Member Functions

virtual void cancel (ServerInterface &srvInterface)
 

Detailed Description

Constructs a set of Sources to be used by an IterativeSourceFactory.

Wrappers to help construct and manage UDLs createNextSource() will be called repeatedly until it returns NULL. Each resulting Source will be read to completion, and the contained data passed to the Filter and Parser.

Member Function Documentation

◆ cancel()

virtual void Vertica::UDXObject::cancel ( ServerInterface srvInterface)
inlineprotectedvirtualinherited

Cancel callback to be overridden by the UDX. Called when the query running the UDX has been canceled.

Note
  • This method will be invoked at most once per UDX object. Once a UDX object has been canceled, it will never be un-canceled.
  • This method may be called from a separate thread, concurrently with other methods of this UDX object (but never the constructor or destructor). Implementations must be thread-safe with all methods of this UDX.
  • This method will be invoked for either an explicit user cancel, or in the event of an error during query execution.

Referenced by Vertica::UDXObject::cancelUDX().

◆ cancelUDX()

void Vertica::UDXObject::cancelUDX ( ServerInterface srvInterface)
inlineinherited

Cancel callback invoked when the query running the UDX has been canceled. See cancel().

◆ createNextSource()

virtual UnsizedUDSource* Vertica::SourceIterator::createNextSource ( ServerInterface srvInterface)
pure virtual

Create the next UDSource to process.

Should return NULL if no further sources are available for processing.

Note that the previous Source may still be open and in use on a different thread when this function is called.

Returns
a new Source instance corresponding to a new input stream

Implemented in Vertica::DefaultSourceIterator.

◆ destroy()

virtual void Vertica::SourceIterator::destroy ( ServerInterface srvInterface,
NodeSpecifyingPlanContext planCtxt 
)
inlinevirtual

Tear down this SourceIterator.

Should perform clean-up that should not take place in the destructor due to the exception-handling semantics of destructors.

◆ getNumberOfSources()

virtual size_t Vertica::SourceIterator::getNumberOfSources ( )
pure virtual

indicate an upper bound for the number of sources this factory will produce.

If this method returns N, then createNextSource() will be called at most N times ("at most" because it will stop being called when it returns NULL).

Returns
the maximum number of Sources that this factory will produce

Implemented in Vertica::DefaultSourceIterator.

Referenced by Vertica::SourceFactory::getDesiredThreads().

◆ getSizeOfSource()

virtual size_t Vertica::SourceIterator::getSizeOfSource ( size_t  sourceNum)
inlinevirtual
Returns
the raw-data size of the sourceNum'th source that will be produced by createNextSource(). Should return vint_null if the size is unknown.

This value is used as a hint, and is used by the "load_streams" table to display load progress. If incorrect or not set, "load_streams" may contain incorrect or unhelpful information.

Reimplemented in Vertica::DefaultSourceIterator.

◆ isCanceled()

bool Vertica::UDXObject::isCanceled ( ) const
inlineinherited
Returns
true iff this UDX has been canceled

◆ setup()

virtual void Vertica::SourceIterator::setup ( ServerInterface srvInterface,
NodeSpecifyingPlanContext planCtxt 
)
inlinevirtual

Set up this SourceIterator.

Should perform setup that should not take place in the constructor due to the exception-handling semantics of constructors