Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
koculu committed Jun 17, 2023
1 parent 17e1730 commit 6be1888
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/ZoneTree/Collections/BTree/BTree.FrozenNodeIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public FrozenNodeIterator SeekFirstKeyGreaterOrEqual(
/// <summary>
/// Finds the position of element that is smaller or equal than key.
/// </summary>
/// <param name="comparer">The key comparer</param>
/// <param name="key">The key</param>
/// <returns>-1 or a valid position</returns>
public int GetLastSmallerOrEqualPosition(
Expand All @@ -118,6 +119,7 @@ public int GetLastSmallerOrEqualPosition(
/// <summary>
/// Finds the position of element that is greater or equal than key.
/// </summary>
/// <param name="comparer">The key comparer</param>
/// <param name="key">The key</param>
/// <returns>The length of the segment or a valid position</returns>
public int GetFirstGreaterOrEqualPosition(
Expand Down
2 changes: 2 additions & 0 deletions src/ZoneTree/Collections/BTree/BTree.NodeIterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public NodeIterator SeekFirstKeyGreaterOrEqual(
/// <summary>
/// Finds the position of element that is smaller or equal than key.
/// </summary>
/// <param name="comparer">The key comparer</param>
/// <param name="key">The key</param>
/// <returns>-1 or a valid position</returns>
public int GetLastSmallerOrEqualPosition(
Expand All @@ -153,6 +154,7 @@ public int GetLastSmallerOrEqualPosition(
/// <summary>
/// Finds the position of element that is greater or equal than key.
/// </summary>
/// <param name="comparer">The key comparer</param>
/// <param name="key">The key</param>
/// <returns>The length of the segment or a valid position</returns>
public int GetFirstGreaterOrEqualPosition(
Expand Down
2 changes: 1 addition & 1 deletion src/ZoneTree/Collections/FixedSizeMinHeap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void Clear()
/// Inserts the new element, maintaining the heap property.
///
/// If the element is greater than the current min element, this function returns
// false without modifying the heap. Otherwise, it returns true.
/// false without modifying the heap. Otherwise, it returns true.
/// </summary>
/// <param name="key"></param>
/// <returns>true if inserted</returns>
Expand Down
8 changes: 7 additions & 1 deletion src/ZoneTree/Collections/TimSort/TimSort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ internal sealed class TimSort<T>
/// <summary>
/// Creates a TimSort instance to maintain the state of an ongoing sort.
/// </summary>
/// <param name="comparer">The key comparer</param>
/// <param name="a">The array to be sorted.</param>
/// <param name="work">An optional workspace array.</param>
private TimSort(T[] a, T[] work, IRefComparer<T> comparer)
Expand Down Expand Up @@ -703,6 +704,7 @@ private T[] EnsureCapacity(int minCapacity)
/// <param name="lo">The index of the first element in the range to be sorted.</param>
/// <param name="hi">the index after the last element in the range to be sorted.</param>
/// <param name="start">he index of the first element in the range that is not already known to be sorted.</param>
/// <param name="comparer">The key comparer</param>
private static void BinarySort(T[] arr, int lo, int hi, int start, IRefComparer<T> comparer)
{
Debug.Assert(lo <= start && start <= hi);
Expand Down Expand Up @@ -779,7 +781,8 @@ private static void BinarySort(T[] arr, int lo, int hi, int start, IRefComparer<
/// <param name="a">The array in which a run is to be counted and possibly reversed.</param>
/// <param name="lo">Index of the first element in the run.</param>
/// <param name="hi">index after the last element that may be contained in the run. It is required that <code>lo &lt; hi</code>.</param>
/// <returns>The length of the run beginning at the specified position in the specified array.</returns>
/// <param name="comparer">The key comparer</param>
/// /// <returns>The length of the run beginning at the specified position in the specified array.</returns>
private static int CountRunAndMakeAscending(T[] a, int lo, int hi, IRefComparer<T> comparer)
{
Debug.Assert(lo < hi);
Expand Down Expand Up @@ -836,6 +839,7 @@ internal static void ReverseRange(T[] a, int lo, int hi)
/// Sorts the given array.
/// </summary>
/// <param name="arr">The array to be sorted.</param>
/// <param name="comparer">The key comparer</param>
internal static void Sort(T[] arr, IRefComparer<T> comparer)
{
Sort(arr, 0, arr.Length, null, comparer);
Expand All @@ -847,6 +851,7 @@ internal static void Sort(T[] arr, IRefComparer<T> comparer)
/// <param name="arr">The array to be sorted.</param>
/// <param name="index">The starting index of the range to sort.</param>
/// <param name="length">The number of elements in the range to sort.</param>
/// <param name="comparer">The key comparer</param>
internal static void Sort(T[] arr, int index, int length, IRefComparer<T> comparer)
{
Sort(arr, index, length, null, comparer);
Expand All @@ -860,6 +865,7 @@ internal static void Sort(T[] arr, int index, int length, IRefComparer<T> compar
/// <param name="index">The starting index of the range to sort.</param>
/// <param name="length">The number of elements in the range to sort.</param>
/// <param name="work">An optional workspace array.</param>
/// <param name="comparer">The key comparer</param>
internal static void Sort(T[] arr, int index, int length, T[] work, IRefComparer<T> comparer)
{
Debug.Assert(arr is not null && index >= 0 && length >= 0 && index + length <= arr.Length);
Expand Down
2 changes: 2 additions & 0 deletions src/ZoneTree/Collections/TimSort/TimSortUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ internal static int MinRunLength(int n, int minMerge)
/// <param name="len">The length of the range; must be &gt; 0</param>
/// <param name="hint">Hint the index at which to begin the search, 0 &lt;= hint &lt; n.
/// The closer hint is to the result, the faster this method will run.</param>
/// <param name="comparer">The key comparer</param>
internal static int GallopLeft<K>(K key, K[] a, int baseIdx, int len, int hint, IRefComparer<K> comparer)
{
Debug.Assert(len > 0 && hint >= 0 && hint < len);
Expand Down Expand Up @@ -132,6 +133,7 @@ internal static int GallopLeft<K>(K key, K[] a, int baseIdx, int len, int hint,
/// <param name="len">The length of the range; must be &gt; 0.</param>
/// <param name="hint">The index at which to begin the search, 0 &lt;= hint &lt; n.
/// The closer hint is to the result, the faster this method will run.</param>
/// <param name="comparer">The key comparer</param>
/// <returns>The int k, 0 &lt;= k &lt;= n such that a[b + k - 1] &lt;= key &lt; a[b + k]</returns>
internal static int GallopRight<K>(K key, K[] a, int baseIdx, int len, int hint, IRefComparer<K> comparer)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ZoneTree/Compression/BrotliDataCompression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public static class BrotliDataCompression
{
public static byte[] Compress(Span<byte> span, int level)
{
/// Brotli Optimum level is extremely slow.
/// Changing the optimum level to fastest!
// Brotli Optimum level is extremely slow.
// Changing the optimum level to fastest!
if (level == 0)
level = 1;
using var msOutput = new MemoryStream();
Expand Down
1 change: 1 addition & 0 deletions src/ZoneTree/Core/ZoneTree.Iterators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public IZoneTreeIterator<TKey, TValue> CreateReadOnlySegmentsIterator(bool autoR
/// Creates an iterator that enables scanning of the in-memory segments.
/// This includes read-only segments and mutable segment.
/// </summary>
/// <param name="autoRefresh">if true, auto refresh is enabled.</param>
/// <param name="includeDeletedRecords">if true the deleted records are included in iteration.</param>
/// <returns>ZoneTree Iterator</returns>
public IZoneTreeIterator<TKey, TValue>
Expand Down
2 changes: 1 addition & 1 deletion src/ZoneTree/Options/DiskSegmentMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum DiskSegmentMode : byte
{
/// <summary>
/// Disk segments are kept in single file.
/// Recommended for db size < sizeof(int) x 10M
/// Recommended for db size &lt; sizeof(int) x 10M
/// </summary>
SingleDiskSegment = 0,

Expand Down
22 changes: 11 additions & 11 deletions src/ZoneTree/Transactional/BasicTransactionLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,19 @@ public void CompactTransactionLog()
// the uncommitted transaction that depends on the aborted one.
DeleteAbortedTransactions(aborted, uncommitted);

/// 3. We can delete the entire history of
/// the aborted and committed transactions.
/// Because we require the history just
/// for the rollback operation of uncommitted transactions.
/// Committed and aborted transactions can not be rollbacked at all.
// 3. We can delete the entire history of
// the aborted and committed transactions.
// Because we require the history just
// for the rollback operation of uncommitted transactions.
// Committed and aborted transactions can not be rollbacked at all.
DeleteHistoryOfAbortedAndCommittedTransactions();

/// 4. We can delete all aborted transactions read-write stamps.
/// we can delete committed transaction read-write stamps
/// up to the first uncommitted transaction id to not to break the skip write rule.
/// Because the Rollback operation depends
/// on equality of uncommitted transaction write stamps.
/// rollback cancel condition: readWriteStamp.WriteStamp != uncommittedTransactionId
// 4. We can delete all aborted transactions read-write stamps.
// we can delete committed transaction read-write stamps
// up to the first uncommitted transaction id to not to break the skip write rule.
// Because the Rollback operation depends
// on equality of uncommitted transaction write stamps.
// rollback cancel condition: readWriteStamp.WriteStamp != uncommittedTransactionId
var minimumUncommittedTransactionId = uncommitted.Count == 0 ? long.MaxValue : uncommitted.Min();
DeleteReadWriteStampsOfAbortedAndCommitted(minimumUncommittedTransactionId);

Expand Down
7 changes: 0 additions & 7 deletions src/ZoneTree/ZoneTree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

<PropertyGroup Condition="'$(Configuration)' == 'ReleaseWithDoc'">
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<LogFile>bin\docfx.log.txt</LogFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -40,12 +39,6 @@
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'ReleaseWithDoc'">
<PackageReference Include="docfx.console" Version="2.59.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="K4os.Compression.LZ4" Version="1.3.5" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
Expand Down

0 comments on commit 6be1888

Please sign in to comment.