Coder Social home page Coder Social logo

aosproject2's People

Contributors

nimishagupta03 avatar

Watchers

 avatar  avatar  avatar

aosproject2's Issues

Add communication blocking

To simulate the cuts in the graph, a blocking list needs to be implemented. Before sending a message to any node, its presence in the blocking list will be checked.

Create Network Discovery Protocol for servers

All the servers must be able to discover each other automatically. Each server must keep polling across the list of possible server addresses/portnumbers until it is connected to the required number of servers. After doing so, it will send a DISCOVERY_COMPLETE message to the other servers to inform that it is ready to server the client requests.

Universal Send message for client

All the message sending should be done via a common method so that the blocking list can be added at that point. This method will act as sort of a gateway. Related to #13

Send Message Method in server

In server, most of the message passing is done inline. All such calls must be replaced by a method, which sends the messages and returns a socket so that, blocking list can be added to this single point of communication. See #13

Code Cleanup

Clean up unnecessary code from the old version of the protocol.

Create Object API On server side Missing

A client performs following steps in order to create an object.

  1. Generates an object id.
  2. Finds out the server ids based on the hashing function.
  3. Send a SEEK_CREATE_PERMISSION to each of the servers.
  4. If it is not able to send the request to at least two servers, throw error.
  5. If the request was successfully sent, wait for the server's reply.

On the server side:

  1. If the server can allow the permission to create the object (it is not busy, which is not practically possible), it replies with the GRANT_CREATE_PERMISSION message.
  2. Else it replies with FAILED_CREATE_PERMISSION

On the client side, after receiving the replies from all the servers,

  1. If there are less than 2 GRANT messages, error is returned.
  2. Else for each server :
  3. If the reply is GRANT, the client serializes the account object.
  4. Next it creates the wrapper object with message type, CREATE_OBJ_REQ and sends to the server.
  5. else if the reply is FAILED, client skips this server.

Change the protocol

The initial protocol is not perfect. It fails during the concurrent writes.

The new protocol is based on the Google's File System

Add Data Access API

Add a Data Access API to access the objects.

Initially we planned to use the OpenCSV to store and parse the data. However, OpenCSV doesn't support updates on the files. The only way is to load all the contents into the memory, perform updates, clear the file and write them back to the file.

To achieve this, we can use GSON library since we are already using it to parse the Messages. This implementation is based on the GSON library, a slight change in the plan.

Create Obj API on client

A client performs following steps in order to create an object.

  1. Generates an object id.
  2. Finds out the server ids based on the hashing function.
  3. Send a SEEK_CREATE_PERMISSION to each of the servers.
  4. If it is not able to send the request to at least two servers, throw error.
  5. If the request was successfully sent, wait for the server's reply.

On the server side:

  1. If the server can allow the permission to create the object (it is not busy, which is not practically possible), it replies with the GRANT_CREATE_PERMISSION message.
  2. Else it replies with FAILED_CREATE_PERMISSION

On the client side, after receiving the replies from all the servers,

  1. If there are less than 2 GRANT messages, error is returned.
  2. Else for each server :
  3. If the reply is GRANT, the client serializes the account object.
  4. Next it creates the wrapper object with message type, CREATE_OBJ_REQ and sends to the server.
  5. else if the reply is FAILED, client skips this server.

In this issue, we target the OBJ create API on the client.

Create Server to server connection API

Sub-issue of #3

For the inter server communication, following requirements must be met.

  1. All the servers should listen to other servers on a port. The port must be open for other servers to accept the connections.
  2. The connections should be created on a need to know basis.
  3. Each server tries to connect to other servers.
  4. All the servers discover each other before the system is operational.
  5. Once everyone has established the connections, all of them should send a message to each other that they have discovered others.
  6. When each node receives the discovery completed message, it becomes fully functional for the clients.

Messages
SERVER_INTRO: s1 introduces itself to s2.
SERVER_INTRO_REPLY: s2 replies to SERVER_INTRO_REPLY
DISCOVERY_COMPLETE: server broadcasts this message to every one else that it has successfully learnt about all the other servers.

Create Final Report

As a last step, verify the design report from #16 and assemble all the test results from #17 to create the final test report.

Create Server-Client Connection Channel

Each Server will have an open socket to listen to client requests. This channel is different from the server-server communication channel. The rest of the flow will remain the same.

Each client will try to connect to the server via this port. Server, on accepting the connection will start a ClientReqHandler thread to handle the request and begin listening for the next connection.

Create Design Report

Create fresh design report based on the new protocol. It is simpler than the original protocol. Create diagrams in visio etc.

Build UI Layout

Create a basic GUI for CRUD operations. The interface doesn't need to be wired up with the remaining code. The sole purpose is to finish the design and create mock APIs.

Create Connection Handler

The connection Handler API is currently Missing. It should handle all the incoming connections on a per handle basis.

Design Topology Scenarios

System needs to work in various different scenarios. Prepare such testable scenarios, document them with diagrams, test the code and gather results.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.