Find Jobs
Hire Freelancers

Analyze some Data

₹600-1500 INR

Cancelled
Posted almost 7 years ago

₹600-1500 INR

Paid on delivery
1. Write a Java program to simulate a distributed printer queue using ZooKeeper. You will be writing two programs the PrinterMaster and PrinterClient. Use Znodes to represent printer queue. Specifications for these components are given below. Your program should handle all invalid arguments a PrinterMaster Specifications: • Whenever the Master is invoked it should connect to one of the ZooKeeper quora as a client. • Master should create Znode to represent the printer queue. • This program should run indefinitely until you type exit on the console. • Your master should process the print job with least job id. We do not actually use a physical printer here, so just print on the console that a print job with a given id has been processed. Display the contents (data) of the Znode representing the job on the console as well. • After your master processes the job it should remove the Znode representing the print job. • After processing every print job your master should wait for a time period called “cool-off period”. This should be passed as an argument when you start your master. PrinterClient Specifications: • Whenever the client is invoked it should connect to one of the ZooKeeper quora as a client. • This program should be invoked by passing a string as argument. We will call this argument as “data”. • If the client has been started before the master it should throw an error with appropriate error message and exit. • If the master hasn’t created the Znode representing the printer queue, the client should throw an appropriate error message and exit. • If both the conditions mentioned above are not true then your client has to create a Znode under the queue. You should pass the name of the Znode representing the queue as an argument to the client. • This Znode should be ordered automatically and be deleted when the client terminates its connection. Use an appropriate Znode type to model this behavior. • Data for the Znode created should be the “data” argument passed when the client was invoked. • After creating the Znode and assigning content to it, the client has to create a watch for the event “NodeDeleted” on the Znode created by this client. • Once the watch is triggered, the client should display a message “Your print job is processed. Check the printer” and terminate. • If the Znode created still exist even after a period of time called “timeout period” the client should print an error message, “Master must be swamped/it should have failed. Please report this to the admin” and terminate. • Timeout period should also be passed as an argument to the client. Assign it to 10*cool-off period of the master.
Project ID: 13605256

About the project

1 proposal
Remote project
Active 7 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of INDIA
India
0.0
0
Member since Apr 3, 2017

Client Verification

Other jobs from this client

Write some Software
₹1500-12500 INR
Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.