use of io.aeron.exceptions.AeronException in project aeron by real-logic.
the class UdpChannelTransport method updateEndpoint.
/**
* Endpoint has moved to a new address. Handle this.
*
* @param newAddress to send data to.
* @param statusIndicator for the channel
*/
public void updateEndpoint(final InetSocketAddress newAddress, final AtomicCounter statusIndicator) {
try {
if (null != sendDatagramChannel) {
sendDatagramChannel.disconnect();
sendDatagramChannel.connect(newAddress);
connectAddress = newAddress;
if (null != statusIndicator) {
statusIndicator.setOrdered(ChannelEndpointStatus.ACTIVE);
}
}
} catch (final Exception ex) {
if (null != statusIndicator) {
statusIndicator.setOrdered(ChannelEndpointStatus.ERRORED);
}
final String message = "re-resolve endpoint channel error - " + ex.getMessage() + " (at " + ex.getStackTrace()[0].toString() + "): " + udpChannel.originalUriString();
throw new AeronException(message, ex);
}
}
use of io.aeron.exceptions.AeronException in project aeron by real-logic.
the class FileStoreLogFactory method checkStorage.
private void checkStorage(final long logLength) {
if (checkStorage) {
final long usableSpace = getUsableSpace();
if (usableSpace < logLength) {
throw new AeronException("insufficient usable storage for new log of length=" + logLength + " in " + fileStore);
}
if (usableSpace <= lowStorageWarningThreshold) {
final String msg = "space is running low: threshold=" + lowStorageWarningThreshold + " usable=" + usableSpace + " in " + fileStore;
errorHandler.onError(new AeronException(msg, AeronException.Category.WARN));
}
}
}
Aggregations