0% found this document useful (0 votes)
35 views

Client-Server Based File Processing Application: The Basic Flow of The Application Is The Same

The document describes a client-server application for processing flight data from a CSV file. The server loads the file, defines remote methods to calculate flight delays and cancellations by year. The client invokes these methods on the server and prints the results. The methods to be implemented in the fileProc class are loadFile to load the CSV, sum to calculate total delay by year, avg to calculate average delay by year, and count to calculate cancelled flights by year. The document also provides the field descriptions for the CSV data.

Uploaded by

Ram Guggul
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Client-Server Based File Processing Application: The Basic Flow of The Application Is The Same

The document describes a client-server application for processing flight data from a CSV file. The server loads the file, defines remote methods to calculate flight delays and cancellations by year. The client invokes these methods on the server and prints the results. The methods to be implemented in the fileProc class are loadFile to load the CSV, sum to calculate total delay by year, avg to calculate average delay by year, and count to calculate cancelled flights by year. The document also provides the field descriptions for the CSV data.

Uploaded by

Ram Guggul
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Client-Server based File Processing Application

Similar to the demo code that you have seen, In the practice problem you will be implementing a
simple client-server based data processing java application.

The basic flow of the application is the same-


1. The Server contains the dataset and defines a set of remote methods for file processing.
2. The Client invokes these remote methods on the dataset and receives the results from
the server and print them on the console.
Data
The data.csv file contains flights related data from an AirLine company of 5 years
2004-2008​. You can find the field description on the last page.

What you have to do?


1. You are provided with two file f​ileProcInterface.java ​and ​fileProc.java.
fileProcInterface.java defines 4 methods which fileProc.java implements. You need to
write code for these 4 methods.
The to be implemented are ​fileProc.java​ are -
​ oid​ ​loadFile​(String path)​ ​throws​ RemoteException {
public​ v
// takes the path of the as input
//reads the file and store the relevant records in the hash map.[in memory]
}

public​ ​int​[] sum() ​throws​ RemoteException {


// Delay = ArrDelay + DepDelay
// This method returns an array 5 elements, containing per year total delay. The 0th index
contains delay for the year 2004, the 1st index contains total delay for the year 2005 and so on.
}

​ nt​[] avg() ​throws​ RemoteException{


public​ i
//​ This methods returns an array 5 elements, containing per year average delay. The 0th index
contains average delay for the year 2004, the 1st index contains average delay for the year 2005 and so on.
}

​ nt​[] count() ​throws​ RemoteException{


public​ i
//​This method returns an array 5 elements, containing per year total cancelled flights. The 0th
index contains total cancelled flights for the year 2004, the 1st index contains total cancelled flights for
the year 2005 and so on.
}
2. Write code for the ​Server​ class, which binds the object of the ​fileProc​ class.
3. Write the ​Client ​class which looks up for the ​fileProc ​object, invokes the above four
methods and prints the output on the console.
Index Name Description
0 ID Unique fight ID
1 Year 2004-2008
2 Month 1-12
3 DayofMonth 1-31
4 DayOfWeek 1 (Monday) - 7 (Sunday)
5 DepTime Actual departure time (local, hhmm)
6 CRSDepTime Scheduled departure time (local, hhmm)
7 ArrTime Actual arrival time (local, hhmm)
8 CRSArrTime Scheduled arrival time (local, hhmm)
9 UniqueCarrier Unique carrier code
10 FlightNum Flight number
11 TailNum Plane tail number
12 ActualElapsedTime Time in minutes
13 CRSElapsedTime Time in minutes
14 AirTime Time in minutes
15 ArrDelay Arrival delay, in minutes
16 DepDelay Departure delay, in minutes
17 Origin Origin IATA airport code (International Air Transport Association)
18 Dest Destination IATA airport code

19 Distance In miles
Time taken from runway to the terminal after landing, excluding deceleration, in
20 TaxiIn minutes
Taxi taken from terminal to the runway before take-off, excluding acceleration,
21 TaxiOut in minutes
22 Cancelled Whether the flight was cancelled
23 CancellationCode Reason for cancellation (A = carrier, B = weather, C = NAS, D = security)
24 Diverted 1 = yes, 0 = no
25 CarrierDelay Time in minutes
26 WeatherDelay Time in minutes
27 NASDelay Time in minutes
28 SecurityDelay Time in minutes
29 LateAircraftDelay Time in minute

You might also like