Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.9.9
7ffa254984beda08df23a8d8d212f0eea70faaba
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.7.17"
version = "3.9.9"
runner.dialect = scala213source3
maxColumn = 120
align.preset = more
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ inThisBuild(
licenses := List("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
organization := "io.github.jxnu-liguobin",
organizationName := "撦咃迷离",
developers := List(
developers := List(
Developer(
id = "jxnu-liguobin",
name = "撦咃迷离",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ object NebulaSessionClientExample extends IOApp {
|'Lily':('Lily', 9),'Tom':('Tom', 10),
|'Jerry':('Jerry', 13),
|'John':('John', 11);""".stripMargin))
res1 <- resM1.errorMessageM
_ <- Console[IO].print(res1)
res1 <- resM1.errorMessageM
_ <- Console[IO].print(res1)
resM2 <- client.execute(Stmt.str[IO]("""
|INSERT EDGE like(likeness) VALUES
|'Bob'->'Lily':(80.0),
|'Bob'->'Tom':(70.0),
|'Lily'->'Jerry':(84.0),
|'Tom'->'Jerry':(68.3),
|'Bob'->'John':(97.2);""".stripMargin))
res2 <- resM2.errorMessageM
_ <- Console[IO].print(res2)
res2 <- resM2.errorMessageM
_ <- Console[IO].print(res2)
resM3 <- client.execute(Stmt.str[IO]("""
|USE test;
|MATCH (p:person) RETURN p LIMIT 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object NebulaClientExample {

sessionM match {
case Failure(exception) => exception.printStackTrace()
case Success(session) =>
case Success(session) =>
val res = session.execute(
Stmt.str[Try](
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object NebulaClientMain extends ZIOAppDefault {
(for {
status <- ZIO.serviceWithZIO[NebulaClient[Task]](_.init())
_ <- ZIO.logInfo(status.toString)
res <- ZIO
res <- ZIO
.serviceWithZIO[NebulaClientExample](
_.execute("""
|CREATE SPACE IF NOT EXISTS test(vid_type=fixed_string(20));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object NebulaSessionClientMain extends ZIOAppDefault {
|'Jerry':('Jerry', 13),
|'John':('John', 11);""".stripMargin)
)
_ <- ZIO.logInfo(resultset1.toString)
_ <- ZIO.logInfo(resultset1.toString)
resultset2 <- ZIO
.serviceWithZIO[NebulaSessionClientExample](
_.execute("""
Expand All @@ -39,7 +39,7 @@ object NebulaSessionClientMain extends ZIOAppDefault {
|'Tom'->'Jerry':(68.3),
|'Bob'->'John':(97.2);""".stripMargin)
)
_ <- ZIO.logInfo(resultset2.toString)
_ <- ZIO.logInfo(resultset2.toString)
resultset3 <- ZIO
.serviceWithZIO[NebulaSessionClientExample](
_.execute("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object NebulaStorageClientMain extends ZIOAppDefault {
override def run = (for {
connect <- ZIO
.serviceWithZIO[NebulaStorageClientExample](_.connect())
_ <- ZIO.logInfo(s"connect status: ${connect.toString}")
_ <- ZIO.logInfo(s"connect status: ${connect.toString}")
scan <- ZIO
.serviceWithZIO[NebulaStorageClientExample](
_.scan(ScanEdge("test", None, "like", None))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object syntax {
def handle(result: Any): F[Any] = result match {
case set: NebulaResultSet[Try] @unchecked => Async[F].delay(new NebulaResultSetImpl(set))
case str: String => Async[F].delay(str)
case other =>
case other =>
Async[F].raiseError(new IllegalArgumentException(s"Unexpected result type: ${other.getClass}"))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ final class NebulaStorageClientDefault(underlying: StorageClient) extends Nebula
override def scan(scanInput: ScanInput): Try[scanInput.T] = Try {
scanInput match {
case ScanVertex(spaceName, part, tagName, returnCols, _limit, _between, _allowConfig) =>
val limit = _limit.getOrElse(DEFAULT_LIMIT)
val between = _between.getOrElse(Between(DEFAULT_START_TIME, DEFAULT_END_TIME))
val limit = _limit.getOrElse(DEFAULT_LIMIT)
val between = _between.getOrElse(Between(DEFAULT_START_TIME, DEFAULT_END_TIME))
val allowConfig =
_allowConfig.getOrElse(AllowConfig(DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER))
((part, returnCols) match {
Expand Down Expand Up @@ -91,8 +91,8 @@ final class NebulaStorageClientDefault(underlying: StorageClient) extends Nebula
}).asInstanceOf[scanInput.T]

case ScanEdge(spaceName, part, edgeName, returnCols, _limit, _between, _allowConfig) =>
val limit = _limit.getOrElse(DEFAULT_LIMIT)
val between = _between.getOrElse(Between(DEFAULT_START_TIME, DEFAULT_END_TIME))
val limit = _limit.getOrElse(DEFAULT_LIMIT)
val between = _between.getOrElse(Between(DEFAULT_START_TIME, DEFAULT_END_TIME))
val allowConfig =
_allowConfig.getOrElse(AllowConfig(DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER))
((part, returnCols) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object NebulaClient {
ZLayer.fromZIO(
for {
config <- ZIO.service[NebulaClientConfig]
cb <- ZIO.acquireRelease(ZIO.attempt(new Impl(new NebulaClientDefault(config, new Pool))))(p =>
cb <- ZIO.acquireRelease(ZIO.attempt(new Impl(new NebulaClientDefault(config, new Pool))))(p =>
p.close().onError(e => ZIO.logErrorCause(e)).ignoreLogged
)
} yield cb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object NebulaSessionClient {

val layer: ZLayer[Scope & NebulaClientConfig, Throwable, NebulaSessionClient[Task]] = ZLayer.fromZIO {
for {
config <- ZIO.service[NebulaClientConfig]
config <- ZIO.service[NebulaClientConfig]
sessionPool <- ZIO.acquireRelease(
ZIO.attemptBlocking(new Impl(NebulaSessionClientDefault.make(config)))
)(release => release.close().onError(e => ZIO.logErrorCause(e)).ignoreLogged)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ object NebulaClientSpec extends NebulaSpec {
suite("nebula storage client")(
test("query") {
for {
status <- ZIO.serviceWithZIO[NebulaStorageClient[Task]](_.connect())
_ <- ZIO.logInfo(s"connect status: ${status.toString}")
status <- ZIO.serviceWithZIO[NebulaStorageClient[Task]](_.connect())
_ <- ZIO.logInfo(s"connect status: ${status.toString}")
scanResult <- ZIO.serviceWithZIO[NebulaStorageClient[Task]](
_.scan(ScanEdge("test", None, "like", None))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ trait NebulaSpec extends ZIOSpecDefault {
_ <- ZIO.serviceWithZIO[NebulaClient[Task]](_.init())
client <- ZIO.service[NebulaClient[Task]]
session <- client.getSession(false)
res <- session.execute(Stmt.str[Task]("""
res <- session.execute(Stmt.str[Task]("""
|CREATE SPACE IF NOT EXISTS test(vid_type=fixed_string(20));
|USE test;
|CREATE TAG IF NOT EXISTS person(name string, age int);
Expand Down