- Programming MapReduce with Scalding
- Antonios Chalkiopoulos
- 223字
- 2021-12-08 12:44:20
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows: "A Map class to map lines into <key,value>
pairs; for example, <"INFO",1>
."
A block of code is set as follows:
LogLine = load 'file.logs' as (level, message); LevelGroup = group LogLine by level; Result = foreach LevelGroup generate group, COUNT(LogLine); store Result into 'Results.txt';
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
import com.twitter.scalding._
class CalculateDailyAdPoints (args: Args) extends Job(args) {
val logSchema = List ('datetime, 'user, 'activity, 'data,
'session, 'location, 'response, 'device, 'error, 'server)
val logs = Tsv("/log-files/2014/07/01", logSchema )
.read
.project('user,'datetime,'activity,'data)
.groupBy('user) { group => group.sortBy('datetime) }
.write(Tsv("/analysis/log-files-2014-07-01"))
}
Any command-line input or output is written as follows:
$ echo "This is a happy day. A day to remember" > input.txt $ hadoop fs -mkdir -p hdfs:///data/input hdfs:///data/output $ hadoop fs -put input.txt hdfs:///data/input/
New terms and important words are shown in bold.
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
推薦閱讀
- 從零開始:數字圖像處理的編程基礎與應用
- 自己動手寫Java虛擬機
- Clojure for Domain:specific Languages
- Learning Firefox OS Application Development
- 自制編程語言
- Expert Data Visualization
- Cybersecurity Attacks:Red Team Strategies
- 深入剖析Java虛擬機:源碼剖析與實例詳解(基礎卷)
- 21天學通C++(第5版)
- Hands-On Kubernetes on Windows
- Python商務數據分析(微課版)
- 實戰Python網絡爬蟲
- Python 3快速入門與實戰
- XML程序設計(第二版)
- Learning Shiny