File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ const SINGLE_ELEMENT_SIZE: usize = IRIS_CODE_LENGTH * mem::size_of::<u16>() * 2
10
10
+ MASK_CODE_LENGTH * mem:: size_of :: < u16 > ( ) * 2
11
11
+ mem:: size_of :: < u32 > ( ) ; // 75 KB
12
12
13
- // Size of each exported chunk. This is only used to allocate the vec for
14
- // storing all records in a chunk. If the chunk is larger than this specified
15
- // size, it will only lead to more allocations.
16
- const CHUNK_SIZE : usize = 1 << 30 ; // 1 GB
17
-
18
13
#[ async_trait]
19
14
pub trait ObjectStore : Send + Sync + ' static {
20
15
async fn get_object ( & self , key : & str ) -> eyre:: Result < ByteStream > ;
@@ -140,7 +135,7 @@ pub async fn fetch_and_parse_chunks(
140
135
let result_stream = stream:: iter ( chunks)
141
136
. map ( move |chunk| async move {
142
137
let mut object_stream = store. get_object ( & chunk) . await ?. into_async_read ( ) ;
143
- let mut records = Vec :: with_capacity ( CHUNK_SIZE / SINGLE_ELEMENT_SIZE ) ;
138
+ let mut records = Vec :: with_capacity ( last_snapshot_details . chunk_size as usize ) ;
144
139
let mut buf = vec ! [ 0u8 ; SINGLE_ELEMENT_SIZE ] ;
145
140
loop {
146
141
match object_stream. read_exact ( & mut buf) . await {
You can’t perform that action at this time.
0 commit comments