Class VeniceSparkEmbeddedJettyServer

  • All Implemented Interfaces:
    spark.embeddedserver.EmbeddedServer

    public class VeniceSparkEmbeddedJettyServer
    extends java.lang.Object
    implements spark.embeddedserver.EmbeddedServer
    Spark server implementation
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int activeThreadCount()  
      void configureWebSockets​(java.util.Map<java.lang.String,​spark.embeddedserver.jetty.websocket.WebSocketHandlerWrapper> webSocketHandlers, java.util.Optional<java.lang.Long> webSocketIdleTimeoutMillis)  
      void extinguish()
      int ignite​(java.lang.String host, int port, spark.ssl.SslStores sslStores, int maxThreads, int minThreads, int threadIdleTimeoutMillis)
      void join()
      void trustForwardHeaders​(boolean trust)  
      VeniceSparkEmbeddedJettyServer withThreadPool​(org.eclipse.jetty.util.thread.ThreadPool threadPool)
      Sets optional thread pool for jetty server.
      • Methods inherited from class java.lang.Object

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

      • VeniceSparkEmbeddedJettyServer

        public VeniceSparkEmbeddedJettyServer​(VeniceProperties jettyConfigOverrides,
                                              org.eclipse.jetty.server.Handler handler)
    • Method Detail

      • configureWebSockets

        public void configureWebSockets​(java.util.Map<java.lang.String,​spark.embeddedserver.jetty.websocket.WebSocketHandlerWrapper> webSocketHandlers,
                                        java.util.Optional<java.lang.Long> webSocketIdleTimeoutMillis)
        Specified by:
        configureWebSockets in interface spark.embeddedserver.EmbeddedServer
      • trustForwardHeaders

        public void trustForwardHeaders​(boolean trust)
        Specified by:
        trustForwardHeaders in interface spark.embeddedserver.EmbeddedServer
      • ignite

        public int ignite​(java.lang.String host,
                          int port,
                          spark.ssl.SslStores sslStores,
                          int maxThreads,
                          int minThreads,
                          int threadIdleTimeoutMillis)
                   throws java.lang.Exception
        Specified by:
        ignite in interface spark.embeddedserver.EmbeddedServer
        Throws:
        java.lang.Exception
      • join

        public void join()
                  throws java.lang.InterruptedException
        Specified by:
        join in interface spark.embeddedserver.EmbeddedServer
        Throws:
        java.lang.InterruptedException
      • extinguish

        public void extinguish()
        Specified by:
        extinguish in interface spark.embeddedserver.EmbeddedServer
      • activeThreadCount

        public int activeThreadCount()
        Specified by:
        activeThreadCount in interface spark.embeddedserver.EmbeddedServer
      • withThreadPool

        public VeniceSparkEmbeddedJettyServer withThreadPool​(org.eclipse.jetty.util.thread.ThreadPool threadPool)
        Sets optional thread pool for jetty server. This is useful for overriding the default thread pool behaviour for example io.dropwizard.metrics.jetty9.InstrumentedQueuedThreadPool.
        Parameters:
        threadPool - thread pool
        Returns:
        Builder pattern - returns this instance