Database Reference
In-Depth Information
// Create a slice predicate
SlicePredicate slicePredicate = new
SlicePredicate();
slicePredicate.setSlice_range(new
SliceRange(ByteBufferUtil.EMPTY_BYTE_BUFFER,
ByteBufferUtil.EMPTY_BYTE_BUFFER, false,
Integer.MAX_VALUE));
// Prepare index expression.
IndexExpression ixpr = new
IndexExpression();ixpr.setColumn_name(ByteBufferUtil.bytes(COLUMN_NAME));
ixpr.setOp(IndexOperator.EQ);
ixpr.setValue(ByteBufferUtil.bytes(otherArgs.length
> 0 && !StringUtils.isBlank(otherArgs[0])?
otherArgs[0]: "mevivs"));
List<IndexExpression> ixpressions = new
ArrayList<IndexExpression>();
ixpressions.add(ixpr);
ConfigHelper.setInputRange(job.getConfiguration(),
ixpressions);
ConfigHelper.setInputSlicePredicate(job.getConfiguration(),
slicePredicate);
6.
Next, we need to configure the MapReduce job for the output family
and format configuration:
// Cassandra output family configuration.
ConfigHelper.setOutputRpcPort(job.getConfiguration(),
"9160");
ConfigHelper.setOutputInitialAddress(job.getConfiguration(),
"localhost");
ConfigHelper.setOutputPartitioner(job.getConfiguration(),
"Murmur3Partitioner");
ConfigHelper.setOutputColumnFamily(job.getConfiguration(),
KEYSPACE_NAME, OUTPUT_COLUMN_FAMILY);
Search WWH ::




Custom Search