Add Gitea NuGet publish workflow and finalize current storage/index/docs updates.
This commit is contained in:
@@ -16,6 +16,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using ZB.MOM.WW.CBDD.Core;
|
||||
|
||||
[assembly: InternalsVisibleTo("ZB.MOM.WW.CBDD.Tests")]
|
||||
|
||||
@@ -48,7 +49,7 @@ public class DocumentCollection<T> : DocumentCollection<ObjectId, T> where T : c
|
||||
/// </summary>
|
||||
/// <typeparam name="TId">Type of the primary key</typeparam>
|
||||
/// <typeparam name="T">Type of the entity</typeparam>
|
||||
public partial class DocumentCollection<TId, T> : IDisposable where T : class
|
||||
public partial class DocumentCollection<TId, T> : IDisposable, ICompactionAwareCollection where T : class
|
||||
{
|
||||
private readonly ITransactionHolder _transactionHolder;
|
||||
private readonly IStorageEngine _storage;
|
||||
@@ -130,15 +131,27 @@ public partial class DocumentCollection<TId, T> : IDisposable where T : class
|
||||
|
||||
private void RefreshPrimaryIndexRootFromMetadata()
|
||||
{
|
||||
_indexManager.RefreshFromStorageMetadata();
|
||||
|
||||
var primaryRootPageId = _indexManager.PrimaryRootPageId;
|
||||
if (primaryRootPageId == 0)
|
||||
var metadata = _storage.GetCollectionMetadata(_collectionName);
|
||||
if (metadata == null || metadata.PrimaryRootPageId == 0)
|
||||
return;
|
||||
|
||||
if (primaryRootPageId != _primaryIndex.RootPageId)
|
||||
if (metadata.PrimaryRootPageId != _primaryIndex.RootPageId)
|
||||
{
|
||||
_primaryIndex.SetRootPageId(primaryRootPageId);
|
||||
_primaryIndex.SetRootPageId(metadata.PrimaryRootPageId);
|
||||
}
|
||||
}
|
||||
|
||||
void ICompactionAwareCollection.RefreshIndexBindingsAfterCompaction()
|
||||
{
|
||||
var metadata = _storage.GetCollectionMetadata(_collectionName);
|
||||
if (metadata == null)
|
||||
return;
|
||||
|
||||
_indexManager.RebindFromMetadata(metadata);
|
||||
|
||||
if (metadata.PrimaryRootPageId != 0 && metadata.PrimaryRootPageId != _primaryIndex.RootPageId)
|
||||
{
|
||||
_primaryIndex.SetRootPageId(metadata.PrimaryRootPageId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user