Skip to content

Commit

Permalink
Remove pcommon.Immutable*Slice and related funcs (#6107)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan <bogdandrutu@gmail.com>

Signed-off-by: Bogdan <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored Sep 16, 2022
1 parent 84621e4 commit 70110ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
- Delete deprecated `pcommon.Value.SetBytesVal`. (#6088)
- Delete deprecated `pmetric.Metric.SetDataType`. (#6095)
- Delete deprecated `plog.LogRecord.[Set]FlagStruct` funcs. (#6100)
- Delete deprecated `pcommon.ImmutableByteSlice` and `pcommon.NewImmutableByteSlice`. (#6107)
- Delete deprecated `pcommon.ImmutableFloat64Slice` and `pcommon.NewImmutableFloat64Slice`. (#6107)
- Delete deprecated `pcommon.ImmutableUInt64Slice` and `pcommon.NewImmutableUInt64Slice`. (#6107)

### 🚩 Deprecations 🚩

Expand Down
32 changes: 1 addition & 31 deletions pdata/pcommon/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (v Value) SliceVal() Slice {
return newSlice(&arr.Values)
}

// BytesVal returns the ImmutableByteSlice value associated with this Value.
// BytesVal returns the ByteSlice value associated with this Value.
// If the Type() is not ValueTypeBytes then returns an invalid ByteSlice object. Note that using
// such slice can cause panic.
//
Expand Down Expand Up @@ -822,33 +822,3 @@ func (es Slice) FromRaw(rawSlice []interface{}) {
}
*es.getOrig() = origs
}

// Deprecated: [0.60.0] Use ByteSlice instead.
type ImmutableByteSlice = ByteSlice

// NewImmutableByteSlice creates a new ByteSlice by copying the provided []byte slice.
// Deprecated: [0.60.0] Use New{structName}() and {structName}.FromRaw([]byte) instead
func NewImmutableByteSlice(from []byte) ByteSlice {
orig := copyByteSlice(nil, from)
return ByteSlice(internal.NewByteSlice(&orig))
}

// Deprecated: [0.60.0] Use Float64Slice instead.
type ImmutableFloat64Slice = Float64Slice

// NewImmutableFloat64Slice creates a new Float64Slice by copying the provided []float64 slice.
// Deprecated: [0.60.0] Use New{structName}() and {structName}.FromRaw([]float64) instead
func NewImmutableFloat64Slice(from []float64) Float64Slice {
orig := copyFloat64Slice(nil, from)
return Float64Slice(internal.NewFloat64Slice(&orig))
}

// Deprecated: [0.60.0] Use UInt64Slice instead.
type ImmutableUInt64Slice = UInt64Slice

// NewImmutableUInt64Slice creates a new UInt64Slice by copying the provided []uint64 slice.
// Deprecated: [0.60.0] Use New{structName}() and {structName}.FromRaw([]uint64) instead
func NewImmutableUInt64Slice(from []uint64) UInt64Slice {
orig := copyUInt64Slice(nil, from)
return UInt64Slice(internal.NewUInt64Slice(&orig))
}

0 comments on commit 70110ee

Please sign in to comment.