org.apache.cassandra.hadoop.pig

## Class CassandraStorage

- java.lang.Object
- - org.apache.pig.LoadFunc
  - - org.apache.cassandra.hadoop.pig.CassandraStorage

All Implemented Interfaces:
  org.apache.pig.LoadMetadata, org.apache.pig.StoreFuncInterface

Deprecated.

    @Deprecated
    public class CassandraStorage
    extends org.apache.pig.LoadFunc
    implements org.apache.pig.StoreFuncInterface, org.apache.pig.LoadMetadata

A LoadStoreFunc for retrieving data from and storing data to Cassandra A row from a standard CF will be returned as nested tuples: (key, ((name1, val1), (name2, val2))).

### Nested Class Summary

Nested Classes
`protected static class` `CassandraStorage.MarshallerType` Deprecated.

### Field Summary

Fields
`protected java.lang.String` `column_family` Deprecated.
`protected org.apache.hadoop.conf.Configuration` `conf` Deprecated.
`protected java.lang.String` `DEFAULT_INPUT_FORMAT` Deprecated.
`protected java.lang.String` `DEFAULT_OUTPUT_FORMAT` Deprecated.
`protected java.lang.String` `initHostAddress` Deprecated.
`protected java.lang.String` `inputFormatClass` Deprecated.
`protected java.lang.String` `keyspace` Deprecated.
`protected java.lang.String` `loadSignature` Deprecated.
`protected int` `nativeProtocolVersion` Deprecated.
`protected java.lang.String` `outputFormatClass` Deprecated.
`protected java.lang.String` `partitionerClass` Deprecated.
`protected java.lang.String` `password` Deprecated.
`static java.lang.String` `PIG_ALLOW_DELETES` Deprecated.
`static java.lang.String` `PIG_USE_SECONDARY` Deprecated.
`static java.lang.String` `PIG_WIDEROW_INPUT` Deprecated.
`protected java.lang.String` `rpcPort` Deprecated.
`protected int` `splitSize` Deprecated.
`protected java.lang.String` `storeSignature` Deprecated.
`protected boolean` `usePartitionFilter` Deprecated.
`protected java.lang.String` `username` Deprecated.

### Constructor Summary

Constructors
Constructor and Description
`CassandraStorage()` Deprecated.
`CassandraStorage(int limit)` Deprecated.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`protected static CfDef` `cfdefFromString(java.lang.String st)` Deprecated. convert string back to CfDef
`protected static java.lang.String` `cfdefToString(CfDef cfDef)` Deprecated. convert CfDef to string
`void` `checkSchema(org.apache.pig.ResourceSchema schema)` Deprecated.
`void` `cleanupOnFailure(java.lang.String failure, org.apache.hadoop.mapreduce.Job job)` Deprecated.
`void` `cleanupOnSuccess(java.lang.String location, org.apache.hadoop.mapreduce.Job job)` Deprecated.
`protected org.apache.pig.data.Tuple` `columnToTuple(ColumnFamilyRecordReader.Column column, CfDef cfDef, AbstractType comparator)` Deprecated. convert a column to a tuple
`protected org.apache.pig.data.Tuple` `composeComposite(AbstractCompositeType comparator, java.nio.ByteBuffer name)` Deprecated. Deconstructs a composite type to a Tuple.
`protected CfDef` `getCfDef(Cassandra.Client client)` Deprecated. return the CfInfo for the column family
`protected CfDef` `getCfDef(java.lang.String signature)` Deprecated. get the columnfamily definition for the signature
`protected CFMetaData` `getCFMetaData(java.lang.String ks, java.lang.String cf, Cassandra.Client client)` Deprecated. get CFMetaData of a column family
`protected java.util.List<ColumnDef>` `getColumnMeta(Cassandra.Client client, boolean cassandraStorage, boolean includeCompactValueColumn)` Deprecated. get column meta data
`protected java.util.List<ColumnDef>` `getColumnMetadata(Cassandra.Client client)` Deprecated. get a list of column for the column family
`protected java.util.Map<CassandraStorage.MarshallerType,AbstractType>` `getDefaultMarshallers(CfDef cfDef)` Deprecated. construct a map to store the mashaller type to cassandra data type mapping
`protected java.lang.String` `getFullyQualifiedClassName(java.lang.String classname)` Deprecated. get the full class name
`protected java.util.List<ColumnDef>` `getIndexes()` Deprecated. get a list of columns with defined index
`protected IndexType` `getIndexType(java.lang.String type)` Deprecated. get index type from string
`org.apache.hadoop.mapreduce.InputFormat` `getInputFormat()` Deprecated.
`int` `getLimit()` Deprecated.
`org.apache.pig.data.Tuple` `getNext()` Deprecated. read next row
`org.apache.pig.data.Tuple` `getNextWide()` Deprecated. read wide row
`org.apache.hadoop.mapreduce.OutputFormat` `getOutputFormat()` Deprecated. output format
`java.lang.String[]` `getPartitionKeys(java.lang.String location, org.apache.hadoop.mapreduce.Job job)` Deprecated. return partition keys
`static java.util.Map<java.lang.String,java.lang.String>` `getQueryMap(java.lang.String query)` Deprecated. decompose the query to store the parameters in a map
`org.apache.pig.ResourceSchema` `getSchema(java.lang.String location, org.apache.hadoop.mapreduce.Job job)` Deprecated. define the schema
`org.apache.pig.ResourceStatistics` `getStatistics(java.lang.String location, org.apache.hadoop.mapreduce.Job job)` Deprecated.
`protected java.util.Map<java.nio.ByteBuffer,AbstractType>` `getValidatorMap(CfDef cfDef)` Deprecated. get the validators
`protected void` `initSchema(java.lang.String signature)` Deprecated. Methods to get the column family schema from Cassandra
`java.nio.ByteBuffer` `nullToBB()` Deprecated.
`protected java.nio.ByteBuffer` `objToBB(java.lang.Object o)` Deprecated. convert object to ByteBuffer
`protected AbstractType` `parseType(java.lang.String type)` Deprecated. parse the string to a cassandra data type
`void` `prepareToRead(org.apache.hadoop.mapreduce.RecordReader reader, org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit split)` Deprecated.
`void` `prepareToWrite(org.apache.hadoop.mapreduce.RecordWriter writer)` Deprecated. prepare writer
`void` `putNext(org.apache.pig.data.Tuple t)` Deprecated. write next row
`java.lang.String` `relToAbsPathForStoreLocation(java.lang.String location, org.apache.hadoop.fs.Path curDir)` Deprecated.
`protected void` `setConnectionInformation()` Deprecated. set hadoop cassandra connection settings
`void` `setLocation(java.lang.String location, org.apache.hadoop.mapreduce.Job job)` Deprecated. set read configuration settings
`void` `setPartitionFilter(org.apache.pig.Expression partitionFilter)` Deprecated. set partition filter
`void` `setStoreFuncUDFContextSignature(java.lang.String signature)` Deprecated. StoreFunc methods
`void` `setStoreLocation(java.lang.String location, org.apache.hadoop.mapreduce.Job job)` Deprecated. set store configuration settings

### Methods inherited from class org.apache.pig.LoadFunc

`getAbsolutePath, getLoadCaster, getPathStrings, join, relativeToAbsolutePath, setUDFContextSignature, warn`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### PIG_ALLOW_DELETES

    public static final java.lang.String PIG_ALLOW_DELETES

Deprecated.

See Also:
  Constant Field Values

#### PIG_WIDEROW_INPUT

    public static final java.lang.String PIG_WIDEROW_INPUT

Deprecated.

See Also:
  Constant Field Values

#### PIG_USE_SECONDARY

    public static final java.lang.String PIG_USE_SECONDARY

Deprecated.

See Also:
  Constant Field Values

#### DEFAULT_INPUT_FORMAT

    protected java.lang.String DEFAULT_INPUT_FORMAT

Deprecated.

#### DEFAULT_OUTPUT_FORMAT

    protected java.lang.String DEFAULT_OUTPUT_FORMAT

Deprecated.

#### username

    protected java.lang.String username

Deprecated.

#### password

    protected java.lang.String password

Deprecated.

#### keyspace

    protected java.lang.String keyspace

Deprecated.

#### column_family

    protected java.lang.String column_family

Deprecated.

#### loadSignature

    protected java.lang.String loadSignature

Deprecated.

#### storeSignature

    protected java.lang.String storeSignature

Deprecated.

#### conf

    protected org.apache.hadoop.conf.Configuration conf

Deprecated.

#### inputFormatClass

    protected java.lang.String inputFormatClass

Deprecated.

#### outputFormatClass

    protected java.lang.String outputFormatClass

Deprecated.

#### splitSize

    protected int splitSize

Deprecated.

#### partitionerClass

    protected java.lang.String partitionerClass

Deprecated.

#### usePartitionFilter

    protected boolean usePartitionFilter

Deprecated.

#### initHostAddress

    protected java.lang.String initHostAddress

Deprecated.

#### rpcPort

    protected java.lang.String rpcPort

Deprecated.

#### nativeProtocolVersion

    protected int nativeProtocolVersion

Deprecated.

### Constructor Detail

#### CassandraStorage

    public CassandraStorage()

Deprecated.

#### CassandraStorage

    public CassandraStorage(int limit)

Deprecated.

Parameters:
  `limit` - number of columns to fetch in a slice

### Method Detail

#### getLimit

    public int getLimit()

Deprecated.

#### prepareToRead

    public void prepareToRead(org.apache.hadoop.mapreduce.RecordReader reader,
                              org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit split)

Deprecated.

Specified by:
  `prepareToRead` in class `org.apache.pig.LoadFunc`

#### getNextWide

    public org.apache.pig.data.Tuple getNextWide()
                                          throws java.io.IOException

Deprecated.
read wide row

Throws:
  `java.io.IOException`

#### getNext

    public org.apache.pig.data.Tuple getNext()
                                      throws java.io.IOException

Deprecated.
read next row

Specified by:
  `getNext` in class `org.apache.pig.LoadFunc`
Throws:
  `java.io.IOException`

#### putNext

    public void putNext(org.apache.pig.data.Tuple t)
                 throws java.io.IOException

Deprecated.
write next row

Specified by:
  `putNext` in interface `org.apache.pig.StoreFuncInterface`
Throws:
  `java.io.IOException`

#### setConnectionInformation

    protected void setConnectionInformation()
                                     throws java.io.IOException

Deprecated.
set hadoop cassandra connection settings

Throws:
  `java.io.IOException`

#### getFullyQualifiedClassName

    protected java.lang.String getFullyQualifiedClassName(java.lang.String classname)

Deprecated.
get the full class name

#### setLocation

    public void setLocation(java.lang.String location,
                            org.apache.hadoop.mapreduce.Job job)
                     throws java.io.IOException

Deprecated.
set read configuration settings

Specified by:
  `setLocation` in class `org.apache.pig.LoadFunc`
Throws:
  `java.io.IOException`

#### setStoreLocation

    public void setStoreLocation(java.lang.String location,
                                 org.apache.hadoop.mapreduce.Job job)
                          throws java.io.IOException

Deprecated.
set store configuration settings

Specified by:
  `setStoreLocation` in interface `org.apache.pig.StoreFuncInterface`
Throws:
  `java.io.IOException`

#### initSchema

    protected void initSchema(java.lang.String signature)
                       throws java.io.IOException

Deprecated.
Methods to get the column family schema from Cassandra

Throws:
  `java.io.IOException`

#### checkSchema

    public void checkSchema(org.apache.pig.ResourceSchema schema)
                     throws java.io.IOException

Deprecated.

Specified by:
  `checkSchema` in interface `org.apache.pig.StoreFuncInterface`
Throws:
  `java.io.IOException`

#### getSchema

    public org.apache.pig.ResourceSchema getSchema(java.lang.String location,
                                                   org.apache.hadoop.mapreduce.Job job)
                                            throws java.io.IOException

Deprecated.
define the schema

Specified by:
  `getSchema` in interface `org.apache.pig.LoadMetadata`
Throws:
  `java.io.IOException`

#### setPartitionFilter

    public void setPartitionFilter(org.apache.pig.Expression partitionFilter)
                            throws java.io.IOException

Deprecated.
set partition filter

Specified by:
  `setPartitionFilter` in interface `org.apache.pig.LoadMetadata`
Throws:
  `java.io.IOException`

#### prepareToWrite

    public void prepareToWrite(org.apache.hadoop.mapreduce.RecordWriter writer)

Deprecated.
prepare writer

Specified by:
  `prepareToWrite` in interface `org.apache.pig.StoreFuncInterface`

#### objToBB

    protected java.nio.ByteBuffer objToBB(java.lang.Object o)

Deprecated.
convert object to ByteBuffer

#### getIndexes

    protected java.util.List<ColumnDef> getIndexes()
                                            throws java.io.IOException

Deprecated.
get a list of columns with defined index

Throws:
  `java.io.IOException`

#### getStatistics

    public org.apache.pig.ResourceStatistics getStatistics(java.lang.String location,
                                                           org.apache.hadoop.mapreduce.Job job)

Deprecated.

Specified by:
  `getStatistics` in interface `org.apache.pig.LoadMetadata`

#### cleanupOnFailure

    public void cleanupOnFailure(java.lang.String failure,
                                 org.apache.hadoop.mapreduce.Job job)

Deprecated.

Specified by:
  `cleanupOnFailure` in interface `org.apache.pig.StoreFuncInterface`

#### cleanupOnSuccess

    public void cleanupOnSuccess(java.lang.String location,
                                 org.apache.hadoop.mapreduce.Job job)
                          throws java.io.IOException

Deprecated.

Specified by:
  `cleanupOnSuccess` in interface `org.apache.pig.StoreFuncInterface`
Throws:
  `java.io.IOException`

#### setStoreFuncUDFContextSignature

    public void setStoreFuncUDFContextSignature(java.lang.String signature)

Deprecated.
StoreFunc methods

Specified by:
  `setStoreFuncUDFContextSignature` in interface `org.apache.pig.StoreFuncInterface`

#### relToAbsPathForStoreLocation

    public java.lang.String relToAbsPathForStoreLocation(java.lang.String location,
                                                         org.apache.hadoop.fs.Path curDir)
                                                  throws java.io.IOException

Deprecated.

Specified by:
  `relToAbsPathForStoreLocation` in interface `org.apache.pig.StoreFuncInterface`
Throws:
  `java.io.IOException`

#### getOutputFormat

    public org.apache.hadoop.mapreduce.OutputFormat getOutputFormat()
                                                             throws java.io.IOException

Deprecated.
output format

Specified by:
  `getOutputFormat` in interface `org.apache.pig.StoreFuncInterface`
Throws:
  `java.io.IOException`

#### getInputFormat

    public org.apache.hadoop.mapreduce.InputFormat getInputFormat()
                                                           throws java.io.IOException

Deprecated.

Specified by:
  `getInputFormat` in class `org.apache.pig.LoadFunc`
Throws:
  `java.io.IOException`

#### getColumnMetadata

    protected java.util.List<ColumnDef> getColumnMetadata(Cassandra.Client client)
                                                   throws org.apache.thrift.TException,
                                                          java.nio.charset.CharacterCodingException,
                                                          InvalidRequestException,
                                                          ConfigurationException

Deprecated.
get a list of column for the column family

Throws:
  `org.apache.thrift.TException`
  `java.nio.charset.CharacterCodingException`
  `InvalidRequestException`
  `ConfigurationException`

#### getColumnMeta

    protected java.util.List<ColumnDef> getColumnMeta(Cassandra.Client client,
                                                      boolean cassandraStorage,
                                                      boolean includeCompactValueColumn)
                                               throws InvalidRequestException,
                                                      UnavailableException,
                                                      TimedOutException,
                                                      SchemaDisagreementException,
                                                      org.apache.thrift.TException,
                                                      java.nio.charset.CharacterCodingException,
                                                      InvalidRequestException,
                                                      ConfigurationException,
                                                      NotFoundException

Deprecated.
get column meta data

Throws:
  `InvalidRequestException`
  `UnavailableException`
  `TimedOutException`
  `SchemaDisagreementException`
  `org.apache.thrift.TException`
  `java.nio.charset.CharacterCodingException`
  `ConfigurationException`
  `NotFoundException`

#### getCFMetaData

    protected CFMetaData getCFMetaData(java.lang.String ks,
                                       java.lang.String cf,
                                       Cassandra.Client client)
                                throws NotFoundException,
                                       InvalidRequestException,
                                       org.apache.thrift.TException,
                                       InvalidRequestException,
                                       ConfigurationException

Deprecated.
get CFMetaData of a column family

Throws:
  `NotFoundException`
  `InvalidRequestException`
  `org.apache.thrift.TException`
  `ConfigurationException`

#### getIndexType

    protected IndexType getIndexType(java.lang.String type)

Deprecated.
get index type from string

#### getPartitionKeys

    public java.lang.String[] getPartitionKeys(java.lang.String location,
                                               org.apache.hadoop.mapreduce.Job job)
                                        throws java.io.IOException

Deprecated.
return partition keys

Specified by:
  `getPartitionKeys` in interface `org.apache.pig.LoadMetadata`
Throws:
  `java.io.IOException`

#### composeComposite

    protected org.apache.pig.data.Tuple composeComposite(AbstractCompositeType comparator,
                                                         java.nio.ByteBuffer name)
                                                  throws java.io.IOException

Deprecated.
Deconstructs a composite type to a Tuple.

Throws:
  `java.io.IOException`

#### getQueryMap

    public static java.util.Map<java.lang.String,java.lang.String> getQueryMap(java.lang.String query)
                                                                        throws java.io.UnsupportedEncodingException

Deprecated.
decompose the query to store the parameters in a map

Throws:
  `java.io.UnsupportedEncodingException`

#### nullToBB

    public java.nio.ByteBuffer nullToBB()

Deprecated.

#### getCfDef

    protected CfDef getCfDef(Cassandra.Client client)
                      throws InvalidRequestException,
                             UnavailableException,
                             TimedOutException,
                             SchemaDisagreementException,
                             org.apache.thrift.TException,
                             NotFoundException,
                             InvalidRequestException,
                             ConfigurationException,
                             java.io.IOException

Deprecated.
return the CfInfo for the column family

Throws:
  `InvalidRequestException`
  `UnavailableException`
  `TimedOutException`
  `SchemaDisagreementException`
  `org.apache.thrift.TException`
  `NotFoundException`
  `ConfigurationException`
  `java.io.IOException`

#### getCfDef

    protected CfDef getCfDef(java.lang.String signature)
                      throws java.io.IOException

Deprecated.
get the columnfamily definition for the signature

Throws:
  `java.io.IOException`

#### cfdefFromString

    protected static CfDef cfdefFromString(java.lang.String st)
                                    throws java.io.IOException

Deprecated.
convert string back to CfDef

Throws:
  `java.io.IOException`

#### cfdefToString

    protected static java.lang.String cfdefToString(CfDef cfDef)
                                             throws java.io.IOException

Deprecated.
convert CfDef to string

Throws:
  `java.io.IOException`

#### parseType

    protected AbstractType parseType(java.lang.String type)
                              throws java.io.IOException

Deprecated.
parse the string to a cassandra data type

Throws:
  `java.io.IOException`

#### columnToTuple

    protected org.apache.pig.data.Tuple columnToTuple(ColumnFamilyRecordReader.Column column,
                                                      CfDef cfDef,
                                                      AbstractType comparator)
                                               throws java.io.IOException

Deprecated.
convert a column to a tuple

Throws:
  `java.io.IOException`

#### getDefaultMarshallers

    protected java.util.Map<CassandraStorage.MarshallerType,AbstractType> getDefaultMarshallers(CfDef cfDef)
                                                                                         throws java.io.IOException

Deprecated.
construct a map to store the mashaller type to cassandra data type mapping

Throws:
  `java.io.IOException`

#### getValidatorMap

    protected java.util.Map<java.nio.ByteBuffer,AbstractType> getValidatorMap(CfDef cfDef)
                                                                       throws java.io.IOException

Deprecated.
get the validators

Throws:
  `java.io.IOException`