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

Class LevReducer

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

Source from the content-addressed store, hash-verified

171 }
172
173 public static final class LevReducer extends Reducer<LongWritable,WritableVariableList,LongWritable,WritableVariableList> {
174 @Override
175 public void reduce(final LongWritable key, final Iterable<WritableVariableList> values, final Context context) throws IOException, InterruptedException {
176 WritableVariableList r = null;
177 for(final WritableVariableList vi: values) {
178 if(r==null) {
179 r = WritableVariableList.copy(vi);
180 } else {
181 r.mergeVariableLevels(vi);
182 }
183 }
184 if(r!=null) {
185 context.write(new LongWritable(0),r);
186 }
187 }
188 }
189
190
191 private static WritableVariableList ruLevelStep(final String tmpPrefix, final Configuration mrConfig,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected