Find Jobs
Hire Freelancers

Analyze some Data

₹600-1500 INR

Cancelado
Publicado há aproximadamente 7 anos

₹600-1500 INR

Pago na 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 do Projeto: 13605256

Sobre o projeto

1 proposta
Projeto remoto
Ativo há 7 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos

Sobre o cliente

Bandeira do(a) INDIA
India
0,0
0
Membro desde abr. 3, 2017

Verificação do Cliente

Outros trabalhos deste cliente

Write some Software
₹1500-12500 INR
Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos 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)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.