Update StorePartitionAccessor.cs

pull/4/head
Ogoun 1 year ago
parent b6d1d30d10
commit c9cbad6d33

@ -100,6 +100,8 @@ namespace ZeroLevel.Services.PartitionStorage
} }
} }
public IEnumerable<StorePartitionKeyValueSearchResult<TKey, TValue>> Iterate() public IEnumerable<StorePartitionKeyValueSearchResult<TKey, TValue>> Iterate()
{
if (Directory.Exists(_catalog))
{ {
TKey k; TKey k;
TValue v; TValue v;
@ -124,6 +126,7 @@ namespace ZeroLevel.Services.PartitionStorage
} }
} }
} }
}
public IEnumerable<StorePartitionKeyValueSearchResult<TKey, TValue>> IterateKeyBacket(TKey key) public IEnumerable<StorePartitionKeyValueSearchResult<TKey, TValue>> IterateKeyBacket(TKey key)
{ {
TKey k; TKey k;
@ -203,6 +206,8 @@ namespace ZeroLevel.Services.PartitionStorage
TKey k; TKey k;
TValue v; TValue v;
var filePath = Path.Combine(_catalog, fileName); var filePath = Path.Combine(_catalog, fileName);
if (File.Exists(filePath))
{
if (_options.Index.Enabled) if (_options.Index.Enabled)
{ {
var offsets = Indexes.GetOffset(keys, true); var offsets = Indexes.GetOffset(keys, true);
@ -287,11 +292,14 @@ namespace ZeroLevel.Services.PartitionStorage
} }
} }
} }
}
private void RemoveKeyGroup(string fileName, TKey[] keys, bool inverseRemove, bool autoReindex) private void RemoveKeyGroup(string fileName, TKey[] keys, bool inverseRemove, bool autoReindex)
{ {
TKey k; TKey k;
var filePath = Path.Combine(_catalog, fileName); var filePath = Path.Combine(_catalog, fileName);
if (File.Exists(filePath))
{
// 1. Find ranges // 1. Find ranges
var ranges = new List<FilePositionRange>(); var ranges = new List<FilePositionRange>();
if (_options.Index.Enabled && autoReindex) if (_options.Index.Enabled && autoReindex)
@ -425,6 +433,7 @@ namespace ZeroLevel.Services.PartitionStorage
RebuildFileIndex(filePath); RebuildFileIndex(filePath);
} }
} }
}
#endregion #endregion

Loading…
Cancel
Save

Powered by TurnKey Linux.