Skip to content

Commit 50fff4d

Browse files
Update scalafmt-core to 2.7.5 (#64)
* Update scalafmt-core to 2.7.5 * Reformat with scalafmt 2.7.5
1 parent a7380f3 commit 50fff4d

File tree

4 files changed

+29
-50
lines changed

4 files changed

+29
-50
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "2.6.4"
1+
version = "2.7.5"
22

33
preset = defaultWithAlign
44
danglingParentheses.preset = false

src/main/scala/akka/contrib/persistence/query/QueryViewSnapshotSerializer.scala

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ class QueryViewSnapshotSerializer(val system: ExtendedActorSystem) extends BaseS
6161
private def serializeQueryViewSnapshot(snapshot: QueryViewSnapshot[_], out: OutputStream): Unit = {
6262

6363
val builder = QueryViewFormats.QueryViewSnapshot.newBuilder()
64-
snapshot.sequenceNrs.foreach {
65-
case (persistenceId, sequenceNr) =>
66-
builder.addSequenceNrs(
67-
QueryViewFormats.QueryViewSnapshot.SequenceNrEntry
68-
.newBuilder()
69-
.setPersistenceId(persistenceId)
70-
.setSequenceNr(sequenceNr)
71-
.build()
72-
)
64+
snapshot.sequenceNrs.foreach { case (persistenceId, sequenceNr) =>
65+
builder.addSequenceNrs(
66+
QueryViewFormats.QueryViewSnapshot.SequenceNrEntry
67+
.newBuilder()
68+
.setPersistenceId(persistenceId)
69+
.setSequenceNr(sequenceNr)
70+
.build()
71+
)
7372
}
7473

7574
builder.setMaxOffset(serializePayload(snapshot.maxOffset))

src/main/scala/akka/persistence/QueryView.scala

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ object QueryView {
4646

4747
private case class LiveStreamFailed(cause: Throwable)
4848

49-
/**
50-
* Additionally to being updated by the live stream the QueryView instantly issues a query using the recovery stream to perform a fast forced update
49+
/** Additionally to being updated by the live stream the QueryView instantly issues a query using the recovery stream to perform a fast forced update
5150
* (useful in corner cases when the live stream has a high delay/polling interval)
5251
* While updating a subsequent ForceUpdate is ignored.
5352
*/
@@ -74,8 +73,7 @@ object QueryView {
7473

7574
trait EventStreamOffsetTyped {
7675

77-
/**
78-
* Type of offset used for position in the event stream
76+
/** Type of offset used for position in the event stream
7977
*/
8078
type OT = Offset
8179
}
@@ -110,109 +108,92 @@ abstract class QueryView
110108
override private[persistence] val snapshotStore: ActorRef = persistence.snapshotStoreFor(snapshotPluginId)
111109
private implicit val materializer: ActorMaterializer = ActorMaterializer()(context)
112110

113-
/**
114-
* This stash will contain the messages received during the recovery phase.
111+
/** This stash will contain the messages received during the recovery phase.
115112
*/
116113
private val recoveringStash = createStash()
117114

118-
/**
119-
* It is the persistenceId linked to this view. It should be unique.
115+
/** It is the persistenceId linked to this view. It should be unique.
120116
*/
121117
override def snapshotterId: String
122118

123-
/**
124-
* Configuration id of the snapshot plugin servicing this persistent actor or view.
119+
/** Configuration id of the snapshot plugin servicing this persistent actor or view.
125120
* When empty, looks in `akka.persistence.snapshot-store.plugin` to find configuration entry path.
126121
* When configured, uses `snapshotPluginId` as absolute path to the snapshot store configuration entry.
127122
* Configuration entry must contain few required fields, such as `class`. See akka-persistence jar
128123
* `src/main/resources/reference.conf`.
129124
*/
130125
def snapshotPluginId: String = ""
131126

132-
/**
133-
* The amount of time this actor must wait until giving up waiting for the recovery process. A undefined duration
127+
/** The amount of time this actor must wait until giving up waiting for the recovery process. A undefined duration
134128
* causes the actor to wait indefinitely. If the recovery fails because of a timeout, this actor will crash.
135129
*
136130
* TODO Tune by a flag to indicate we want the actor to switch live if the recovery timeout.
137131
*/
138132
def recoveryTimeout: Duration = DefaultRecoveryTimeout
139133

140-
/**
141-
* The amount of time this actor must wait until giving up waiting for a snapshot loading. A undefined duration
134+
/** The amount of time this actor must wait until giving up waiting for a snapshot loading. A undefined duration
142135
* causes the actor to wait indefinitely. The timeout does not cause this actor to crash, it is a recoverable error.
143136
*/
144137
def loadSnapshotTimeout: Duration = DefaultLoadSnapshotTimeout
145138

146-
/**
147-
* It is the source od EventEnvelope used to recover the view status. It MUST be finite stream.
139+
/** It is the source od EventEnvelope used to recover the view status. It MUST be finite stream.
148140
*
149141
* It is declared as AnyRef to be able to return [[akka.persistence.query.EventEnvelope]].
150142
*/
151143
def recoveringStream(sequenceNrByPersistenceId: Map[String, Long], lastOffset: OT): Source[AnyRef, _]
152144

153-
/**
154-
* It is the source od EventEnvelope used to receive live events, it MUST be a infinite stream (eg: It should never
145+
/** It is the source od EventEnvelope used to receive live events, it MUST be a infinite stream (eg: It should never
155146
* complete)
156147
*
157148
* It is declared as AnyRef to be able to return [[akka.persistence.query.EventEnvelope]].
158149
*/
159150
def liveStream(sequenceNrByPersistenceId: Map[String, Long], lastOffset: OT): Source[AnyRef, _]
160151

161-
/**
162-
* It is an hook called before the actor switch to live mode. It is synchronous (it can change the actor status).
152+
/** It is an hook called before the actor switch to live mode. It is synchronous (it can change the actor status).
163153
* It can be useful to fetch additional data from other actor/services before starting receiving messages.
164154
*/
165155
def preLive(): Unit = {}
166156

167-
/**
168-
* @see [[akka.persistence.QueryView.ForceUpdate]]
157+
/** @see [[akka.persistence.QueryView.ForceUpdate]]
169158
*/
170159
def forceUpdate(): Unit = startForceUpdate()
171160

172-
/**
173-
* Is called when the stream of a forceUpdate has completed
161+
/** Is called when the stream of a forceUpdate has completed
174162
*/
175163
def onForceUpdateCompleted() = {}
176164

177165
// Status accessors
178166

179-
/**
180-
* Return if this actor is waiting for receiving the snapshot from the snapshot-store.
167+
/** Return if this actor is waiting for receiving the snapshot from the snapshot-store.
181168
*/
182169
final def isWaitingForSnapshot: Boolean = currentState == State.WaitingForSnapshot
183170

184-
/**
185-
* Return if this actor is in recovery phase. Useful to the implementor to apply different behavior when a message
171+
/** Return if this actor is in recovery phase. Useful to the implementor to apply different behavior when a message
186172
* came from the journal or from another actor.
187173
*/
188174
final def isRecovering: Boolean = currentState == State.Recovering
189175

190-
/**
191-
* Return if this actor is in live phase. Useful to the implementor to apply different behavior when a message
176+
/** Return if this actor is in live phase. Useful to the implementor to apply different behavior when a message
192177
* came from the journal or from another actor.
193178
*/
194179
final def isLive: Boolean = currentState == State.Live
195180

196-
/**
197-
* Return the last replayed message offset from the journal.
181+
/** Return the last replayed message offset from the journal.
198182
*/
199183
final def lastOffset: OT = Option(_lastOffset).getOrElse(firstOffset)
200184

201-
/**
202-
* The current sequenceNr of given persistenceId
185+
/** The current sequenceNr of given persistenceId
203186
*
204187
* @param persistenceId
205188
* @return
206189
*/
207190
final def lastSequenceNrFor(persistenceId: String): Long = _sequenceNrByPersistenceId.getOrElse(persistenceId, 0)
208191

209-
/**
210-
* Return the number of processed events since last snapshot has been taken.
192+
/** Return the number of processed events since last snapshot has been taken.
211193
*/
212194
final def noOfEventSinceLastSnapshot(): Long = _noOfEventsSinceLastSnapshot
213195

214-
/**
215-
* Return the next sequence nr to apply to the next snapshot.
196+
/** Return the next sequence nr to apply to the next snapshot.
216197
*/
217198
override final def snapshotSequenceNr: Long = lastSnapshotSequenceNr + 1
218199

src/test/scala/akka/persistence/QueryViewSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,7 @@ abstract class TestQueryView extends QueryView with LevelDbQuerySupport {
354354
private var waitForSnapshot = Option.empty[ActorRef]
355355
// scalastyle:on var.field
356356

357-
/**
358-
* It is the persistenceId linked to this view. It should be unique.
357+
/** It is the persistenceId linked to this view. It should be unique.
359358
*/
360359
override def snapshotterId: String = "test"
361360

0 commit comments

Comments
 (0)