io.deepsense.neptune.clientlibrary.exceptions.channels.ChannelValueTooLargeException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-client-library Show documentation
Show all versions of neptune-client-library Show documentation
Enables integration with Neptune in your Java code
/**
* 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