Ditutup

Consensus Server

Your task is to develop a consensus server, and ensure that the code you develop is correct. The consensus server will JeroMQ use the ZeroMQ open source messaging library, receive proposed consensus values using threads, process them, and return the decided value as a result.

You should create a new project using Maven. In order to use JeroMQ, you must include the following lines in the <dependencies> section of your [login to view URL] file:

<dependency>

<groupId>[login to view URL]</groupId>

<artifactId>jeromq</artifactId>

<version>0.5.2</version>

</dependency>

To run your project with external dependencies, you can use the following command line, where "[login to view URL]" is the name of your Java package, and "hwserver" is the name of the class you wish to execute.

mvn exec:java -Dexec.mainClass='[login to view URL]'

You should use the ZeroMQ framework to develop a multithreaded server. You may wish to consider the JeroMQ's multithreaded service code.

JeroMQ's multithreaded service code creates a "router" and a "dealer." The router binds to a TCP port, and waits for client messages. The dealer transfers received messages to "worker" threads.

Each worker thread should submit the value it received from a client, to a Consensus object. That consensus object should inherit from the abstract Consensus class. Note that there are several important differences between the Consensus class given here, and the one provided in your textbook. First, since there is no longer a 1:1 mapping between threads and calls to the decide method (a single thread might handle more than one call to decide() for different clients), each thread must provide a unique index of the client, when it calls the decide() method. Second, since the decide() method must function for an arbitrary number of threads, we now use a ConcurrentHashMap, instead of an array, for proposed.

import [login to view URL];

import java.util.concurrent.*;

abstract class Consensus {

protected ConcurrentHashMap<Integer,Object> proposed =

new ConcurrentHashMap<Integer,Object>();

public void propose(int threadIdx, Object value) {

[login to view URL]("propose Id: " + threadIdx);

[login to view URL](threadIdx, value);

}

abstract public Object decide(int threadIdx, Object val);

}

There are quite a few Consensus objects, and each has a Consensus number.

Consensus Number Object

1 reader/writer registers

2 test & set, swap, fetch & add, queue, stack

2n-2 n-register assignment

∞ memory-to-memory move and swap, queue with peek, compare & swap, sticky register

Some Consensus objects, such as stack, test & set, queue, and several others, have a corresponding data structure in Java. Others, such as sticky register, do not, and must be implemented separately. For example, sticky register can be implemented as follows.

Kemahiran: Java

Lihat lagi: consensus problem, list of consensus algorithms, flp impossibility, paxos algorithm, consensus protocols in distributed systems, raft consensus, consensus and agreement algorithms, consensus algorithm, server blinkyou dolls index, unique private proxy server, game server provide web templates, provide clients social networking services, nofeehostcom provide sql server, sql server 2000 2005 differences bcp, provide clients html files constant contact, provide username password server, article unique articles provide, graphic design logo dimension pixels provide clients, install wordpress server load index php, linux index server project

Tentang Majikan:
( 0 ulasan ) Minneapolis, United States

ID Projek: #26503283

4 pekerja bebas membida secara purata $124 untuk pekerjaan ini

tumakha

Hello, I am very interested in your project. I have 15 years of experience with Java/Scala technologies. You can see my code examples on GitHub [login to view URL] I can start work immediately. Let's start a cha Lagi

$250 USD dalam 7 hari
(21 Ulasan)
5.9
maadirajudata

Hi Greetings from MDS! I would like to bid for this challenging opportunity . I have very good experience with core java and JMS/AMQP messaging systems . i understand your requirement and capable to implement all the Lagi

$125 USD dalam 5 hari
(11 Ulasan)
3.9
iiRayan321

Hello There, I'm a Java Developer and i have a +3 Years Experience and I'm Ready to work With you on this Project.

$30 USD dalam sehari
(0 Ulasan)
0.0
shrixty

I have experience with ZeroMQ and a lot of experience with various different consensus protocols. I would be able to do this in one day, providing you with clean code that would get you an A. I read all of the instruct Lagi

$90 USD dalam sehari
(0 Ulasan)
0.0