Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Add is drop policy applied method to StagedMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Skillington committed Jun 28, 2018
1 parent 4fd26f2 commit 145f75e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ func (sm StagedMetadata) IsDefault() bool {
return sm.CutoverNanos == 0 && !sm.Tombstoned && sm.Metadata.IsDefault()
}

// IsDropPolicyApplied returns whether this is the default staged metadata
// but with the drop policy applied.
func (sm StagedMetadata) IsDropPolicyApplied() bool {
return !sm.Tombstoned && sm.Metadata.IsDropPolicyApplied()
}

// ToProto converts the staged metadata to a protobuf message in place.
func (sm StagedMetadata) ToProto(pb *metricpb.StagedMetadata) error {
if err := sm.Metadata.ToProto(&pb.Metadata); err != nil {
Expand Down

0 comments on commit 145f75e

Please sign in to comment.