Professional Documents
Culture Documents
class Roll No
racHcal No
Name aE PeHtalNauigatting in Hadaop enuiranmel
Smae
1 versian
Command Name Versim
(om man USage Verslam_
example
hadoo p versim
DesconpHim Shouws the vesim af hadbop installed
mkdi
Command Namemkd
Command Usage mkdiy Kpah
example hd fs d£s-mkslirDser ldalaflair ldir L
Desciphm Iha (ommand akes the <path as anqrqumeat
and Ctae the decfay
3 1
Command Name Is
Command Usage
els
ls<path
example hdfs-dfs-1sluserdabaalr
DescompHm. This Command displayS the Cantalotof
the drechyspecified by Path>. It shows. the
Namepemiasiam_Oune SDe 4 moditratisn daka of
each enhy
Secmd example hdEs ds-Is-Roser
DescmpHm Thus Cammand behal/es 1}ke s bot displays
eies in all the Sub-dectenies yecOYs ely
LPuk
Command Namepot
Commadd Usaaeput lacalsrcyKdest2
example hdEs dfs-pothome Sample.txE/usecldutarfeidh
DesamphHm Thu's Command Copies the l e inthe local fesyst
tothe Hle lo D£S
6get
Command Nlame:qek
Command Usas ege STC <localdes+2
eXxample- hdfs dfs -qetluserldateLlairldlhome
pescoipim This Hadeop shell Cammand Copies the eleln HDES
identlEtea by <Src) to Aile In_local Hle systemiden-lEled
by<lotaldesE>
2nd ekampele hdfs dEs-4elmeng e luserJdalacla-ldirl| Sample.Lkt
uSerldaa £lareldor 2 Sample +xt lhomeSampleLtkt
DescmpHio: Thik HDfS Commane reeucs all eiles inthe
SoUNCe path entemtd by the User lo HDES And merges
them into one single file Coceated nthe loca file
Systemidentiled by local destioatiom.
3d ekample hadoor fs-getfacll userldada flair|dirl
kample. hadoap fs-9elacl-Rlusealdaka£larr ldr_
pescmpHm-Thi_éaede Hadoop (ommand shows the HCess
Conhol lisks af le + Þmecharies
CpyD Loca
Command Name Copyto loCa
Compand Usage Copy TDLoCal ksre> <localdesb
eg hadE dfs-copy To Local loser ldakaplarldllhume
Desaiphia:lt Is slmilcr to gek Cammand.6nly the diE"-
is that io this the desinaHin_af _Copitd Hleshoalal
efeno loc fle
8 Cat
Command Name'Cat
Command saqe CatkHle-name
eg hdEs d£s-catloserldataElair ldir l1s ample-tx
DesThis Hadoap shell Command display he Comtenks of File
on CanSole oyStdut
m
Command Name'mv
Command usag e mV <Src <dest>
eg hadfs dEs-mv|user dalaElair dl|Sample-txeluser
Ldatallalr ldi
pes.cmipHan-Th's hadoop shell Command movosthe file fom
he speciLed Soure des jnaHam wthin HoES
ommand Name CP
Lommand Usagecpisre Kdest
eg had fs dEs-celuseaLdata flaLA Sample. #-ser
ldataflarldrL
Desi This hadoop Shell Command (opjes the fle adircay
mm Men SDUYe to dest Lo tho HDES
tauchCareoute a Nen file or Lpdaute its timestamp
Syntakitouch LopTLON- LEILEl
eq eale_empy Eles Called filel 4 ile2
Stouch Ale Ele
8 Cchange dîrecteny
Suntax cd LoFT loN]dÎirckaxy
eg Change wrklnq deckenntodr
$cd d
14 awk:
+ is a uey powen folioterpreted pybgrammins lanquage
ohich 3 speclaly designed fen tet_pacessing houg h
this we Can Serch COtmanlpolate fexe. tcan be
Used as q Eield ektachara baSiC Calculatar as a pate
mateher 4 E a louus fhe oser o Use Uomables n bmcm
funcHons
Vi at
Lo PUne mh
pR pimpn mb
3 03 sangli mb
awk'smnt 4-3 att
awk le'a-tx
SpliEing a line Into Helds
auk leh print 5L$4 at
TO findthe lengh of the longesline present in
the hle
ak 'iE (length/so)>max) mak- length ($o)? END
Map Pmqram
lmprjaa in loEXcepHiam
mg iava. Otil ShmnqTokeniner
impnt arg apache. hddoap. lo:intLontable
impa g apache- hddoop lo-longtwnkable
impat ng qpache-hadooP lo Text
mpart rq apache hadooP mapred MapRedure BaseL
imt a apache hadooe maPYtd mappec
mp rg apache hadoop maprd OuHputCollecken
Lmp Org-apache hadoap mapred Repcnter
public class oc-mapger extends Map RedureBase implements
maperk lonqlova ablejTextText Intonteahle
povate Hnal ShaHc Lnt mtahle one hew Intwntable
povate Text word =neo text(O
pLublic uold map(Langontabekey Text Vale,olp colleckor
Text InHumtahle>olp Repote reparter]thrmws
ToExcepHan 2 Shon TDkennerr tokennev neu Shina7bken/20
ine)
Lwhile (oken2eY hasmome Tokensc)S
wd Sek (tokenizer nexToken)_
olP Colltc (ud One)
Reduce fcng am
loptJaua.lo 1toExceptHam
imptJaua DHl Shong Tkenizenj
lmpm Cmg 9pache hadaopjo-lot mtable
impn Java DHil Lteaaler
Lmpn drg qpache hadaof la:1ekt
Impar- rgpache hadoap-mapred_mapReaduce Base
imp Yg 9pache hado0p mapyredO0tpuuE Collecta
Lmpn g-apache.hadoap-mapred Reduce
lmpn org qpache. hadoop mapyd Repate
eublicclass C-Reducenr extends map Redur ense plenat
Reducenr KTeXt, Lotunatable,Tekt,lntumtable >1
leublic uaid Yeduce (Tex- key Heratr TIntumtahle >Lalves
olp Colleckerr<TekE latumkable?dlP, Repatey ePeater
fonus ToExtepHom
iot SomE0/
Lohile Values .has Nex+ O)2
Somt= Values hext).get O
Is
6E
PYOCessi1g
Staraq e
todl
untE
Name
clasS Roll No
PYachcal No:
Name af PYrathicalmee.menhaHm df Mahaut in Hadoop
Envimen
example progranm
impac ava lo LLle
mp JavqUHl: List.
impn Org apathe. mahoukCE tashe impl. madel
m.ad eil
eleAlepae
Imgot arg apache. Mahout.CE taste. impl
Ther shald 0See Aleihbohaod neighbaxhoo.d
mpax rq apache.
maboutcftasFe: reCommenderr USer
Nighbahonl
impa Oxg apache mahouE cf+aste
Siamilaty USersimkns
public class Recommender2
public Static Void maia CSing argsLI13
hy
Daamalel datamodel-new fle Daa mod el(new GleldaleD
LIS.erSimllanay Usersimilnty Deuw peasan ComekHan Simiatdddhonas
Usersimlny Usexnêighbeed-ntu ThershaH OSer Neighkorhaod
(3.0Usersimilerty Ldatamade.
use-Bas ed Recammender reco.mmender she genemc dser
Bcsed Recom.mender (dalamod el usexheghbarhood, useasimtliat
sKRecom.mended ltem> retomm.endaHms=
remmender Ycro mmed CR3)_
far Recommendedlfem ecommendaHm etommed ahin
Sysem Qut ponbln (YeCommendahm