public class CqlBulkRecordWriter
extends org.apache.hadoop.mapreduce.RecordWriter<java.lang.Object,java.util.List<java.nio.ByteBuffer>>
implements org.apache.hadoop.mapred.RecordWriter<java.lang.Object,java.util.List<java.nio.ByteBuffer>>
CqlBulkRecordWriter
maps the output <key, value>
pairs to a Cassandra column family. In particular, it applies the binded variables
in the value to the prepared statement, which it associates with the key, and in
turn the responsible endpoint.
Furthermore, this writer groups the cql queries by the endpoint responsible for the rows being affected. This allows the cql queries to be executed in parallel, directly to a responsible endpoint.
CqlBulkOutputFormat
Modifier and Type | Class and Description |
---|---|
static class |
CqlBulkRecordWriter.ExternalClient |
static class |
CqlBulkRecordWriter.NullOutputHandler |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BUFFER_SIZE_IN_MB |
protected int |
bufferSize |
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.mapreduce.TaskAttemptContext |
context |
static java.lang.String |
IGNORE_HOSTS |
protected java.util.Set<java.net.InetAddress> |
ignores |
protected SSTableLoader |
loader |
static java.lang.String |
MAX_FAILED_HOSTS |
protected int |
maxFailures |
static java.lang.String |
OUTPUT_LOCATION |
protected org.apache.hadoop.util.Progressable |
progress |
static java.lang.String |
STREAM_THROTTLE_MBITS |
protected java.io.Closeable |
writer |
Modifier and Type | Method and Description |
---|---|
void |
close(org.apache.hadoop.mapred.Reporter reporter)
Deprecated.
|
void |
close(org.apache.hadoop.mapreduce.TaskAttemptContext context) |
protected java.lang.String |
getOutputLocation() |
void |
write(java.lang.Object key,
java.util.List<java.nio.ByteBuffer> values)
The column values must correspond to the order in which
they appear in the insert stored procedure.
|
public static final java.lang.String OUTPUT_LOCATION
public static final java.lang.String BUFFER_SIZE_IN_MB
public static final java.lang.String STREAM_THROTTLE_MBITS
public static final java.lang.String MAX_FAILED_HOSTS
public static final java.lang.String IGNORE_HOSTS
protected final org.apache.hadoop.conf.Configuration conf
protected final int maxFailures
protected final int bufferSize
protected java.io.Closeable writer
protected SSTableLoader loader
protected org.apache.hadoop.util.Progressable progress
protected org.apache.hadoop.mapreduce.TaskAttemptContext context
protected final java.util.Set<java.net.InetAddress> ignores
protected java.lang.String getOutputLocation() throws java.io.IOException
java.io.IOException
public void write(java.lang.Object key, java.util.List<java.nio.ByteBuffer> values) throws java.io.IOException
The column values must correspond to the order in which they appear in the insert stored procedure. Key is not used, so it can be null or any object.
write
in interface org.apache.hadoop.mapred.RecordWriter<java.lang.Object,java.util.List<java.nio.ByteBuffer>>
write
in class org.apache.hadoop.mapreduce.RecordWriter<java.lang.Object,java.util.List<java.nio.ByteBuffer>>
key
- any object or null.values
- the values to write.java.io.IOException
public void close(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws java.io.IOException, java.lang.InterruptedException
close
in class org.apache.hadoop.mapreduce.RecordWriter<java.lang.Object,java.util.List<java.nio.ByteBuffer>>
java.io.IOException
java.lang.InterruptedException
@Deprecated public void close(org.apache.hadoop.mapred.Reporter reporter) throws java.io.IOException
close
in interface org.apache.hadoop.mapred.RecordWriter<java.lang.Object,java.util.List<java.nio.ByteBuffer>>
java.io.IOException
Copyright © 2019 The Apache Software Foundation