return builder.build();
}
private MapReduceResult convertMapReduceResult(SenseiProtos.MapReduceResult protoMapReduceResult) {
MapReduceResult mapReduceResult = new MapReduceResult();
if (protoMapReduceResult.hasReduceResult()) {
Object reduceResult = javaDeserialize(protoMapReduceResult.getReduceResult());
if (reduceResult != null)
mapReduceResult.setReduceResult((Serializable) reduceResult);
}
if (protoMapReduceResult.getMapResultCount() > 0) {
List mapResults = new ArrayList();
for (ByteString protoMapResult : protoMapReduceResult.getMapResultList()) {
Object mapResult = javaDeserialize(protoMapResult);
if (mapResult != null)
mapResults.add(mapResult);
}
mapReduceResult.setMapResults(mapResults);
}
return mapReduceResult;
}