Recent Changes - Search:

Instructor

  • who: Michael Swift
  • where: Room 7369
  • when: Wed. 2:30-3:30, Thu. 1:30-2:30
  • email: swift 'at' cs.wisc.edu

Lecture:

  • when: Tues./Thur. 11-12:15
  • where: Chemistry 1351
  • list: compsci739-1-s12 'at' lists.wisc.edu

HomePage

Resources

edit SideBar

Project1-Spec

This page may be edited using the wiki password sent in email. Ideally, we will converge on a spec by at least March 8th.

Performance

Your server must be able to sustain 300 operations per second on a reasonable machine.

Durability

Your service does not need to survive the failure of all instances simultaneously.

Consistency

Your service should provide strong consistency in the absence of server failures. The client may not be able to communicate with all servers (e.g., broken network link), but should still see strongly consistent results.

Server names

Your server should read in a file in the current directory named "servers.txt" to learn of the other instances of the service. This file will contain the set of servers and the ports to listen on. Each server must use a unique port for client-server communication, chosen from the set 8081-8084. Servers are free to use other ports to communicate between servers, such as for replication. The first line will refer to the server itself:

For example

  192.168.2.2:8081
  192.168.2.3:8082
  192.168.2.4:8083
  192.168.2.5:8084

Protocol

There is no standard protocol. Your server is only required to work with the client you provide.

Client interface

You will provide a shared library named "lib739kv.so" implementing the interface to your server. The client code must run on standard CS department workstations.

Here are the functions you must implement:

  • int kv739_init(char *servers[]) - provide a null-terminated list of servers in the format "host:port" and initialize the client code. Returns 0 on success and -1 on failure.
  • void kv739_fail(char * server) - indicate that the server "host:port" has failed and the client should not attempt to contact it. This is a simple way to partition clients from servers.
  • void kv739_recover(char * server) - indicate that the server "host:port" has recovered and the client can contact it again.
  • int kv739_get(char * key, char * value) - retrieve the value corresponding to the key. If the key is present, it should return 0 and store the value in the provided string. The string must be at least 1 byte larger than the maximum allowed value. If the key is not present, it should return 1. If there is a failure, it should return -1.
  • int kv739_put(char * key, char * value, char * old_value) - Perform a get operation on the current value into old_value and then store the specified value. Should return 0 on success if there is an old value, 1 on success if there was no old value, and -1 on failure. The old_value parameter must be at least one byte larger than the maximum value size.

There are restrictions on keys and values:

  • Keys are valid printable ASCII strings without special characters and are 128 or less bytes in length. They cannot include the "[" or "]" characters.
  • Values are valid printable ASCII strings with neither special characters nor UUencoded characters and 2048 or less bytes in length. They cannot include the "[" or "]" characters.
Edit - History - Print - Recent Changes - Search
Page last modified on February 29, 2012, at 08:18 PM