mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-10 07:12:54 +00:00
refactor(storage): remove unused FlushIo variant (#1002)
refactor(storeage): remove unused FlushIo variant
This commit is contained in:
@@ -44,12 +44,6 @@ pub enum Error {
|
||||
backtrace: Backtrace,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to write columns, source: {}", source))]
|
||||
FlushIo {
|
||||
source: object_store::Error,
|
||||
backtrace: Backtrace,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to write parquet file, source: {}", source))]
|
||||
WriteParquet {
|
||||
source: parquet::errors::ParquetError,
|
||||
@@ -466,8 +460,7 @@ impl ErrorExt for Error {
|
||||
| EncodeArrow { .. }
|
||||
| ParseSchema { .. } => StatusCode::Unexpected,
|
||||
|
||||
FlushIo { .. }
|
||||
| WriteParquet { .. }
|
||||
WriteParquet { .. }
|
||||
| ReadObject { .. }
|
||||
| WriteObject { .. }
|
||||
| ListObjects { .. }
|
||||
@@ -530,27 +523,6 @@ mod tests {
|
||||
assert!(err.backtrace_opt().is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_flush_error() {
|
||||
fn throw_io_error() -> std::result::Result<(), std::io::Error> {
|
||||
Err(std::io::Error::new(
|
||||
std::io::ErrorKind::UnexpectedEof,
|
||||
"writer is closed",
|
||||
))
|
||||
}
|
||||
|
||||
let error = throw_io_error()
|
||||
.map_err(|err| {
|
||||
object_store::Error::new(object_store::ErrorKind::Unexpected, "writer close failed")
|
||||
.set_source(err)
|
||||
})
|
||||
.context(FlushIoSnafu)
|
||||
.err()
|
||||
.unwrap();
|
||||
assert_eq!(StatusCode::StorageUnavailable, error.status_code());
|
||||
assert!(error.backtrace_opt().is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_arrow_error() {
|
||||
fn throw_arrow_error() -> std::result::Result<(), ArrowError> {
|
||||
|
||||
Reference in New Issue
Block a user