0
嘗試直接從映射寫入cassandra時,我會得到以下異常,從而跳過reduce任務。將數據寫入Cassandra Hadoop映射器(不減少)
。 。 。
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)