Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Add StorageDeviceBase.OmitSegmentIdFromFilename #824

Merged
merged 3 commits into from
Apr 22, 2023

Conversation

TedHartMS
Copy link
Contributor

No description provided.

@TedHartMS TedHartMS requested a review from badrishc April 20, 2023 22:42
@@ -53,7 +53,7 @@ public TieredStorageDevice(int commitPoint, params IDevice[] devices) : this(com
{
}

public override void Initialize(long segmentSize, LightEpoch epoch)
public override void Initialize(long segmentSize, LightEpoch epoch, bool omitSegmentIdFromFileName = false)
{
base.Initialize(segmentSize, epoch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call base with omitSegmentIdFromFileName

/// </summary>
/// <param name="segmentSize"></param>
/// <param name="epoch"></param>
public override void Initialize(long segmentSize, LightEpoch epoch)
/// <param name="omitSegmentIdFromFileName"></param>
public override void Initialize(long segmentSize, LightEpoch epoch, bool omitSegmentIdFromFileName = false)
{
base.Initialize(segmentSize, epoch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call base.Initialize with omitSegmentIdFromFileName

@@ -138,19 +138,20 @@ internal static IDevice CreateTestDevice(DeviceType testDeviceType, string filen
#if NETSTANDARD || NET
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // avoids CA1416 // Validate platform compatibility
#endif
device = new LocalStorageDevice(filename, preallocateFile, deleteOnClose, disableFileBuffering, capacity, recoverDevice, useIoCompletionPort);
device = new LocalStorageDevice(filename, preallocateFile, deleteOnClose, disableFileBuffering, capacity, recoverDevice, useIoCompletionPort, omitSegmentIdFromFilename: omitSegmentIdFromFilename);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is omitSegmentIdFromFileName is both constructor and Initialize? which one take precedence if they put true in contructor and omit (default false) in the Initialize.

@badrishc badrishc merged commit ae75953 into main Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants