Pydoop. الترتيب والملخص
- رخصة:
- The Apache License 2.0
- اسم الناشر:
- Simone Leo, Gianluigi Zanetti and Luca Pireddu
Pydoop. العلامات
Pydoop. وصف
Pydoop هي Python Mapreduce و HDFS API ل Hadoop. بنيت كغلاف في API C ++، يسمح لك Pydoop بتطوير تطبيقات Map Reduce كاملة مع الوصول إلى HDFS. إليك الطريقة الكيفية لكتابة Python Basic Python Wordcount مع Pydoop: من Pydoop.pipes استيراد Mapper، المخفض، المصنع، RunTaskclass، WordCountMapper (Mapper): خريطة DAF (الذات، السياق): الكلمات = context.getinputvalue (). انقسام () في الكلمات: context.emit.IT (W، "1") من فئة WordCountreducer (المخفض): Def تقليل (الذات، السياق): S = 0 بينما Context.NextValue () سياق: S + = Int (Contentt.getInputValue ()). Emit (context.getinputkey ()، STR (S) RunTask (Factory (WordCountMapper، WordCountreducer)) أو، لمهام بسيطة مثل عد Word، يمكنك تجربة أداة Pydoop_Script. ثم يصبح الكود الخاص بك: def mapper (k، text، writer): for Word في Text.Split (): Writer.emit (Word، 1) Def Reducer (Word، العد، الكاتب): Writer.emit (Word، Sum (خريطة (int، عدد))) الصفحة الرئيسية للمنتج المنتج
Pydoop. برامج ذات صلة