in code/KustoCopyConsole/Entity/InMemory/BlockCache.cs [9:33]
public BlockCache(
BlockRowItem item,
IImmutableDictionary<string, UrlCache> urlMap,
IImmutableDictionary<string, ExtentCache> extentMap)
: base(item)
{
UrlMap = urlMap;
ExtentMap = extentMap;
// Removes urls when a block is sent back to planning
if (item.State == BlockState.Planned)
{
UrlMap = ImmutableDictionary<string, UrlCache>.Empty;
}
// Removes extents when a block is sent back to exported
if (item.State == BlockState.Exported)
{
ExtentMap = ImmutableDictionary<string, ExtentCache>.Empty;
}
// Removes all children when a block is moved
if (item.State == BlockState.ExtentMoved)
{
UrlMap = ImmutableDictionary<string, UrlCache>.Empty;
ExtentMap = ImmutableDictionary<string, ExtentCache>.Empty;
}
}