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 voidclose()static StatefulBuildLogcreate(String buildLogId, BuildLogMessagesPersister messagesPersister, boolean initLog, boolean canRecoverBuildLog)static StatefulBuildLogcreateForService(String buildLogId)voiddispose()Same as close, but it does not attempt to persist messages buffer on disk, instead it just drops it.intgetNextMessageIndex()booleanhasNotFlushedMessages()booleanisClosed()voidrefreshNextMessageIndex()voidremotePersistBlocksUpdate(List<Integer> messageIndexes, Status status, Date finishTs)intremotePersistLogMessage(LogMessageInfo info)IdRangereserveAnchorsRange(int rangeSize)StateSynchronizationResultsynchronizeState(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.StringtoString()
-
-
-
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:StatefulBuildLogAccepts unprocessed messages, logs them and returns an update for build-log state snapshot.- Specified by:
synchronizeStatein 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:
reserveAnchorsRangein interfaceStatefulBuildLog- Throws:
AnchorsReservationException
-
hasNotFlushedMessages
public boolean hasNotFlushedMessages()
- Specified by:
hasNotFlushedMessagesin interfaceStatefulBuildLog
-
close
public void close()
- Specified by:
closein 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:
disposein interfaceStatefulBuildLog
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceStatefulBuildLog
-
getNextMessageIndex
@TestOnly public int getNextMessageIndex()
- Specified by:
getNextMessageIndexin interfacePersisterFacade
-
refreshNextMessageIndex
public void refreshNextMessageIndex()
- Specified by:
refreshNextMessageIndexin interfacePersisterFacade
-
remotePersistLogMessage
public int remotePersistLogMessage(@NotNull LogMessageInfo info)- Specified by:
remotePersistLogMessagein interfacePersisterFacade
-
remotePersistBlocksUpdate
public void remotePersistBlocksUpdate(@NotNull List<Integer> messageIndexes, @Nullable Status status, @Nullable Date finishTs)- Specified by:
remotePersistBlocksUpdatein interfacePersisterFacade
-
-