readthedocs

This commit is contained in:
Kent Yao 2020-11-03 14:59:32 +08:00
parent c1b44de85c
commit a8281fc34c
5 changed files with 53 additions and 2 deletions

38
.readthedocs.yml Normal file
View File

@ -0,0 +1,38 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF
formats:
- pdf
- epub
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt

View File

@ -20,6 +20,7 @@ sys.path.insert(0, os.path.abspath('.'))
import sphinx_rtd_theme
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
import sphinx_markdown_tables
import recommonmark
from recommonmark.transform import AutoStructify
from recommonmark.parser import CommonMarkParser
@ -66,6 +67,7 @@ extensions = [
'sphinx.ext.mathjax',
'recommonmark',
'sphinx_markdown_tables',
'notfound.extension',
]
master_doc = 'index'

5
docs/requirements.txt Normal file
View File

@ -0,0 +1,5 @@
sphinx==3.2.1
sphinx_rtd_theme==0.5.0
sphinx-markdown-tables==0.0.15
recommonmark==0.6.0
sphinx-notfound-page==0.5

View File

@ -23,7 +23,7 @@ import org.apache.kyuubi._
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.ha.HighAvailabilityConf._
import org.apache.kyuubi.ha.server.EmbeddedZkServer
import org.apache.kyuubi.service.{AbstractBackendService, Serverable}
import org.apache.kyuubi.service.{AbstractBackendService, KinitAuxiliaryService, Serverable}
import org.apache.kyuubi.util.SignalRegister
object KyuubiServer extends Logging {
@ -77,5 +77,11 @@ class KyuubiServer(name: String) extends Serverable(name) {
override private[kyuubi] val backendService: AbstractBackendService = new KyuubiBackendService()
override def initialize(conf: KyuubiConf): Unit = {
val kinit = new KinitAuxiliaryService()
addService(kinit)
super.initialize(conf)
}
override protected def stopServer(): Unit = KyuubiServer.zkServer.stop()
}

View File

@ -35,7 +35,7 @@ class KyuubiServerSuite extends KyuubiFunSuite {
server.initialize(conf)
assert(server.getServiceState === INITIALIZED)
val backendService = server.getServices.head.asInstanceOf[KyuubiBackendService]
val backendService = server.getServices(1).asInstanceOf[KyuubiBackendService]
assert(backendService.getServiceState == INITIALIZED)
assert(backendService.getServices.forall(_.getServiceState === INITIALIZED))
assert(server.connectionUrl.split(":").length === 2)