org.apache.cassandra.hadoop

## Class AbstractColumnFamilyRecordWriter<K,Y>

- java.lang.Object
- - org.apache.hadoop.mapreduce.RecordWriter<K,Y>
  - - org.apache.cassandra.hadoop.AbstractColumnFamilyRecordWriter<K,Y>

- All Implemented Interfaces:
    org.apache.hadoop.mapred.RecordWriter<K,Y>

      public abstract class AbstractColumnFamilyRecordWriter<K,Y>
      extends org.apache.hadoop.mapreduce.RecordWriter<K,Y>
      implements org.apache.hadoop.mapred.RecordWriter<K,Y>

  The `ColumnFamilyRecordWriter` maps the output <key, value> pairs to a Cassandra column family. In particular, it applies all mutations in the value, which it associates with the key, and in turn the responsible endpoint.

  Furthermore, this writer groups the mutations by the endpoint responsible for the rows being affected. This allows the mutations to be executed in parallel, directly to a responsible endpoint.

  See Also:
    `ColumnFamilyOutputFormat`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `AbstractColumnFamilyRecordWriter.AbstractRangeClient<K>` A client that runs in a threadpool and connects to the list of endpoints for a particular range.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `batchThreshold`
    `protected org.apache.hadoop.conf.Configuration` | `conf`
    `protected ConsistencyLevel` | `consistencyLevel`
    `protected Progressable` | `progressable`
    `protected int` | `queueSize`
    `protected RingCache` | `ringCache`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractColumnFamilyRecordWriter(org.apache.hadoop.conf.Configuration conf)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `close()`
    `void` | `close(org.apache.hadoop.mapred.Reporter reporter)` Deprecated.
    `void` | `close(org.apache.hadoop.mapreduce.TaskAttemptContext context)` Close this `RecordWriter` to future operations, but not before flushing out the batched mutations.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.RecordWriter

      `write`

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

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

    - ### Methods inherited from interface org.apache.hadoop.mapred.RecordWriter

      `write`

- - ### Field Detail

    - #### conf

          protected final org.apache.hadoop.conf.Configuration conf

    - #### ringCache

          protected final RingCache ringCache

    - #### queueSize

          protected final int queueSize

    - #### batchThreshold

          protected final long batchThreshold

    - #### consistencyLevel

          protected final ConsistencyLevel consistencyLevel

    - #### progressable

          protected Progressable progressable

  - ### Constructor Detail

    - #### AbstractColumnFamilyRecordWriter

          protected AbstractColumnFamilyRecordWriter(org.apache.hadoop.conf.Configuration conf)

  - ### Method Detail

    - #### close

          public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context)
                     throws java.io.IOException,
                            java.lang.InterruptedException

      Close this `RecordWriter` to future operations, but not before flushing out the batched mutations.
      Specified by:
        `close` in class `org.apache.hadoop.mapreduce.RecordWriter<K,Y>`
      Parameters:
        `context` - the context of the task
      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`

    - #### close

          @Deprecated
          public void close(org.apache.hadoop.mapred.Reporter reporter)
                     throws java.io.IOException

      Deprecated.
      Fills the deprecated RecordWriter interface for streaming.
      Specified by:
        `close` in interface `org.apache.hadoop.mapred.RecordWriter<K,Y>`
      Throws:
        `java.io.IOException`

    - #### close

          protected abstract void close()
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2014 The Apache Software Foundation