All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.bulkload.BulkLoadConfig Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.bulkload;

import cz.proto.ingestion.v2.IngestionV2;

public class BulkLoadConfig {

  private static final long MAX_NUM_ROWS_PER_FILE = 64 << 20;
  private static final long MAX_FILE_SIZE_IN_BYTES_PER_FILE = 256 << 20;

  private final IngestionV2.BulkLoadStreamWriterConfig config;

  public BulkLoadConfig(IngestionV2.BulkLoadStreamWriterConfig config) {
    this.config = config;
  }

  public StagingConfig getStagingConfig() {
    return ProtoUtils.fromProtoV2(config.getStagingPath());
  }

  public FileFormatType getFileFormat() {
    return ProtoUtils.fromProto(config.getFileFormat());
  }

  public long getMaxNumRowsPerFile() {
    return config.getMaxNumRowsPerFile() > 0 ?
      config.getMaxNumRowsPerFile() : MAX_NUM_ROWS_PER_FILE;
  }

  public long getMaxFileSizeInBytesPerFile() {
    return config.getMaxSizeInBytesPerFile() > 0 ?
      config.getMaxSizeInBytesPerFile() : MAX_FILE_SIZE_IN_BYTES_PER_FILE;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy