Skip to content

Commit 48eda7f

Browse files
committed
fixed static analysis warnings
1 parent 4ad351f commit 48eda7f

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

arangodb-spark-commons/src/main/scala/org/apache/spark/sql/arangodb/commons/ArangoClient.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package org.apache.spark.sql.arangodb.commons
22

33
import com.arangodb.{ArangoCursor, ArangoDB, ArangoDBException, Request}
44
import com.arangodb.entity.ErrorEntity
5-
import com.arangodb.internal.serde.InternalSerdeProvider
5+
import com.arangodb.internal.serde.{InternalSerde, InternalSerdeProvider}
66
import com.arangodb.model.{AqlQueryOptions, CollectionCreateOptions}
7-
import com.arangodb.serde.ArangoSerde
87
import com.arangodb.util.{RawBytes, RawJson}
98
import org.apache.spark.internal.Logging
109
import org.apache.spark.sql.arangodb.commons.exceptions.ArangoDBMultiException
@@ -38,7 +37,7 @@ class ArangoClient(options: ArangoDBConf) extends Logging {
3837
.build()
3938
}
4039

41-
lazy val serde: ArangoSerde = arangoDB.getSerde
40+
lazy val serde: InternalSerde = arangoDB.getSerde
4241

4342
def shutdown(): Unit = {
4443
logDebug("closing db client")
@@ -174,7 +173,6 @@ class ArangoClient(options: ArangoDBConf) extends Logging {
174173
// request.putQueryParam("silent", true)
175174

176175
val response = arangoDB.execute(request, classOf[RawBytes])
177-
val serde = arangoDB.getSerde
178176

179177
import scala.collection.JavaConverters.asScalaIteratorConverter
180178
val errors = serde.parse(response.getBody.get).iterator().asScala

arangodb-spark-commons/src/main/scala/org/apache/spark/sql/arangodb/commons/ArangoDBConf.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ object ArangoDBConf {
298298
* @param comment Additional info regarding to the removed config. For example,
299299
* reasons of config deprecation, what users should use instead of it.
300300
*/
301-
case class DeprecatedConfig(key: String, version: String, comment: String)
301+
final case class DeprecatedConfig(key: String, version: String, comment: String)
302302

303303
/**
304304
* Maps deprecated Spark ArangoDB config keys to information about the deprecation.
@@ -320,7 +320,7 @@ object ArangoDBConf {
320320
* users that they set non-default value to an already removed config.
321321
* @param comment Additional info regarding to the removed config.
322322
*/
323-
case class RemovedConfig(key: String, version: String, defaultValue: String, comment: String)
323+
final case class RemovedConfig(key: String, version: String, defaultValue: String, comment: String)
324324

325325
/**
326326
* The map contains info about removed Spark ArangoDB configs. Keys are Spark ArangoDB config names,
@@ -363,7 +363,7 @@ class ArangoDBConf(opts: Map[String, String]) extends Serializable with Logging
363363

364364
/** Return the value of Spark ArangoDB configuration property for the given key. */
365365
@throws[NoSuchElementException]("if key is not set")
366-
def getConfString(key: String): String = settings.get(key).getOrElse(throw new NoSuchElementException(key))
366+
def getConfString(key: String): String = settings.getOrElse(key, throw new NoSuchElementException(key))
367367

368368
/**
369369
* Return the value of Spark ArangoDB configuration property for the given key. If the key is not set
@@ -389,7 +389,7 @@ class ArangoDBConf(opts: Map[String, String]) extends Serializable with Logging
389389
* Return the `string` value of Spark ArangoDB configuration property for the given key. If the key is
390390
* not set, return `defaultValue`.
391391
*/
392-
def getConfString(key: String, defaultValue: String): String = settings.get(key).getOrElse(defaultValue)
392+
def getConfString(key: String, defaultValue: String): String = settings.getOrElse(key, defaultValue)
393393

394394
/**
395395
* Return all the configuration properties that have been set (i.e. not the default).
@@ -403,7 +403,7 @@ class ArangoDBConf(opts: Map[String, String]) extends Serializable with Logging
403403
*/
404404
def getAllDefinedConfigs: Seq[(String, String, String)] =
405405
confEntries.values.filter(_.isPublic).map { entry =>
406-
val displayValue = settings.get(entry.key).getOrElse(entry.defaultValueString)
406+
val displayValue = settings.getOrElse(entry.key, entry.defaultValueString)
407407
(entry.key, displayValue, entry.doc)
408408
}.toSeq
409409

0 commit comments

Comments
 (0)