程序代写代做代考 Hive Java file system scheme concurrency distributed system Distributed Systems
Distributed Systems
COMP90015 2017 SM1
Project 1 – EZShare
Resource Sharing Network
Introduction
In Project 1 we will build a resource sharing network that consists of servers, which can communicate with
each other, and clients which can communicate with the servers. The system will be called EZShare.
In typical usage, each user that wants to share files will start an EZShare server on the machine that contains
the files. An EZShare client can be used to instruct the server to share the files.
Servers can be queried for what files they are sharing. Clients can request a shared file be downloaded to
them.
Servers can connect to other servers and queries can propogate throughout all of the servers.
In general, servers can publish resources; a file is just one kind of resource. In EZShare, other resources are
just references (URIs) to e.g. web pages.
Every published resource (including shared files) has an optional owner and channel to which it belongs.
These things allow resources to be controlled, e.g. not all shared resources have to be available to the public.
Architecture
Architecture 1
Communication
All communication will be via TCP.
All messages, apart from file contents, will be in JSON format, one JSON message per line.
The text encoding for messages will be Java Modified UTF-8 Encoding, which is the format used by the
writeUTF() and readUTF() methods in Java.
File contents will be transmitted as exact byte sequences, mixed between JSON messages as required.
Interactions will be synchronous request-reply, with a single request per connection.
Resource
A Resource has the following attributes:
Name: optional user supplied name (String), default is “”.•
Description: optional user supplied description (String), default is “”.•
Tags: optional user supplied list of tags (Array of Strings), default is empty list.•
URI: mandatory user supplied absolute URI, that is unique for each resource on a given EZShare
Server within each Channel on the server (String). The URI must conform to official URI format.
•
Channel: optional user supplied channel name (String), default is “”.•
Owner: optional user supplied owner name (String), default is “”.•
EZserver: system supplied server:port name that lists the Resource (String).•
Resources need to be stored, looked up and transmitted, so it will be wise to develop a robust Resource class.
Some special rules for strings are that they must not contain the null character “