Find Jobs
Hire Freelancers

Analyze some Data

₹600-1500 INR

Cancelado
Publicado hace alrededor de 7 años

₹600-1500 INR

Pagado a la entrega
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.
ID del proyecto: 13605256

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 7 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos

Sobre este cliente

Bandera de INDIA
India
0,0
0
Miembro desde abr 3, 2017

Verificación del cliente

Otros trabajos de este cliente

Write some Software
₹1500-12500 INR
¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.