use RowsetFactory to create and init RowsetWriter #1740
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR contains the following changes
create_rowset_writeris added toRowsetFactory. All clients of RowsetWriter have been rewritten to use the factory method to obtain RowsetWriter instance.DEFAULT_ROWSET_TYPEis added to represent the default rowset type for newly generated rowset. Currently it's set ALPHA_ROWSET, but can be changed to BETA_ROWSET when V2 segment is ready to be released as the default type.Mergeris refactored to provides simpler interface to its clientsRowsetWriterSharedPtris removed and all clients are switched to unique_ptr.RowsetIdGenerator.next_id()is refactored to return RowsetId instead of OLAPStatus since the operation can't fail. It makes the client code much more cleaner.RETURN_NOT_OK_LOGis added to oneliner the common if-error-then-warn-and-return pattern.