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

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.

主站蜘蛛池模板: 浦江县| 江永县| 依安县| 南华县| 同心县| 扎囊县| 百色市| 阿克| 望谟县| 嘉义县| 穆棱市| 榆社县| 乾安县| 四平市| 宝清县| 阿克陶县| 沂南县| 叙永县| 高雄市| 沅江市| 阿拉善左旗| 友谊县| 惠来县| 建瓯市| 霍州市| 沅陵县| 凌海市| 剑河县| 武川县| 钟祥市| 盐池县| 锡林浩特市| 山丹县| 睢宁县| 长汀县| 自治县| 玉树县| 通许县| 兴安县| 普兰县| 旬邑县|