Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I got error:
- 15/01/05 12:57:19 INFO mapred.JobClient: Running job: job_local1115158155_0001
- 15/01/05 12:57:20 INFO mapred.LocalJobRunner: Waiting for map tasks
- 15/01/05 12:57:20 INFO mapred.LocalJobRunner: Starting task: attempt_local1115158155_0001_m_000000_0
- 15/01/05 12:57:20 INFO mapreduce.TableOutputFormat: Created table instance for rawCopy
- 15/01/05 12:57:20 INFO util.ProcessTree: setsid exited with exit code 0
- 15/01/05 12:57:20 INFO mapred.Task: Using ResourceCalculatorPlugin : org.apache.hadoop.util.LinuxResourceCalculatorPlugin@a2e890
- 15/01/05 12:57:20 INFO mapred.MapTask: Processing split: ans4175-PC:,
- 15/01/05 12:57:20 INFO mapred.MapTask: io.sort.mb = 100
- 15/01/05 12:57:20 INFO mapred.MapTask: data buffer = 79691776/99614720
- 15/01/05 12:57:20 INFO mapred.MapTask: record buffer = 262144/327680
- 15/01/05 12:57:20 INFO mapred.JobClient: map 0% reduce 0%
- 15/01/05 12:57:21 INFO mapred.MapTask: Starting flush of map output
- 15/01/05 12:57:21 INFO mapred.MapTask: Finished spill 0
- 15/01/05 12:57:21 INFO mapred.Task: Task:attempt_local1115158155_0001_m_000000_0 is done. And is in the process of commiting
- 15/01/05 12:57:21 INFO mapred.LocalJobRunner:
- 15/01/05 12:57:21 INFO mapred.Task: Task 'attempt_local1115158155_0001_m_000000_0' done.
- 15/01/05 12:57:21 INFO mapred.LocalJobRunner: Finishing task: attempt_local1115158155_0001_m_000000_0
- 15/01/05 12:57:21 INFO mapred.LocalJobRunner: Map task executor complete.
- 15/01/05 12:57:21 INFO mapreduce.TableOutputFormat: Created table instance for rawCopy
- 15/01/05 12:57:21 INFO mapred.Task: Using ResourceCalculatorPlugin : org.apache.hadoop.util.LinuxResourceCalculatorPlugin@39d718
- 15/01/05 12:57:21 INFO mapred.LocalJobRunner:
- 15/01/05 12:57:21 INFO mapred.Merger: Merging 1 sorted segments
- 15/01/05 12:57:21 INFO mapred.Merger: Down to the last merge-pass, with 1 segments left of total size: 1279220 bytes
- 15/01/05 12:57:21 INFO mapred.LocalJobRunner:
- 15/01/05 12:57:21 WARN mapred.FileOutputCommitter: Output path is null in cleanup
- 15/01/05 12:57:21 WARN mapred.LocalJobRunner: job_local1115158155_0001
- java.io.IOException: Pass a Delete or a Put
- at org.apache.hadoop.hbase.mapreduce.TableOutputFormat$TableRecordWriter.write(TableOutputFormat.java:125)
- at org.apache.hadoop.hbase.mapreduce.TableOutputFormat$TableRecordWriter.write(TableOutputFormat.java:84)
- at org.apache.hadoop.mapred.ReduceTask$NewTrackingRecordWriter.write(ReduceTask.java:586)
- at org.apache.hadoop.mapreduce.TaskInputOutputContext.write(TaskInputOutputContext.java:80)
- at org.apache.hadoop.mapreduce.Reducer.reduce(Reducer.java:156)
- at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:177)
- at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:649)
- at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:418)
- at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:398)
- 15/01/05 12:57:21 INFO mapred.JobClient: Job complete: job_local1115158155_0001
- 15/01/05 12:57:22 INFO mapred.JobClient: Counters: 19
- 15/01/05 12:57:22 INFO mapred.JobClient: File Input Format Counters
- 15/01/05 12:57:22 INFO mapred.JobClient: Bytes Read=0
- 15/01/05 12:57:22 INFO mapred.JobClient: FileSystemCounters
- 15/01/05 12:57:22 INFO mapred.JobClient: FILE_BYTES_READ=12384691
- 15/01/05 12:57:22 INFO mapred.JobClient: FILE_BYTES_WRITTEN=13838388
- 15/01/05 12:57:22 INFO mapred.JobClient: Map-Reduce Framework
- 15/01/05 12:57:22 INFO mapred.JobClient: Reduce input groups=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Map output materialized bytes=1279224
- 15/01/05 12:57:22 INFO mapred.JobClient: Combine output records=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Map input records=285
- 15/01/05 12:57:22 INFO mapred.JobClient: Reduce shuffle bytes=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Physical memory (bytes) snapshot=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Reduce output records=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Spilled Records=285
- 15/01/05 12:57:22 INFO mapred.JobClient: Map output bytes=1278078
- 15/01/05 12:57:22 INFO mapred.JobClient: Total committed heap usage (bytes)=1029046272
- 15/01/05 12:57:22 INFO mapred.JobClient: CPU time spent (ms)=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Virtual memory (bytes) snapshot=0
- 15/01/05 12:57:22 INFO mapred.JobClient: SPLIT_RAW_BYTES=77
- 15/01/05 12:57:22 INFO mapred.JobClient: Map output records=285
- 15/01/05 12:57:22 INFO mapred.JobClient: Combine input records=0
- 15/01/05 12:57:22 INFO mapred.JobClient: Reduce input records=0
- [error] (run-main-0) java.io.IOException: error within job!
- java.io.IOException: error within job!
- at com.example.Hello$.main(Hello.scala:128)
- at com.example.Hello.main(Hello.scala)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:601)
- [trace] Stack trace suppressed: run last compile:run for the full output.
- from code:
- package com.example
- import org.apache.hadoop.hbase.HBaseConfiguration
- import org.apache.hadoop.hbase.client.HBaseAdmin
- import org.apache.hadoop.hbase.client.HTable
- import org.apache.hadoop.hbase.util.Bytes
- import org.apache.hadoop.hbase.client.Put
- import org.apache.hadoop.hbase.client.Get
- import java.io.IOException
- import org.apache.hadoop.conf.Configuration
- import org.apache.hadoop.hbase._
- import org.apache.hadoop.hbase.client._
- import org.apache.hadoop.hbase.io._
- import org.apache.hadoop.hbase.mapreduce._
- import org.apache.hadoop.io._
- import org.apache.hadoop.mapreduce._
- import scala.collection.JavaConversions._
- import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat
- case class HString(name: String) {
- lazy val bytes = name.getBytes
- override def toString = name
- }
- object HString {
- import scala.language.implicitConversions
- implicit def hstring2String(src: HString): String = src.name
- implicit def hstring2Bytes(src: HString): Array[Byte] = src.bytes
- }
- object Families {
- val stream = HString("stream")
- val identity = HString("identity")
- }
- object Qualifiers {
- val title = HString("title")
- val url = HString("url")
- val media = HString("media")
- val media_source = HString("media_source")
- val content = HString("content")
- val nolimitid_timestamp = HString("nolimitid.timestamp")
- val original_id = HString("original_id")
- val timestamp = HString("timestamp")
- val date_created = HString("date_created")
- val count = HString("count")
- }
- object Tables {
- val rawstream100 = HString("raw_stream_1.0.0")
- val rawstream = HString("rawCopy")
- }
- class tmapper extends TableMapper[Text, Put]{
- def map (row: ImmutableBytesWritable, value: Result, context: Context) {
- val put = new Put(row.get())
- val key = Bytes.toString(row.get());
- for (kv <- value.raw()) {
- put.add(kv)
- }
- context.write(new Text(key), put)
- }
- }
- class treducer extends TableReducer[Text, Put, Put]{
- def reduce (row: Text, values: Put, context:Context){
- context.write(values, values);
- }
- }
- object Hello {
- val hbaseMaster = "127.0.0.1:60000"
- val hbaseZookeper = "127.0.0.1"
- def main(args: Array[String]): Unit = {
- val conf = HBaseConfiguration.create()
- conf.set("hbase.master", hbaseMaster)
- conf.set("hbase.zookeeper.quorum", hbaseZookeper)
- val hbaseAdmin = new HBaseAdmin(conf)
- val scan = new Scan()
- scan.setCaching(500) // 1 is the default in Scan, which will be bad for MapReduce jobs
- scan.setCacheBlocks(false) // don't set to true for MR jobs
- val job = new Job(conf)
- job.setJobName("CopyTable");
- job.setJarByClass(classOf[Hello])
- TableMapReduceUtil.initTableMapperJob(
- Tables.rawstream100.name, // input HBase table name
- scan, // Scan instance to control CF and attribute selection
- classOf[tmapper], // mapper class
- classOf[ImmutableBytesWritable], // mapper output key class
- classOf[Result], // mapper output value class
- job
- )
- job.setMapperClass(classOf[tmapper])
- job.setMapOutputKeyClass(classOf[ImmutableBytesWritable])
- job.setMapOutputValueClass(classOf[Result])
- TableMapReduceUtil.initTableReducerJob(
- Tables.rawstream.name, // Table name
- classOf[treducer], // Reducer class
- job
- )
- job.setReducerClass(classOf[treducer]);
- job.setNumReduceTasks(1);
- job.setOutputFormatClass(classOf[TableOutputFormat[Unit]]);
- job.getConfiguration().set(TableOutputFormat.OUTPUT_TABLE, Tables.rawstream);
- val b = job.waitForCompletion(true);
- if (!b) {
- throw new IOException("error within job!");
- }
- }
- }
- class Hello {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement