Tags: tidwall/wal
Tags
Include AllowEmpty option and IsEmpty method This commit includes the AllowEmpty option which allows for deleting all entries from the log using the TruncateFront and TruncateBack methods. Using AllowEmpty changes the behavior of the log as it relates to FirstIndex and LastIndex in the following ways: - An empty log will now always have the FirstIndex be equal to LastIndex+1. Witout AllowEmpty, FirstIndex can never be greater than LastIndex. - For a newly created log that has no entries, FirstIndex() and LastIndex() return 1 and 0, respectively. Without AllowEmpty, both return 0. Also in this commit: - IsEmpty method, which returns true if the log has no entries - More unit tests - Various code cleanup See #31
PreviousNext