# Path: tensorflowonspark/reservation.py
# TFOS_SERVER_PORT = "TFOS_SERVER_PORT"
# TFOS_SERVER_HOST = "TFOS_SERVER_HOST"
# BUFSIZE = 1024
# MAX_RETRIES = 3
#       CONNECTIONS = []
# class Reservations:
# class MessageSocket(object):
# class Server(MessageSocket):
# class Client(MessageSocket):
#   def __init__(self, required):
#   def add(self, meta):
#   def done(self):
#   def get(self):
#   def remaining(self):
#   def receive(self, sock):
#   def send(self, sock, msg):
#   def __init__(self, count):
#   def await_reservations(self, sc, status={}, timeout=600):
#   def _handle_message(self, sock, msg):
#   def start(self):
#     def _listen(self, sock):
#   def get_server_ip(self):
#   def get_server_ports(self):
#   def start_listening_socket(self):
#   def stop(self):
#   def __init__(self, server_addr):
#   def _request(self, msg_type, msg_data=None):
#   def close(self):
#   def register(self, reservation):
#   def get_reservations(self):
#   def await_reservations(self):
#   def request_stop(self):


from tensorflowonspark import reservation
import sys
# Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""
Simple utility to shutdown a Spark StreamingContext by signaling the reservation Server.
Note: use the reservation server address (host, port) reported in the driver logs.
"""


if __name__ == "__main__":
  host = sys.argv[1]
  port = int(sys.argv[2])
  addr = (host, port)

# Path: tensorflowonspark/reservation.py
# TFOS_SERVER_PORT = "TFOS_SERVER_PORT"
# TFOS_SERVER_HOST = "TFOS_SERVER_HOST"
# BUFSIZE = 1024
# MAX_RETRIES = 3
#       CONNECTIONS = []
# class Reservations:
# class MessageSocket(object):
# class Server(MessageSocket):
# class Client(MessageSocket):
#   def __init__(self, required):
#   def add(self, meta):
#   def done(self):
#   def get(self):
#   def remaining(self):
#   def receive(self, sock):
#   def send(self, sock, msg):
#   def __init__(self, count):
#   def await_reservations(self, sc, status={}, timeout=600):
#   def _handle_message(self, sock, msg):
#   def start(self):
#     def _listen(self, sock):
#   def get_server_ip(self):
#   def get_server_ports(self):
#   def start_listening_socket(self):
#   def stop(self):
#   def __init__(self, server_addr):
#   def _request(self, msg_type, msg_data=None):
#   def close(self):
#   def register(self, reservation):
#   def get_reservations(self):
#   def await_reservations(self):
#   def request_stop(self):


# Path: examples/utils/stop_streaming.py
from tensorflowonspark import reservation
import sys

# Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""
Simple utility to shutdown a Spark StreamingContext by signaling the reservation Server.
Note: use the reservation server address (host, port) reported in the driver logs.
"""


if __name__ == "__main__":
  host = sys.argv[1]
  port = int(sys.argv[2])
  addr = (host, port)

  client = reservation.Client(addr)