chore: update flatbuffers to 2.0

pull/24376/head
Marco Neumann 2021-07-13 15:44:45 +02:00
parent f5c63b2ae6
commit 157a0cc98c
7 changed files with 39 additions and 19 deletions

17
Cargo.lock generated
View File

@ -133,7 +133,7 @@ dependencies = [
"cfg_aliases",
"chrono",
"csv",
"flatbuffers",
"flatbuffers 0.8.4",
"hex",
"indexmap",
"lazy_static",
@ -1021,7 +1021,7 @@ version = "0.1.0"
dependencies = [
"chrono",
"data_types",
"flatbuffers",
"flatbuffers 2.0.0",
"generated_types",
"influxdb_line_protocol",
"internal_types",
@ -1101,6 +1101,17 @@ dependencies = [
"thiserror",
]
[[package]]
name = "flatbuffers"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef4c5738bcd7fad10315029c50026f83c9da5e4a21f8ed66826f43e0e2bde5f6"
dependencies = [
"bitflags",
"smallvec",
"thiserror",
]
[[package]]
name = "flate2"
version = "1.0.20"
@ -3771,7 +3782,7 @@ dependencies = [
"datafusion 0.1.0",
"datafusion_util",
"entry",
"flatbuffers",
"flatbuffers 2.0.0",
"futures",
"futures-util",
"generated_types",

View File

@ -10,7 +10,7 @@ chrono = { version = "0.4", features = ["serde"] }
data_types = { path = "../data_types" }
# See docs/regenerating_flatbuffers.md about updating generated code when updating the
# version of the flatbuffers crate
flatbuffers = "0.8"
flatbuffers = "2"
snafu = "0.6"
influxdb_line_protocol = { path = "../influxdb_line_protocol" }
ouroboros = "0.8.3"

View File

@ -18,7 +18,7 @@
# the commit SHA where the `version` metadata was updated to the version of the `flatbuffers`
# crate we now want to have in our `Cargo.lock`.
# - Put that commit SHA in this variable:
FB_COMMIT="86401e078d0746d2381735415f8c2dfe849f3f52"
FB_COMMIT="a9a295fecf3fbd5a4f571f53b01f63202a3e2113"
# - Run this script to regenerate the corresponding Rust code.
# - Run `cargo test` to make sure everything works as you would expect.
# - Check in the changes to the generated code along with your changes to the `Cargo.lock` file and

View File

@ -123,7 +123,7 @@ fn build_sharded_entry(
partitions: BTreeMap<String, BTreeMap<&str, Vec<&ParsedLine<'_>>>>,
default_time: i64,
) -> Result<ShardedEntry> {
let mut fbb = flatbuffers::FlatBufferBuilder::new_with_capacity(1024);
let mut fbb = flatbuffers::FlatBufferBuilder::with_capacity(1024);
let partition_writes = partitions
.into_iter()

View File

@ -4,7 +4,7 @@ use std::cmp::Ordering;
use std::mem;
extern crate flatbuffers;
use self::flatbuffers::EndianScalar;
use self::flatbuffers::{EndianScalar, Follow};
#[allow(unused_imports, dead_code)]
pub mod influxdata {
@ -13,7 +13,7 @@ pub mod influxdata {
use std::mem;
extern crate flatbuffers;
use self::flatbuffers::EndianScalar;
use self::flatbuffers::{EndianScalar, Follow};
#[allow(unused_imports, dead_code)]
pub mod iox {
@ -21,7 +21,7 @@ pub mod influxdata {
use std::mem;
extern crate flatbuffers;
use self::flatbuffers::EndianScalar;
use self::flatbuffers::{EndianScalar, Follow};
#[allow(unused_imports, dead_code)]
pub mod write {
@ -29,7 +29,7 @@ pub mod influxdata {
use std::mem;
extern crate flatbuffers;
use self::flatbuffers::EndianScalar;
use self::flatbuffers::{EndianScalar, Follow};
#[allow(unused_imports, dead_code)]
pub mod v_1 {
@ -37,7 +37,7 @@ pub mod influxdata {
use std::mem;
extern crate flatbuffers;
use self::flatbuffers::EndianScalar;
use self::flatbuffers::{EndianScalar, Follow};
#[deprecated(
since = "2.0.0",
@ -93,7 +93,7 @@ pub mod influxdata {
type Inner = Self;
#[inline]
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
let b = unsafe { flatbuffers::read_scalar_at::<u8>(buf, loc) };
Self(b)
}
}
@ -102,7 +102,9 @@ pub mod influxdata {
type Output = Operation;
#[inline]
fn push(&self, dst: &mut [u8], _rest: &[u8]) {
flatbuffers::emplace_scalar::<u8>(dst, self.0);
unsafe {
flatbuffers::emplace_scalar::<u8>(dst, self.0);
}
}
}
@ -113,6 +115,7 @@ pub mod influxdata {
Self(b)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(self) -> Self {
let b = u8::from_le(self.0);
Self(b)
@ -193,7 +196,7 @@ pub mod influxdata {
type Inner = Self;
#[inline]
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i8>(buf, loc);
let b = unsafe { flatbuffers::read_scalar_at::<i8>(buf, loc) };
Self(b)
}
}
@ -202,7 +205,9 @@ pub mod influxdata {
type Output = LogicalColumnType;
#[inline]
fn push(&self, dst: &mut [u8], _rest: &[u8]) {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
unsafe {
flatbuffers::emplace_scalar::<i8>(dst, self.0);
}
}
}
@ -213,6 +218,7 @@ pub mod influxdata {
Self(b)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(self) -> Self {
let b = i8::from_le(self.0);
Self(b)
@ -307,7 +313,7 @@ pub mod influxdata {
type Inner = Self;
#[inline]
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
let b = unsafe { flatbuffers::read_scalar_at::<u8>(buf, loc) };
Self(b)
}
}
@ -316,7 +322,9 @@ pub mod influxdata {
type Output = ColumnValues;
#[inline]
fn push(&self, dst: &mut [u8], _rest: &[u8]) {
flatbuffers::emplace_scalar::<u8>(dst, self.0);
unsafe {
flatbuffers::emplace_scalar::<u8>(dst, self.0);
}
}
}
@ -327,6 +335,7 @@ pub mod influxdata {
Self(b)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(self) -> Self {
let b = u8::from_le(self.0);
Self(b)

View File

@ -9,7 +9,7 @@ bytes = { version = "1.0", features = ["serde"] }
data_types = { path = "../data_types" }
# See docs/regenerating_flatbuffers.md about updating generated code when updating the
# version of the flatbuffers crate
#flatbuffers = "0.8"
#flatbuffers = "2"
futures = "0.3"
google_types = { path = "../google_types" }
observability_deps = { path = "../observability_deps" }

View File

@ -18,7 +18,7 @@ datafusion_util = { path = "../datafusion_util" }
entry = { path = "../entry" }
# See docs/regenerating_flatbuffers.md about updating generated code when updating the
# version of the flatbuffers crate
flatbuffers = "0.8"
flatbuffers = "2"
futures = "0.3"
futures-util = { version = "0.3.1" }
generated_types = { path = "../generated_types" }