MCPcopy Create free account
hub / github.com/Qihoo360/poseidon / map

Method map

builder/docmeta/src/main/java/meta/DocMetaMapper.java:50–77  ·  view source on GitHub ↗
(LongWritable key, Text value, Mapper<LongWritable, Text, Text, Text>.Context context)

Source from the content-addressed store, hash-verified

48 }
49
50 @Override
51 protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, Text, Text>.Context context)
52 throws IOException, InterruptedException {
53
54
55 //System.err.println(value.toString());
56 String[] meta = value.toString().split("\t");
57 if (meta.length < 2) {
58 return;
59 }
60 if (firstkey_) {
61 firstkey_ = false;
62 context.write(new Text(filename_), new Text(meta[0]));
63 }
64 //System.err.println(meta[1]);
65 //byte[] rawPb = Base64.decodeBase64(meta[1]);
66 //proto.PoseidonIf.DocGzMeta gzmeta = proto.PoseidonIf.DocGzMeta.parseFrom(rawPb);
67 //System.err.println(gzmeta.toString());
68
69 String line = shortDay_ + meta[0] + "\t" + meta[1];
70 lines_ += line;
71 lines_ += "\n";
72 count_ += 1;
73 if (count_ >= 50) {
74 set();
75 }
76
77 }
78
79 private void set() {
80 MetaSetter metaSetter = new MetaSetter(metaUrl_);

Callers

nothing calls this directly

Calls 3

setMethod · 0.95
toStringMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected