This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
The following commit(s) were added to refs/heads/main by this push:
new dcdadc4 chore: add license header to fix ci (#123)
dcdadc4 is described below
commit dcdadc423224cd7935112ec2d350a905614aee62
Author: yuxia Luo <[email protected]>
AuthorDate: Sat Jan 3 15:07:55 2026 +0800
chore: add license header to fix ci (#123)
---
crates/fluss/src/row/compacted/compacted_row_writer.rs | 8 +++++---
crates/fluss/src/row/compacted/mod.rs | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/crates/fluss/src/row/compacted/compacted_row_writer.rs
b/crates/fluss/src/row/compacted/compacted_row_writer.rs
index 7c0adde..2debab1 100644
--- a/crates/fluss/src/row/compacted/compacted_row_writer.rs
+++ b/crates/fluss/src/row/compacted/compacted_row_writer.rs
@@ -21,19 +21,21 @@ use std::cmp;
// Writer for CompactedRow
// Reference implementation:
//
https://github.com/apache/fluss/blob/d4a72fad240d4b81563aaf83fa3b09b5058674ed/fluss-common/src/main/java/org/apache/fluss/row/compacted/CompactedRowWriter.java#L71
+#[allow(dead_code)]
pub struct CompactedRowWriter {
header_size_in_bytes: usize,
position: usize,
buffer: BytesMut,
}
+#[allow(dead_code)]
impl CompactedRowWriter {
pub const MAX_INT_SIZE: usize = 5;
pub const MAX_LONG_SIZE: usize = 10;
pub fn new(field_count: usize) -> Self {
// bitset width in bytes, it should be in CompactedRow
- let header_size = (field_count + 7) / 8;
+ let header_size = field_count.div_ceil(8);
let cap = cmp::max(64, header_size);
let mut buffer = BytesMut::with_capacity(cap);
@@ -90,7 +92,7 @@ impl CompactedRowWriter {
}
pub fn write_byte(&mut self, value: u8) {
- self.write_raw(&[value as u8]);
+ self.write_raw(&[value]);
}
pub fn write_binary(&mut self, bytes: &[u8], length: usize) {
@@ -106,7 +108,7 @@ impl CompactedRowWriter {
self.write_raw(value);
}
- pub fn write_char(&mut self, value: &str, length: usize) {
+ pub fn write_char(&mut self, value: &str, _length: usize) {
// TODO: currently, we encoding CHAR(length) as the same with STRING,
the length info can be
// omitted and the bytes length should be enforced in the future.
self.write_string(value);
diff --git a/crates/fluss/src/row/compacted/mod.rs
b/crates/fluss/src/row/compacted/mod.rs
index b9bc66b..695cdad 100644
--- a/crates/fluss/src/row/compacted/mod.rs
+++ b/crates/fluss/src/row/compacted/mod.rs
@@ -1 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
mod compacted_row_writer;