Class HttpServer


  • class HttpServer
    extends java.lang.Object
    An HTTP server for static content used to allow worker nodes to access JARs.

    Based on Spark HttpServer, wraps a Jetty server.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String localIpAddress  
      private int port  
      private java.io.File resourceBase  
      private org.eclipse.jetty.server.Server server  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpServer​(java.io.File resourceBase)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String findLocalIpAddress()  
      private static <E> java.lang.Iterable<E> iterable​(java.util.Enumeration<E> enumeration)  
      (package private) static java.lang.String localIpAddress()
      Get the local host's IP address in dotted-quad format (e.g.
      private static void logWarning​(java.lang.String s)  
      (package private) void start()  
      (package private) void stop()  
      (package private) java.lang.String uri()
      Returns the URI of this HTTP server ("http://host:port").
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • localIpAddress

        private static java.lang.String localIpAddress
      • resourceBase

        private final java.io.File resourceBase
      • server

        private org.eclipse.jetty.server.Server server
      • port

        private int port
    • Constructor Detail

      • HttpServer

        HttpServer​(java.io.File resourceBase)
    • Method Detail

      • start

        void start()
      • stop

        void stop()
      • uri

        java.lang.String uri()
        Returns the URI of this HTTP server ("http://host:port").
      • localIpAddress

        static java.lang.String localIpAddress()
        Get the local host's IP address in dotted-quad format (e.g. 1.2.3.4). Note, this is typically not used from within core spark.
      • findLocalIpAddress

        private static java.lang.String findLocalIpAddress()
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • iterable

        private static <E> java.lang.Iterable<E> iterable​(java.util.Enumeration<E> enumeration)
      • logWarning

        private static void logWarning​(java.lang.String s)