Skip to content

Commit

Permalink
Exposing a couple LocalStorageDevice functions as protected
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfreiling committed Jun 21, 2019
1 parent 3aeb6e4 commit 25deb4e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cs/src/core/Device/LocalStorageDevice.cs
Expand Up @@ -153,12 +153,17 @@ public override void Close()
logHandle.Dispose();
}


private string GetSegmentName(int segmentId)
protected string GetSegmentName(int segmentId)
{
return FileName + "." + segmentId;
}

// Can be used to pre-load handles, e.g., after a checkpoint
protected SafeFileHandle GetOrAddHandle(int _segmentId)
{
return logHandles.GetOrAdd(_segmentId, segmentId => CreateHandle(segmentId));
}

private static uint GetSectorSize(string filename)
{
if (!Native32.GetDiskFreeSpace(filename.Substring(0, 3),
Expand Down Expand Up @@ -216,11 +221,6 @@ private SafeFileHandle CreateHandle(int segmentId)
return logHandle;
}

private SafeFileHandle GetOrAddHandle(int _segmentId)
{
return logHandles.GetOrAdd(_segmentId, segmentId => CreateHandle(segmentId));
}

/// Sets file size to the specified value.
/// Does not reset file seek pointer to original location.
private bool SetFileSize(string filename, SafeFileHandle logHandle, long size)
Expand Down

0 comments on commit 25deb4e

Please sign in to comment.