Skip to content

Commit

Permalink
Actually be lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimahriman committed Jan 7, 2024
1 parent e0fc13b commit 1939dfa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/hdfs-native/src/hdfs/datanode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,11 @@ impl StripedBlockWriter {
.zip(self.block_writers.iter_mut())
.enumerate()
{
// Don't create the blocks on the data nodes until there's actually data for it
if data.is_empty() {
continue;
}

if writer.is_none() {
let mut cloned = self.block.clone();
cloned.b.block_id += index as u64;
Expand Down

0 comments on commit 1939dfa

Please sign in to comment.