source: proiecte/PDAD/trunk/nodeslocation/pig/local/nodeslocation.pig @ 154

Last change on this file since 154 was 154, checked in by (none), 14 years ago

PDAD project

File size: 1.1 KB
Line 
1-- This script processes number of faults per geographical location.
2
3-- author: cristina
4
5REGISTER locationconcat.jar;
6
7raw_event = LOAD '$inputDir/event_trace.tab' USING PigStorage('\t') AS (event_id,component_id,node_id:int,platform_id:int,node_name,event_type,event_start_time,event_stop_time,event_end_reason:chararray);
8raw_node = LOAD '/home/cristina/PPproj/repo/tests/node.tab' USING PigStorage('\t') AS (node_id:int,platform_id:int,node_name,node_ip,node_location,timezone,proc_model,os_name,cores_per_proc,num_procs,mem_size,disk_size, up_bw,down_bw,metric_id,notes);
9
10-- build durations
11event = FOREACH raw_event GENERATE Concat(node_id,platform_id) as id, 1 as value;
12node = FOREACH raw_node GENERATE Concat(node_id,platform_id) as id, node_location as location;
13--event = FOREACH raw_event GENERATE node_id as id, 1 as value;
14--node = FOREACH raw_node GENERATE node_id as id, node_location as location;
15joined = JOIN event by id, node by id;
16filtered = FOREACH joined GENERATE location, value;
17grouped = GROUP filtered by location;
18rez =  FOREACH grouped GENERATE group, SUM(filtered.value);
19
20STORE rez INTO 'nodeslocation.rez' USING PigStorage();
21
Note: See TracBrowser for help on using the repository browser.