官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 玛纳斯县| 苏尼特右旗| 江达县| 颍上县| 铁岭县| 洪泽县| 冀州市| 景洪市| 桐柏县| 高尔夫| 九寨沟县| 泰和县| 青铜峡市| 枝江市| 峨山| 四子王旗| 湛江市| 富蕴县| 界首市| 马关县| 元朗区| 石首市| 夹江县| 霍城县| 交城县| 黎川县| 兴化市| 青冈县| 张家界市| 四川省| 彭阳县| 贵阳市| 东兰县| 罗甸县| 苏尼特左旗| 乌兰察布市| 建瓯市| 河北区| 班戈县| 新野县| 荃湾区|