org.apache.pig
Interface StoreFunc

All Known Subinterfaces:
ReversibleLoadStoreFunc
All Known Implementing Classes:
BinaryStorage, BinStorage, PigDump, PigStorage, RandomSampleLoader

public interface StoreFunc

This interface is used to implement functions to write records from a dataset.

Author:
database-systems@research.yahoo

Method Summary
 void bindTo(OutputStream os)
          Specifies the OutputStream to write to.
 void finish()
          Do any kind of post processing because the last tuple has been stored.
 void putNext(Tuple f)
          Write a tuple the output stream to which this instance was previously bound.
 

Method Detail

bindTo

void bindTo(OutputStream os)
            throws IOException
Specifies the OutputStream to write to. This will be called before store(Tuple) is invoked.

Parameters:
os - The stream to write tuples to.
Throws:
IOException

putNext

void putNext(Tuple f)
             throws IOException
Write a tuple the output stream to which this instance was previously bound.

Parameters:
f - the tuple to store.
Throws:
IOException

finish

void finish()
            throws IOException
Do any kind of post processing because the last tuple has been stored. DO NOT CLOSE THE STREAM in this method. The stream will be closed later outside of this function.

Throws:
IOException


Copyright © ${year} The Apache Software Foundation