sequential
play

{Sequential Code} {Sequential Code} {Sequential Code} - PowerPoint PPT Presentation

{Sequential Code} {Sequential Code} {Sequential Code} {Sequential Code} {Sequential Code} {MapReduce Code} for (int i=0; i < $in.size(); ++i) { if ($in.get(i) > $c) $out.add($in.get(i)); } for (int i=0; i <


  1. {Sequential Code}

  2. {Sequential Code}

  3. {Sequential Code}

  4. {Sequential Code}

  5. {Sequential Code} {MapReduce Code}

  6. • for (int i=0; i < $in.size(); ++i) { if ($in.get(i) > $c) $out.add($in.get(i)); }

  7. • for (int i=0; i < $in.size(); ++i) { if ($in.get(i) > $c) $out.union($in.filter(e -> e > $c)); $out.add($in.get(i)); }

  8. • for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  9. • for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  10. int sum = 0 ; int sum = 0 ; for (Integer val : data) { sum = data.map(val -> val*val) sum += val * val; .reduce((v1,v2) -> v1+v2); }

  11. λ 𝑛 𝑤 → 𝑤 ∗ 𝑤 𝜇 𝑠 𝑤 1 , 𝑤 2 → 𝑤 1 + 𝑤 2 𝑡𝑣𝑛 = 𝑠𝑓𝑒𝑣𝑑𝑓(𝑛𝑏𝑞(𝑒𝑏𝑢𝑏, 𝜇 𝑛 ), 𝜇 𝑠 ); int sum = 0 ; int sum = 0 ; for (Integer val : data) { sum = data.map(val -> val*val) sum += val * val; .reduce((v1,v2) -> v1+v2); }

  12. λ 𝑛 𝑤 → 𝑤 ∗ 𝑤 𝜇 𝑠 𝑤 1 , 𝑤 2 → 𝑤 1 + 𝑤 2 𝑡𝑣𝑛 = 𝑠𝑓𝑒𝑣𝑑𝑓(𝑛𝑏𝑞(𝑒𝑏𝑢𝑏, 𝜇 𝑛 ), 𝜇 𝑠 ); int sum = 0 ; int sum = 0 ; for (Integer val : data) { sum = data.map(val -> val*val) sum += val * val; .reduce((v1,v2) -> v1+v2); }

  13. λ 𝑛 𝑤 → 𝑤 ∗ 𝑤 𝜇 𝑠 𝑤 1 , 𝑤 2 → 𝑤 1 + 𝑤 2 𝑡𝑣𝑛 = 𝑠𝑓𝑒𝑣𝑑𝑓(𝑛𝑏𝑞(𝑒𝑏𝑢𝑏, 𝜇 𝑛 ), 𝜇 𝑠 ); int sum = 0 ; int sum = 0 ; for (Integer val : data) { sum = data.map(val -> val*val) sum += val * val; .reduce((v1,v2) -> v1+v2); }

  14. for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  15. for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  16. for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  17. for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  18. for ( int i=0; i<N; i++) { HashMap<String,Double> contrib = new HashMap<>(); for (Map.Entry<String,Double> r : ranks.entrySet()) { List<String> urls = grouped_links.get(r.getKey()); if (urls != null ) { int size = urls.size(); ≡ urls.forEach(dst -> { if (!contrib.containsKey(dst)) contrib.put(dst, 0.0); contrib.put(dst, contrib.get(dst) + (r.getValue() / size)); });}} for (String dst : contrib.keySet()) ranks.put(dst, contrib.get(dst) * 0.85 + 0.15); }

  19. • • • • •

  20. • • •

  21. • •

  22. • •

Recommend


More recommend