@@ -251,7 +251,7 @@ private void initVCFReader() {
251
251
252
252
// Get the memory budget, if specified.
253
253
Optional <Integer > memoryBudget = options .getMemoryBudget ();
254
- int memBudgetMB = DEFAULT_MEM_BUDGET_MB ;
254
+ long memBudgetMB = DEFAULT_MEM_BUDGET_MB ;
255
255
if (memoryBudget .isPresent ()) {
256
256
memBudgetMB = memoryBudget .get ();
257
257
}
@@ -264,7 +264,7 @@ private void initVCFReader() {
264
264
memBudgetMB /= 2 ;
265
265
266
266
// Compute allocation size; check against some reasonable minimum.
267
- int bufferSizeMB = ((memBudgetMB * 1024 * 1024 ) / nBuffers ) / (1024 * 1024 );
267
+ long bufferSizeMB = ((memBudgetMB * 1024 * 1024 ) / nBuffers ) / (1024 * 1024 );
268
268
if (bufferSizeMB < 10 ) {
269
269
log .warn (
270
270
"Warning: TileDB-VCF-Spark buffer allocation of "
@@ -274,7 +274,7 @@ private void initVCFReader() {
274
274
+ " MB." );
275
275
}
276
276
277
- int bufferSizeBytes = bufferSizeMB * (1024 * 1024 );
277
+ long bufferSizeBytes = bufferSizeMB * (1024 * 1024 );
278
278
279
279
releaseArrowVectors ();
280
280
for (int idx = 0 ; idx < numColumns ; idx ++) {
@@ -283,7 +283,7 @@ private void initVCFReader() {
283
283
}
284
284
}
285
285
286
- vcfReader .setMemoryBudget (memBudgetMB );
286
+ vcfReader .setMemoryBudget (( int ) memBudgetMB );
287
287
288
288
if (enableStatsLogging ) {
289
289
log .info (
@@ -304,12 +304,12 @@ private void initVCFReader() {
304
304
* attributes have multiple buffers allocated (data values, offsets), in which case this size
305
305
* is used for all buffers individually.
306
306
*/
307
- private void allocateAndSetBuffer (String fieldName , String attrName , int attributeBufferSize ) {
307
+ private void allocateAndSetBuffer (String fieldName , String attrName , long attributeBufferSize ) {
308
308
VCFReader .AttributeTypeInfo info = vcfReader .getAttributeDatatype (attrName );
309
309
310
310
// Max number of rows is nbytes / sizeof(int32_t), i.e. the max number of offsets that can be
311
311
// stored.
312
- int maxNumRows = attributeBufferSize / 4 ;
312
+ int maxNumRows = ( int ) ( attributeBufferSize / 4 ) ;
313
313
314
314
// Allocate an Arrow-backed buffer for the attribute.
315
315
ValueVector valueVector = makeArrowVector (fieldName , info );
0 commit comments