|
| 1 | +<!-- |
| 2 | +Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +or more contributor license agreements. See the NOTICE file |
| 4 | +distributed with this work for additional information |
| 5 | +regarding copyright ownership. The ASF licenses this file |
| 6 | +to you under the Apache License, Version 2.0 (the |
| 7 | +"License"); you may not use this file except in compliance |
| 8 | +with the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | +Unless required by applicable law or agreed to in writing, |
| 13 | +software distributed under the License is distributed on an |
| 14 | +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +KIND, either express or implied. See the License for the |
| 16 | +specific language governing permissions and limitations |
| 17 | +under the License. |
| 18 | +--> |
| 19 | + |
| 20 | +# Use Spark Operator API Library in Your Java Application |
| 21 | + |
| 22 | +In addition to direct YAML, you may also leverage our Java API library to create and manage Spark |
| 23 | +workloads. |
| 24 | + |
| 25 | +## Choosing the Right Dependency |
| 26 | + |
| 27 | +We publish two variants of this library: |
| 28 | + |
| 29 | +```groovy |
| 30 | +implementation("org.apache.spark:spark-operator-api") |
| 31 | +``` |
| 32 | + |
| 33 | +This library keeps your project free from a direct dependency on Fabric8 Kubernetes Client. It's |
| 34 | +recommended if you only interact with our API at the YAML/CRD level (e.g. generating manifests, |
| 35 | +using our higher-level abstractions). Use this if you don’t need direct access to Fabric8 model |
| 36 | +objects like PodTemplateSpec, Deployment, etc. |
| 37 | + |
| 38 | +If your application requires access on fabric8 models, it's recommended to use |
| 39 | + |
| 40 | +```groovy |
| 41 | +implementation("org.apache.spark:spark-operator-api-fabric8") |
| 42 | +``` |
| 43 | + |
| 44 | +This library publishes the same core library, with Fabric8 declared as an API dependency. This |
| 45 | +means Fabric8 model classes (Pod, PodTemplateSpec, Deployment, etc.) are available directly on |
| 46 | +your classpath when you depend on our library. It's recommended if you want to compose or extend |
| 47 | +Spark Operator API using Fabric8 types (for example, embedding a Fabric8 PodTemplateSpec into |
| 48 | +Spark Operator CRD). |
| 49 | + |
| 50 | +Do not depend on both `spark-operator-api` and `spark-operator-api-fabric8` at the same time. They |
| 51 | +contain the same classes and will conflict on the classpath. Choose one based on your use case. |
0 commit comments