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

io.deepsense.neptune.clientlibrary.exceptions.channels.ChannelValueTooLargeException Maven / Gradle / Ivy

There is a newer version: 1.6.1
Show newest version
/**
 * Copyright (c) 2016, CodiLime Inc.
 */

package io.deepsense.neptune.clientlibrary.exceptions.channels;

import io.deepsense.neptune.clientlibrary.exceptions.common.NeptuneRuntimeException;

public class ChannelValueTooLargeException extends NeptuneRuntimeException {
    public ChannelValueTooLargeException(long channelValueSize, long maxAllowedSize) {
        super(String.format("Channel value of size %.2f exceeds %.2f limit and was dropped.",
                bytesToMegabytes(channelValueSize),
                bytesToMegabytes(maxAllowedSize)));
    }

    private static double bytesToMegabytes(long bytes) {
        final double bytesPerMegabyte = 1024.0 * 1024.0;
        return bytes / bytesPerMegabyte;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy