Skip to content

Commit

Permalink
#660 Pekko Streams support for scala client
Browse files Browse the repository at this point in the history
  • Loading branch information
utkuaydn committed Jan 8, 2024
1 parent 7dc2746 commit f11bf0e
Show file tree
Hide file tree
Showing 34 changed files with 99 additions and 95 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 6.13.0 [unreleased]
## 7.0.0 [unreleased]

### Features
1. [#661](https://github.com/influxdata/influxdb-client-java/pull/661): Replaced Akka Streams with Pekko Streams in the Scala client.


## 6.12.0 [2023-12-15]

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ This section contains links to the client library documentation.

The Java, Reactive, OSGi, Kotlin and Scala clients are implemented for the InfluxDB 2.x:

| Client | Description | Documentation | Compatibility |
| --- | --- | --- | --- |
| **[java](./client)** | The reference Java client that allows query, write and InfluxDB 2.x management. | [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-java/apidocs/index.html), [readme](./client#influxdb-client-java/)| 2.x |
| **[reactive](./client-reactive)** | The reference RxJava client for the InfluxDB 2.x that allows query and write in a reactive way.| [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-reactive/apidocs/index.html), [readme](./client-reactive#influxdb-client-reactive/) |2.x |
| **[kotlin](./client-kotlin)** | The reference Kotlin client that allows query and write for the InfluxDB 2.x by Kotlin [Channel](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-channel/index.html) and [Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html) coroutines. | [KDoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-kotlin/dokka/influxdb-client-kotlin/com.influxdb.client.kotlin/index.html), [readme](./client-kotlin#influxdb-client-kotlin/) | 2.x|
| **[scala](./client-scala)** | The reference Scala client that allows query and write for the InfluxDB 2.x by [Akka Streams](https://doc.akka.io/docs/akka/2.6/stream/). | [Scaladoc](https://influxdata.github.io/influxdb-client-java/client-scala/cross/influxdb-client-scala_2.13/scaladocs/com/influxdb/client/scala/index.html), [readme](./client-scala#influxdb-client-scala/) | 2.x |
| **[osgi](./client-osgi)** | The reference OSGi (R6) client embedding Java and reactive clients and providing standard features (declarative services, configuration, event processing) for the InfluxDB 2.x. | [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-osgi/apidocs/index.html), [readme](./client-osgi) | 2.x |
| **[karaf](./karaf)** | The Apache Karaf feature definition for the InfluxDB 2.x. | [readme](./karaf) | 2.x |
| Client | Description | Documentation | Compatibility |
|-----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| **[java](./client)** | The reference Java client that allows query, write and InfluxDB 2.x management. | [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-java/apidocs/index.html), [readme](./client#influxdb-client-java/) | 2.x |
| **[reactive](./client-reactive)** | The reference RxJava client for the InfluxDB 2.x that allows query and write in a reactive way. | [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-reactive/apidocs/index.html), [readme](./client-reactive#influxdb-client-reactive/) | 2.x |
| **[kotlin](./client-kotlin)** | The reference Kotlin client that allows query and write for the InfluxDB 2.x by Kotlin [Channel](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-channel/index.html) and [Flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html) coroutines. | [KDoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-kotlin/dokka/influxdb-client-kotlin/com.influxdb.client.kotlin/index.html), [readme](./client-kotlin#influxdb-client-kotlin/) | 2.x |
| **[scala](./client-scala)** | The reference Scala client that allows query and write for the InfluxDB 2.x by [Pekko Streams](https://pekko.apache.org/docs/pekko/current/stream/index.html). | [Scaladoc](https://influxdata.github.io/influxdb-client-java/client-scala/cross/influxdb-client-scala_2.13/scaladocs/com/influxdb/client/scala/index.html), [readme](./client-scala#influxdb-client-scala/) | 2.x |
| **[osgi](./client-osgi)** | The reference OSGi (R6) client embedding Java and reactive clients and providing standard features (declarative services, configuration, event processing) for the InfluxDB 2.x. | [javadoc](https://influxdata.github.io/influxdb-client-java/influxdb-client-osgi/apidocs/index.html), [readme](./client-osgi) | 2.x |
| **[karaf](./karaf)** | The Apache Karaf feature definition for the InfluxDB 2.x. | [readme](./karaf) | 2.x |

There is also possibility to use the Flux language over the InfluxDB 1.7+ provided by:

Expand Down
2 changes: 1 addition & 1 deletion client-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion client-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client</artifactId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-flux</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-osgi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
24 changes: 12 additions & 12 deletions client-scala/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![ScalaDoc](https://img.shields.io/badge/Scaladoc-link-brightgreen.svg)](https://influxdata.github.io/influxdb-client-java/client-scala/cross/influxdb-client-scala_2.13/scaladocs/com/influxdb/client/scala/index.html)

The reference Scala client that allows query and write for the InfluxDB 2.x by [Akka Streams](https://doc.akka.io/docs/akka/2.6/stream/).
The reference Scala client that allows query and write for the InfluxDB 2.x by [Pekko Streams](https://pekko.apache.org/docs/pekko/current/stream/index.html).
The client is cross-built against Scala `2.12` and `2.13`.

## Documentation
Expand All @@ -21,15 +21,15 @@ This section contains links to the client library documentation.

## Queries

The [QueryScalaApi](https://influxdata.github.io/influxdb-client-java/client-scala/cross/influxdb-client-scala_2.13/scaladocs/com/influxdb/client/scala/QueryScalaApi.html) is based on the [Akka Streams](https://doc.akka.io/docs/akka/2.6/stream/).
The [QueryScalaApi](https://influxdata.github.io/influxdb-client-java/client-scala/cross/influxdb-client-scala_2.13/scaladocs/com/influxdb/client/scala/QueryScalaApi.html) is based on the [Pekko Streams](https://pekko.apache.org/docs/pekko/current/stream/index.html).

The following example demonstrates querying using the Flux language:

```scala
package example

import akka.actor.ActorSystem
import akka.stream.scaladsl.Sink
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.scaladsl.Sink
import com.influxdb.client.scala.InfluxDBClientScalaFactory
import com.influxdb.query.FluxRecord

Expand Down Expand Up @@ -77,8 +77,8 @@ It is possible to parse a result line-by-line using the `queryRaw` method:
```scala
package example

import akka.actor.ActorSystem
import akka.stream.scaladsl.Sink
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.scaladsl.Sink
import com.influxdb.client.scala.InfluxDBClientScalaFactory

import scala.concurrent.Await
Expand Down Expand Up @@ -204,8 +204,8 @@ package example

import java.time.temporal.ChronoUnit

import akka.actor.ActorSystem
import akka.stream.scaladsl.Sink
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.scaladsl.Sink
import com.influxdb.client.scala.InfluxDBClientScalaFactory
import com.influxdb.query.FluxRecord
import com.influxdb.query.dsl.Flux
Expand Down Expand Up @@ -257,14 +257,14 @@ The latest version for Maven dependency:
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-scala_2.12</artifactId>
<version>6.12.0</version>
<version>7.0.0</version>
</dependency>
```

Or when using with Gradle:
```groovy
dependencies {
implementation "com.influxdb:influxdb-client-scala_2.12:6.12.0"
implementation "com.influxdb:influxdb-client-scala_2.12:7.0.0"
}
```

Expand All @@ -275,14 +275,14 @@ The latest version for Maven dependency:
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-scala_2.13</artifactId>
<version>6.12.0</version>
<version>7.0.0</version>
</dependency>
```

Or when using with Gradle:
```groovy
dependencies {
implementation "com.influxdb:influxdb-client-scala_2.13:6.12.0"
implementation "com.influxdb:influxdb-client-scala_2.13:7.0.0"
}
```

Expand Down
22 changes: 11 additions & 11 deletions client-scala/cross/2.12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand All @@ -36,7 +36,7 @@

<name>The Scala InfluxDB 2.x Client [Scala 2.12]</name>
<description>
The reference Scala client that allows query and write for the InfluxDB 2.x by Akka Streams.
The reference Scala client that allows query and write for the InfluxDB 2.x by Pekko Streams.
</description>

<url>https://github.com/influxdata/influxdb-client-java/tree/master/client-scala</url>
Expand Down Expand Up @@ -173,9 +173,9 @@
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.12</artifactId>
<version>${akka.version}</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-stream_2.12</artifactId>
<version>${pekko.version}</version>
<exclusions>
<exclusion>
<groupId>com.typesafe</groupId>
Expand All @@ -193,9 +193,9 @@
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.12</artifactId>
<version>${akka.version}</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_2.12</artifactId>
<version>${pekko.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -206,9 +206,9 @@
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream-testkit_2.12</artifactId>
<version>${akka.version}</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-stream-testkit_2.12</artifactId>
<version>${pekko.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
22 changes: 11 additions & 11 deletions client-scala/cross/2.13/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand All @@ -36,7 +36,7 @@

<name>The Scala InfluxDB 2.x Client [Scala 2.13]</name>
<description>
The reference Scala client that allows query and write for the InfluxDB 2.x by Akka Streams.
The reference Scala client that allows query and write for the InfluxDB 2.x by Pekko Streams.
</description>

<url>https://github.com/influxdata/influxdb-client-java/tree/master/client-scala</url>
Expand Down Expand Up @@ -171,9 +171,9 @@
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_2.13</artifactId>
<version>${akka.version}</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-stream_2.13</artifactId>
<version>${pekko.version}</version>
<exclusions>
<exclusion>
<groupId>com.typesafe</groupId>
Expand All @@ -191,9 +191,9 @@
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.13</artifactId>
<version>${akka.version}</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_2.13</artifactId>
<version>${pekko.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -204,9 +204,9 @@
</dependency>

<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream-testkit_2.13</artifactId>
<version>${akka.version}</version>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-stream-testkit_2.13</artifactId>
<version>${pekko.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.influxdb.client.domain.HealthCheck
import javax.annotation.Nonnull

/**
* The reference Scala client that allows query and write for the InfluxDB 2.x by Akka Streams.
* The reference Scala client that allows query and write for the InfluxDB 2.x by Pekko Streams.
*
* @author Jakub Bednar (bednar@github) (08/02/2019 09:09)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package com.influxdb.client.scala

import akka.NotUsed
import akka.stream.scaladsl.Source
import org.apache.pekko.NotUsed
import org.apache.pekko.stream.scaladsl.Source
import com.influxdb.client.domain.{Dialect, Query}
import com.influxdb.query.FluxRecord
import javax.annotation.Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package com.influxdb.client.scala

import akka.Done
import akka.stream.scaladsl.Sink
import org.apache.pekko.Done
import org.apache.pekko.stream.scaladsl.Sink
import com.influxdb.client.domain.WritePrecision
import com.influxdb.client.write.{Point, WriteParameters}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package com.influxdb.client.scala.internal

import akka.NotUsed
import akka.stream.scaladsl.Source
import org.apache.pekko.NotUsed
import org.apache.pekko.stream.scaladsl.Source
import com.influxdb.client.InfluxDBClientOptions
import com.influxdb.client.domain.{Dialect, Query}
import com.influxdb.client.internal.AbstractInfluxDBClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package com.influxdb.client.scala.internal

import akka.Done
import akka.stream.scaladsl.{Flow, Keep, Sink, Source}
import org.apache.pekko.Done
import org.apache.pekko.stream.scaladsl.{Flow, Keep, Sink, Source}
import com.influxdb.client.InfluxDBClientOptions
import com.influxdb.client.domain.WritePrecision
import com.influxdb.client.internal.{AbstractWriteBlockingClient, AbstractWriteClient}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
*/
package com.influxdb.client.scala

import akka.actor.ActorSystem
import akka.stream.scaladsl.{FileIO, Keep, Source}
import akka.stream.testkit.scaladsl.TestSink
import akka.util.ByteString
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.scaladsl.{FileIO, Keep, Source}
import org.apache.pekko.stream.testkit.scaladsl.TestSink
import org.apache.pekko.util.ByteString
import com.influxdb.annotations.Column
import com.influxdb.client.domain._
import com.influxdb.client.internal.AbstractInfluxDBClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package com.influxdb.client.scala

import akka.actor.ActorSystem
import akka.stream.testkit.scaladsl.TestSink
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.testkit.scaladsl.TestSink
import com.influxdb.query.FluxRecord
import org.scalatest.BeforeAndAfter
import org.scalatest.funsuite.AnyFunSuite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
package com.influxdb.client.scala

import akka.actor.ActorSystem
import akka.stream.scaladsl.{Keep, Source}
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.scaladsl.{Keep, Source}
import com.influxdb.annotations.{Column, Measurement}
import com.influxdb.client.domain.WritePrecision
import com.influxdb.client.write.{Point, WriteParameters}
Expand Down
2 changes: 1 addition & 1 deletion client-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>

<artifactId>influxdb-client-utils</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<artifactId>influxdb-client</artifactId>
<groupId>com.influxdb</groupId>
<version>6.13.0-SNAPSHOT</version>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ This directory contains Java, Kotlin and Scala examples.
- [ScalaQueryRaw.scala](src/main/java/example/ScalaQueryRaw.scala) - How to query data into a stream of `String`
- [ScalaQueryDSL.scala](src/main/java/example/ScalaQueryDSL.scala) - How to use the [FluxDSL](../flux-dsl) to query data

### Writes
### Writes
- [ScalaWriteApi.scala](src/main/java/example/ScalaWriteApi.scala) - How to ingest data by `DataPoint`, `LineProtocol` or `POJO`
Loading

0 comments on commit f11bf0e

Please sign in to comment.