@@ -25,7 +25,12 @@ use itertools::Itertools;
2525use std:: sync:: Arc ;
2626
2727use self :: error:: EventError ;
28- use crate :: { metadata:: update_stats, parseable:: PARSEABLE , storage:: StreamType , LOCK_EXPECT } ;
28+ use crate :: {
29+ metadata:: update_stats,
30+ parseable:: { StagingError , PARSEABLE } ,
31+ storage:: StreamType ,
32+ LOCK_EXPECT ,
33+ } ;
2934use chrono:: NaiveDateTime ;
3035use std:: collections:: HashMap ;
3136
@@ -109,7 +114,7 @@ pub fn get_schema_key(fields: &[Arc<Field>]) -> String {
109114 format ! ( "{hash:x}" )
110115}
111116
112- pub fn commit_schema ( stream_name : & str , schema : Arc < Schema > ) -> Result < ( ) , EventError > {
117+ pub fn commit_schema ( stream_name : & str , schema : Arc < Schema > ) -> Result < ( ) , StagingError > {
113118 let mut stream_metadata = PARSEABLE . streams . write ( ) . expect ( "lock poisoned" ) ;
114119
115120 let map = & mut stream_metadata
@@ -127,16 +132,13 @@ pub fn commit_schema(stream_name: &str, schema: Arc<Schema>) -> Result<(), Event
127132}
128133
129134pub mod error {
130- use arrow_schema:: ArrowError ;
131135
132136 use crate :: { parseable:: StagingError , storage:: ObjectStorageError } ;
133137
134138 #[ derive( Debug , thiserror:: Error ) ]
135139 pub enum EventError {
136- #[ error( "Stream Writer Failed: {0}" ) ]
137- StreamWriter ( #[ from] StagingError ) ,
138- #[ error( "Stream Writer Failed: {0}" ) ]
139- Arrow ( #[ from] ArrowError ) ,
140+ #[ error( "Staging Failed: {0}" ) ]
141+ Staging ( #[ from] StagingError ) ,
140142 #[ error( "ObjectStorage Error: {0}" ) ]
141143 ObjectStorage ( #[ from] ObjectStorageError ) ,
142144 }
0 commit comments