我在尝试直接从地图写入 cassandra 时遇到以下异常,跳过了 reduce 任务。
. . .
ConfigHelper.setOutputColumnFamily(job.getConfiguration(), KEYSPACE, outputPath);
job.setMapperClass(MapperToCassandra.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
LOG.info("Writing output to Cassandra");
//job.setReducerClass(ReducerToCassandra.class);
job.setOutputFormatClass(ColumnFamilyOutputFormat.class);
ConfigHelper.setRpcPort(job.getConfiguration(), "9160");
//org.apache.cassandra.dht.LocalPartitioner
ConfigHelper.setInitialAddress(job.getConfiguration(), "localhost");
ConfigHelper.setPartitioner(job.getConfiguration(), "org.apache.cassandra.dht.RandomPartitioner");
. . .
谁能帮我确定我错过了什么?
12/05/17 16:01:38 INFO mapred.JobClient: Task Id : attempt_201205141442_0042_m_000000_0, Status : FAILED
java.io.IOException: InvalidRequestException(why:unconfigured columnfamily output)
at org.apache.cassandra.hadoop.ColumnFamilyRecordWriter$RangeClient.run(ColumnFamilyRecordWriter.java:307)
Caused by: InvalidRequestException(why:unconfigured columnfamily output)
at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:19479)
at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:1035)
at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:1009)
at org.apache.cassandra.hadoop.ColumnFamilyRecordWriter$RangeClient.run(ColumnFamilyRecordWriter.java:299)