Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/scala-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
run: sbt scalafmtCheck

- name: Compile
run: sbt Test/compile
run: sbt +Test/compile

- name: Run tests
run: sbt test
run: sbt +test

3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ lazy val commonScalacOptions = Def.setting{
"-Wunused:imports"
)
case Some((3, n)) => List(
"-Wunused:imports"
"-Wunused:imports",
"-deprecation"
)
case _ => List()
}
Expand Down
2 changes: 1 addition & 1 deletion raft-zmq/src/main/scala/zio/raft/zmq/RpcMessageCodec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object RpcMessageCodec:

// We can define better conversion between Chunk and ByteVector
private def chunkCodec =
variableSizeBytes(int32, bytes).xmap(bv => Chunk.fromIterable(bv.toIterable), c => ByteVector(c.toIterable))
variableSizeBytes(int32, bytes).xmap(bv => Chunk.fromIterable(bv.toIterable), c => ByteVector(c.toArray))

private def logEntryCodec[A <: Command](commandCodec: Codec[A]) = discriminated[LogEntry[A]]
.by(uint8)
Expand Down
2 changes: 1 addition & 1 deletion raft/src/main/scala/zio/raft/SnapshotStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ object SnapshotStore:
for
snapshot <- latest.get
result <- snapshot match
case None => ZIO.succeedNow((Index.zero, 0L))
case None => ZIO.succeed((Index.zero, 0L))
case Some(snapshot) =>
snapshot.stream.runCollect
.map(_.size.toLong)
Expand Down
11 changes: 7 additions & 4 deletions raft/src/main/scala/zio/raft/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ case class NotALeaderError(leaderId: Option[MemberId])

type CommandPromise[A] = Promise[NotALeaderError, A]

sealed trait LogEntry[+A <: Command](val term: Term, val index: Index)
sealed trait LogEntry[+A <: Command] {
val term: Term
val index: Index
}
object LogEntry:
case class CommandLogEntry[A <: Command](command: A, override val term: Term, override val index: Index)
extends LogEntry[A](term, index)
case class NoopLogEntry(override val term: Term, override val index: Index) extends LogEntry[Nothing](term, index)
case class CommandLogEntry[A <: Command](command: A, val term: Term, val index: Index)
extends LogEntry[A]
case class NoopLogEntry(val term: Term, val index: Index) extends LogEntry[Nothing]

sealed trait RPCMessage[A <: Command]:
val term: Term
Expand Down
2 changes: 1 addition & 1 deletion zio2-zmq/src/main/scala/zio/zmq/ZSocket.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ZSocket private (
}
.refineToOrDie[ZMQException]
result <-
if (ready) ZIO.succeedNow(true)
if (ready) ZIO.succeed(true)
else {
val canceled = new AtomicBoolean(false)
ZIO
Expand Down