From d0afc98fa17f43e186b0d2dfee2576c4187db740 Mon Sep 17 00:00:00 2001 From: marvin-j97 Date: Tue, 11 Jun 2024 16:58:23 +0200 Subject: [PATCH] change header magics --- src/segment/meta.rs | 2 +- src/segment/trailer.rs | 2 +- src/version.rs | 6 +++--- test_fixture/v1_vlog/.vlog | Bin 5 -> 5 bytes test_fixture/v1_vlog/segments/0 | Bin 433 -> 433 bytes 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/segment/meta.rs b/src/segment/meta.rs index b4375dc..d60ec59 100644 --- a/src/segment/meta.rs +++ b/src/segment/meta.rs @@ -6,7 +6,7 @@ use crate::{ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use std::io::{Read, Write}; -pub const METADATA_HEADER_MAGIC: &[u8] = &[b'F', b'J', b'L', b'L', b'S', b'M', b'D', b'1']; +pub const METADATA_HEADER_MAGIC: &[u8] = &[b'V', b'L', b'O', b'G', b'S', b'M', b'D', b'1']; #[derive(Debug)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] diff --git a/src/segment/trailer.rs b/src/segment/trailer.rs index a170fce..1c3e769 100644 --- a/src/segment/trailer.rs +++ b/src/segment/trailer.rs @@ -7,7 +7,7 @@ use std::{ path::Path, }; -pub const TRAILER_MAGIC: &[u8] = &[b'F', b'J', b'L', b'L', b'T', b'R', b'L', b'1']; +pub const TRAILER_MAGIC: &[u8] = &[b'V', b'L', b'O', b'G', b'T', b'R', b'L', b'1']; pub const TRAILER_SIZE: usize = 256; #[derive(Debug)] diff --git a/src/version.rs b/src/version.rs index a40b9b8..9c5e4ea 100644 --- a/src/version.rs +++ b/src/version.rs @@ -31,7 +31,7 @@ impl TryFrom for Version { } } -const MAGIC_BYTES: [u8; 3] = [b'F', b'J', b'L']; +const MAGIC_BYTES: [u8; 3] = [b'V', b'L', b'G']; impl Version { // NOTE: Used in tests @@ -79,14 +79,14 @@ mod tests { pub fn version_serialize() -> crate::Result<()> { let mut bytes = vec![]; Version::V1.write_file_header(&mut bytes)?; - assert_eq!(bytes, &[b'F', b'J', b'L', 0, 1]); + assert_eq!(bytes, &[b'V', b'L', b'G', 0, 1]); Ok(()) } #[test] #[allow(clippy::expect_used)] pub fn version_deserialize_success() { - let version = Version::parse_file_header(&[b'F', b'J', b'L', 0, 1]); + let version = Version::parse_file_header(&[b'V', b'L', b'G', 0, 1]); assert_eq!(version, Some(Version::V1)); } diff --git a/test_fixture/v1_vlog/.vlog b/test_fixture/v1_vlog/.vlog index 2073e5dd0ed44d0784b77c9a924a0958da4139c7..b0f7a741276772f45882c152370d4320f3115d18 100644 GIT binary patch literal 5 McmWIZac5uz00X%I>i_@% literal 5 McmZ?s@?l^E00VFU-T(jq diff --git a/test_fixture/v1_vlog/segments/0 b/test_fixture/v1_vlog/segments/0 index d49a831486d254188311ea5adac12edc75ec12f7..f6118761f3ce51bba081a89a5aa27845caabdd2c 100644 GIT binary patch delta 24 dcmdnUypefA7fYCrzx&2MX+{nZBP7Vj5CCOa2Ymnl delta 24 dcmdnUypefA7mJ&hkI%+FX+{nZBP7Vj5CCJl2VDRF