-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructured fileexporter to prepare for group_by (#31068)
**Description:** In fileexporter: restructured code by splitting out two functionality from `fileExporter`: marshalling and compression logic was moved to `marshaller`, and logic related to writing to file and buffering writes was moved to, `fileWriter`. This pr introduces no changes to the behavior. The restructure was made in preparation for adding the new group_by functionality (see linked ticket for more detail). **Link to tracking Issue:** #24654 **Testing:** Tests have been updated for the new structure. No tests were added or modified beyond the structural changes. **Documentation:** This pr introduces no user-facing changes.
- Loading branch information
1 parent
3185573
commit 9365b33
Showing
7 changed files
with
391 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package fileexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" | ||
|
||
import ( | ||
"context" | ||
|
||
"go.opentelemetry.io/collector/component" | ||
) | ||
|
||
// errorComponent is used to return error from a factory method. SharedComponent does | ||
// not handle errors, so wrapping the error into a component is necessary. | ||
type errorComponent struct { | ||
err error | ||
} | ||
|
||
// Start will return the cached error. | ||
func (e *errorComponent) Start(context.Context, component.Host) error { | ||
return e.err | ||
} | ||
|
||
// Shutdown will return the cached error. | ||
func (e *errorComponent) Shutdown(context.Context) error { | ||
return e.err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.