@@ -25,7 +25,12 @@ use itertools::Itertools;
25
25
use std:: sync:: Arc ;
26
26
27
27
use 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
+ } ;
29
34
use chrono:: NaiveDateTime ;
30
35
use std:: collections:: HashMap ;
31
36
@@ -109,7 +114,7 @@ pub fn get_schema_key(fields: &[Arc<Field>]) -> String {
109
114
format ! ( "{hash:x}" )
110
115
}
111
116
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 > {
113
118
let mut stream_metadata = PARSEABLE . streams . write ( ) . expect ( "lock poisoned" ) ;
114
119
115
120
let map = & mut stream_metadata
@@ -127,16 +132,13 @@ pub fn commit_schema(stream_name: &str, schema: Arc<Schema>) -> Result<(), Event
127
132
}
128
133
129
134
pub mod error {
130
- use arrow_schema:: ArrowError ;
131
135
132
136
use crate :: { parseable:: StagingError , storage:: ObjectStorageError } ;
133
137
134
138
#[ derive( Debug , thiserror:: Error ) ]
135
139
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 ) ,
140
142
#[ error( "ObjectStorage Error: {0}" ) ]
141
143
ObjectStorage ( #[ from] ObjectStorageError ) ,
142
144
}
0 commit comments