Class StatefulBuildLogImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.buildLog.StatefulBuildLogImpl
-
- All Implemented Interfaces:
PersisterFacade
,StatefulBuildLog
public final class StatefulBuildLogImpl extends Object implements StatefulBuildLog, PersisterFacade
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static StatefulBuildLog
create(String buildLogId, BuildLogMessagesPersister messagesPersister, boolean initLog, boolean canRecoverBuildLog)
static StatefulBuildLog
createForService(String buildLogId)
void
dispose()
Same as close, but it does not attempt to persist messages buffer on disk, instead it just drops it.int
getNextMessageIndex()
boolean
hasNotFlushedMessages()
boolean
isClosed()
void
refreshNextMessageIndex()
void
remotePersistBlocksUpdate(List<Integer> messageIndexes, Status status, Date finishTs)
int
remotePersistLogMessage(LogMessageInfo info)
IdRange
reserveAnchorsRange(int rangeSize)
StateSynchronizationResult
synchronizeState(List<LogMessageData> messages, Map<Integer,Long> clientFlowSnapshotVersions, FlushDirective flushDirective, boolean lastMessageLoggingResultRequested)
Accepts unprocessed messages, logs them and returns an update for build-log state snapshot.String
toString()
-
-
-
Method Detail
-
create
@NotNull public static StatefulBuildLog create(@NotNull String buildLogId, @NotNull BuildLogMessagesPersister messagesPersister, boolean initLog, boolean canRecoverBuildLog)
-
createForService
@NotNull public static StatefulBuildLog createForService(@NotNull String buildLogId)
-
synchronizeState
@NotNull public StateSynchronizationResult synchronizeState(@NotNull List<LogMessageData> messages, @NotNull Map<Integer,Long> clientFlowSnapshotVersions, @NotNull FlushDirective flushDirective, boolean lastMessageLoggingResultRequested)
Description copied from interface:StatefulBuildLog
Accepts unprocessed messages, logs them and returns an update for build-log state snapshot.- Specified by:
synchronizeState
in interfaceStatefulBuildLog
- Parameters:
messages
- list of messages to be logged.clientFlowSnapshotVersions
- flow snapshot versions known by client (the method should only provide snapshot for flows that are outdated or missing). If client does not have any snapshots, then empty map should be provided.lastMessageLoggingResultRequested
- should result of last message logging be included into the response.- Returns:
- an update for the build-log snapshot.
-
reserveAnchorsRange
@NotNull public IdRange reserveAnchorsRange(int rangeSize) throws AnchorsReservationException
- Specified by:
reserveAnchorsRange
in interfaceStatefulBuildLog
- Throws:
AnchorsReservationException
-
hasNotFlushedMessages
public boolean hasNotFlushedMessages()
- Specified by:
hasNotFlushedMessages
in interfaceStatefulBuildLog
-
close
public void close()
- Specified by:
close
in interfaceStatefulBuildLog
-
dispose
public void dispose()
Same as close, but it does not attempt to persist messages buffer on disk, instead it just drops it. Should be used when build log won't be needed anymore.- Specified by:
dispose
in interfaceStatefulBuildLog
-
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interfaceStatefulBuildLog
-
getNextMessageIndex
@TestOnly public int getNextMessageIndex()
- Specified by:
getNextMessageIndex
in interfacePersisterFacade
-
refreshNextMessageIndex
public void refreshNextMessageIndex()
- Specified by:
refreshNextMessageIndex
in interfacePersisterFacade
-
remotePersistLogMessage
public int remotePersistLogMessage(@NotNull LogMessageInfo info)
- Specified by:
remotePersistLogMessage
in interfacePersisterFacade
-
remotePersistBlocksUpdate
public void remotePersistBlocksUpdate(@NotNull List<Integer> messageIndexes, @Nullable Status status, @Nullable Date finishTs)
- Specified by:
remotePersistBlocksUpdate
in interfacePersisterFacade
-
-