MCPcopy Create free account
hub / github.com/WinVector/Logistic / DefReducer

Class DefReducer

src/com/winvector/logistic/mr/MapRedScan.java:76–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 public static final class DefReducer extends Reducer<LongWritable,WritableVariableList,LongWritable,WritableVariableList> {
77 @Override
78 public void reduce(final LongWritable key, final Iterable<WritableVariableList> values, final Context context) throws IOException, InterruptedException {
79 WritableVariableList r = null;
80 for(final WritableVariableList vi: values) {
81 if(r==null) {
82 r = WritableVariableList.copy(vi);
83 } else {
84 r.mergeVariableDefs(vi);
85 }
86 }
87 if(r!=null) {
88 context.write(new LongWritable(0),r);
89 }
90 }
91 }
92
93
94 private static WritableVariableList ruDefStep(final String tmpPrefix, final Configuration mrConfig,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected