com.cloudera.sqoop.lib
Class SqoopRecord

java.lang.Object
  extended by com.cloudera.sqoop.lib.SqoopRecord
All Implemented Interfaces:
FieldMappable, java.lang.Cloneable, org.apache.hadoop.io.Writable, org.apache.hadoop.mapreduce.lib.db.DBWritable

public abstract class SqoopRecord
extends java.lang.Object
implements java.lang.Cloneable, org.apache.hadoop.mapreduce.lib.db.DBWritable, FieldMappable, org.apache.hadoop.io.Writable

Interface implemented by the classes generated by sqoop's orm.ClassWriter.


Constructor Summary
SqoopRecord()
           
 
Method Summary
 java.lang.Object clone()
           
 void delegate(FieldMapProcessor processor)
          Use the delegate pattern to allow arbitrary processing of the fields of this record.
abstract  int getClassFormatVersion()
          Returns an integer specifying which API format version the generated class conforms to.
 java.util.Map<java.lang.String,java.lang.Object> getFieldMap()
          Returns a map containing all fields of this record.
abstract  void loadLargeObjects(LargeObjectLoader objLoader)
           
abstract  void parse(byte[] s)
           
abstract  void parse(java.nio.ByteBuffer s)
           
abstract  void parse(char[] s)
           
abstract  void parse(java.nio.CharBuffer s)
           
abstract  void parse(java.lang.CharSequence s)
           
abstract  void parse(org.apache.hadoop.io.Text s)
           
abstract  java.lang.String toString(DelimiterSet delimiters)
           
abstract  int write(java.sql.PreparedStatement stmt, int offset)
          Inserts the data in this object into the PreparedStatement, starting at parameter 'offset'.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.mapreduce.lib.db.DBWritable
readFields, write
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Constructor Detail

SqoopRecord

public SqoopRecord()
Method Detail

parse

public abstract void parse(java.lang.CharSequence s)
                    throws RecordParser.ParseError
Throws:
RecordParser.ParseError

parse

public abstract void parse(org.apache.hadoop.io.Text s)
                    throws RecordParser.ParseError
Throws:
RecordParser.ParseError

parse

public abstract void parse(byte[] s)
                    throws RecordParser.ParseError
Throws:
RecordParser.ParseError

parse

public abstract void parse(char[] s)
                    throws RecordParser.ParseError
Throws:
RecordParser.ParseError

parse

public abstract void parse(java.nio.ByteBuffer s)
                    throws RecordParser.ParseError
Throws:
RecordParser.ParseError

parse

public abstract void parse(java.nio.CharBuffer s)
                    throws RecordParser.ParseError
Throws:
RecordParser.ParseError

loadLargeObjects

public abstract void loadLargeObjects(LargeObjectLoader objLoader)
                               throws java.sql.SQLException,
                                      java.io.IOException,
                                      java.lang.InterruptedException
Throws:
java.sql.SQLException
java.io.IOException
java.lang.InterruptedException

write

public abstract int write(java.sql.PreparedStatement stmt,
                          int offset)
                   throws java.sql.SQLException
Inserts the data in this object into the PreparedStatement, starting at parameter 'offset'.

Returns:
the number of fields written to the statement.
Throws:
java.sql.SQLException

toString

public abstract java.lang.String toString(DelimiterSet delimiters)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getClassFormatVersion

public abstract int getClassFormatVersion()
Returns an integer specifying which API format version the generated class conforms to. Used by internal APIs for backwards compatibility.

Returns:
the API version this class was generated against.

delegate

public void delegate(FieldMapProcessor processor)
              throws java.io.IOException,
                     ProcessingException
Use the delegate pattern to allow arbitrary processing of the fields of this record.

Parameters:
processor - A delegate that operates on this object.
Throws:
java.io.IOException - if the processor encounters an IO error when operating on this object.
ProcessingException - if the FieldMapProcessor encounters a general processing error when operating on this object.

getFieldMap

public java.util.Map<java.lang.String,java.lang.Object> getFieldMap()
Description copied from interface: FieldMappable
Returns a map containing all fields of this record.

Specified by:
getFieldMap in interface FieldMappable
Returns:
a map from column names to the object-based values for this record. The map may not be null, though it may be empty.


Copyright © 2011 Cloudera, Inc.