Sha256: b2904c542f8179aaebe22ec0e99821a31703f4e2a4d625e80ba167c546f30143

Contents?: true

Size: 764 Bytes

Versions: 4

Compression:

Stored size: 764 Bytes

Contents

package org.embulk.output.s3v2.util;

public class ThresholdComputation extends AbstractUnitComputation
{
    private ThresholdComputation()
    {
        // Do nothing.
    }

    public static boolean largerThanThreshold(String threshold, long computationTargetSize)
    {
        if (!validateValue(threshold)) {
            throw new IllegalArgumentException("Unrecognized value of multipart_threshold: " + threshold);
        }

        String thresholdSize = getSize(threshold);
        String thresholdUnit = getUnit(threshold);
        ComputeUnits e = ComputeUnits.valueOf(thresholdUnit.toUpperCase());
        double thresholdValue = (Double.valueOf(thresholdSize) * e.getUnit());

        return (double) computationTargetSize > thresholdValue;
    }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
embulk-output-s3v2-0.3.0 src/main/java/org/embulk/output/s3v2/util/ThresholdComputation.java
embulk-output-s3v2-0.2.1 src/main/java/org/embulk/output/s3v2/util/ThresholdComputation.java
embulk-output-s3v2-0.2.0 src/main/java/org/embulk/output/s3v2/util/ThresholdComputation.java
embulk-output-s3v2-0.1.0 src/main/java/org/embulk/output/s3v2/util/ThresholdComputation.java