예제 #1
0
        if line[0] ==  "start":
            """
            Resume the system and allow any Anti-Entropy messages to
            propagate through the system
            """
            api.start()

        if line[0] ==  "stabilize":
            """
            Block until there are enough Anti-Entropy messages for all values to
            propagate through the currently connected servers. In general, the
            time that this function blocks for should increase linearly with the
            number of servers in the system.
            """
            api.stabilize()

        if line[0] ==  "printLog":
            serverId = int(line[1])
            """
            Print out a server's operation log in the format specified in the
            handout.
            """
            api.printLog(serverId)

        if line[0] ==  "put":
            clientId = int(line[1])
            songName = line[2]
            URL = line[3]
            """
            Instruct the client specified to associate the given URL with the given