Giter Club home page Giter Club logo

aerospike-scala's People

Contributors

danymarialee avatar optician avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aerospike-scala's Issues

Couldn't save array

Save - spike.callKB(CallKB.Put, "testKey3", SingleBin("array_in_array", Array(Array("val1"), Array("val2"))))
Read - spike.getByKey[String, Array[Array[String]]]("testKey3", List("array_in_array"))
Result - (Map(array_in_array -> Some({})),14,228416602)

But case with List works good.
Save - spike.callKB(CallKB.Put, "testKey3", SingleBin("list_in_list", List(List("val1"), List("val2"))))
Read - spike.getByKey[String, List[List[String]]]("testKey3", List("list_in_list"))
Result - (Map(list_in_list -> Some([List(val1), List(val2)])),14,228416602)

Absent support of WriteListener

It's needed to subscribe on WriteListener to retrieve errors that appeared during writing into Aerospike. It's could be implemented via Promise.
At now only exceptions in direct method call could be caught, but it is not enough in case of asynchronous client.

Subrojects import

Instead of working just with aerospikescala DSL it's needed to know about aerospikemacro and aerospikedomain subproject. It brings knowledge complexity and misunderstanding.

For example typical import:

import ru.tinkoff.aerospike.dsl.{CallKB, SpikeImpl}
import ru.tinkoff.aerospikemacro.domain.DBCredentials
import ru.tinkoff.aerospikescala.domain.SingleBin
import ru.tinkoff.aerospikemacro.converters._

Examples

AClient.scala
val hosts = scala.util.Try(List(config.getString("ru-tinkoff-aerospike-dsl.example-host"))).toOption .getOrElse(throw new Exception("Add host for aerospike in application.conf file"))
toOption is redundant. Try already contains getOrElse method.

Wrong type of result. ArrayList istead Seq.

println(Await.result(
    spike.getByKey[String, Seq[ArrayBuffer[Double]]]("1-1111A1", Nil).collect {
    case (xs, _, _) if xs.head._2.isDefined โ‡’
      xs.head._2.get
  }, Duration.Inf
  ).getClass)

returns: class java.util.ArrayList

Ambiguous requirement of ExecutionContext

class SpikeImpl(spikeClient: IAsyncClient)(implicit val ec: ExecutionContext) and some of its methods (getByKey for example) require ExecutionContext independently.

NPE appears when key is absent in Aerospike

spike.getByKey[String, Array[Array[String]]]("testKey3333", List("array_in_array")), Duration.Inf)
throws
Exception in thread "main" java.lang.NullPointerException at HelloAerospike$$anon$8.apply(HelloAerospike.scala:22) at ru.tinkoff.aerospike.dsl.SpikeImpl$$anonfun$getByKey$2.apply(SpikeImpl.scala:207) at ru.tinkoff.aerospike.dsl.SpikeImpl$$anonfun$getByKey$2.apply(SpikeImpl.scala:207) at scala.util.Success$$anonfun$map$1.apply(Try.scala:237) at scala.util.Try$.apply(Try.scala:192) at scala.util.Success.map(Try.scala:237) at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237) at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.