-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streaming snapshot checkpoint in Tsavorite (#824)
* Mild refactor in preparation * updates * updates * updates * fix tests to not cover steaming snapshot as it is not a traditional checkpoint * add unit test * fix tests * fix test * updates * Support maxAddress during liveness checks * improvements to api * Add SetVersion API * more checks * add comment * add comments
- Loading branch information
Showing
32 changed files
with
1,169 additions
and
517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
libs/storage/Tsavorite/cs/src/core/Allocator/IStreamingSnapshotIteratorFunctions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using System; | ||
|
||
namespace Tsavorite.core | ||
{ | ||
/// <summary> | ||
/// Callback functions for streaming snapshot iteration | ||
/// </summary> | ||
public interface IStreamingSnapshotIteratorFunctions<TKey, TValue> | ||
{ | ||
/// <summary>Iteration is starting.</summary> | ||
/// <param name="checkpointToken">Checkpoint token</param> | ||
/// <param name="currentVersion">Current version of database</param> | ||
/// <param name="targetVersion">Target version of database</param> | ||
/// <returns>True to continue iteration, else false</returns> | ||
bool OnStart(Guid checkpointToken, long currentVersion, long targetVersion); | ||
|
||
/// <summary>Next record in the streaming snapshot.</summary> | ||
/// <param name="key">Reference to the current record's key</param> | ||
/// <param name="value">Reference to the current record's Value</param> | ||
/// <param name="recordMetadata">Record metadata, including <see cref="RecordInfo"/> and the current record's logical address</param> | ||
/// <param name="numberOfRecords">The number of records returned so far, not including the current one.</param> | ||
/// <returns>True to continue iteration, else false</returns> | ||
bool Reader(ref TKey key, ref TValue value, RecordMetadata recordMetadata, long numberOfRecords); | ||
|
||
/// <summary>Iteration is complete.</summary> | ||
/// <param name="completed">If true, the iteration completed; else OnStart() or Reader() returned false to stop the iteration.</param> | ||
/// <param name="numberOfRecords">The number of records returned before the iteration stopped.</param> | ||
void OnStop(bool completed, long numberOfRecords); | ||
|
||
/// <summary>An exception was thrown on iteration (likely during <see name="Reader"/>.</summary> | ||
/// <param name="exception">The exception that was thrown.</param> | ||
/// <param name="numberOfRecords">The number of records returned before the exception.</param> | ||
void OnException(Exception exception, long numberOfRecords); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.