Java Code Examples for org.apache.flink.shaded.netty4.io.netty.channel.ChannelFuture#isSuccess()

The following examples show how to use org.apache.flink.shaded.netty4.io.netty.channel.ChannelFuture#isSuccess() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PartitionRequestClientFactory.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	if (future.isSuccess()) {
		handInChannel(future.channel());
	}
	else if (future.cause() != null) {
		notifyOfError(new RemoteTransportException(
				"Connecting to remote task manager + '" + connectionId.getAddress() +
						"' has failed. This might indicate that the remote task " +
						"manager has been lost.",
				connectionId.getAddress(), future.cause()));
	}
	else {
		notifyOfError(new LocalTransportException(
			String.format(
				"Connecting to remote task manager '%s' has been cancelled.",
				connectionId.getAddress()),
			null));
	}
}
 
Example 2
Source File: PartitionRequestClientFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	if (future.isSuccess()) {
		handInChannel(future.channel());
	}
	else if (future.cause() != null) {
		notifyOfError(new RemoteTransportException(
				"Connecting to remote task manager + '" + connectionId.getAddress() +
						"' has failed. This might indicate that the remote task " +
						"manager has been lost.",
				connectionId.getAddress(), future.cause()));
	}
	else {
		notifyOfError(new LocalTransportException(
			String.format(
				"Connecting to remote task manager '%s' has been cancelled.",
				connectionId.getAddress()),
			null));
	}
}
 
Example 3
Source File: PartitionRequestClientFactory.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	if (future.isSuccess()) {
		handInChannel(future.channel());
	}
	else if (future.cause() != null) {
		notifyOfError(new RemoteTransportException(
				"Connecting to remote task manager + '" + connectionId.getAddress() +
						"' has failed. This might indicate that the remote task " +
						"manager has been lost.",
				connectionId.getAddress(), future.cause()));
	}
	else {
		notifyOfError(new LocalTransportException(
			String.format(
				"Connecting to remote task manager '%s' has been cancelled.",
				connectionId.getAddress()),
			null));
	}
}
 
Example 4
Source File: CreditBasedPartitionRequestClientHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	try {
		if (future.isSuccess()) {
			writeAndFlushNextMessageIfPossible(future.channel());
		} else if (future.cause() != null) {
			notifyAllChannelsOfErrorAndClose(future.cause());
		} else {
			notifyAllChannelsOfErrorAndClose(new IllegalStateException("Sending cancelled by user."));
		}
	} catch (Throwable t) {
		notifyAllChannelsOfErrorAndClose(t);
	}
}
 
Example 5
Source File: PartitionRequestQueue.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	try {
		if (future.isSuccess()) {
			writeAndFlushNextMessageIfPossible(future.channel());
		} else if (future.cause() != null) {
			handleException(future.channel(), future.cause());
		} else {
			handleException(future.channel(), new IllegalStateException("Sending cancelled by user."));
		}
	} catch (Throwable t) {
		handleException(future.channel(), t);
	}
}
 
Example 6
Source File: Client.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	if (future.isSuccess()) {
		handInChannel(future.channel());
	} else {
		close(future.cause());
	}
}
 
Example 7
Source File: AbstractServerHandler.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	long durationNanos = System.nanoTime() - creationNanos;
	long durationMillis = TimeUnit.MILLISECONDS.convert(durationNanos, TimeUnit.NANOSECONDS);

	if (future.isSuccess()) {
		LOG.debug("Request {} was successfully answered after {} ms.", request, durationMillis);
		stats.reportSuccessfulRequest(durationMillis);
	} else {
		LOG.debug("Request {} failed after {} ms due to: {}", request, durationMillis, future.cause());
		stats.reportFailedRequest();
	}
}
 
Example 8
Source File: CreditBasedPartitionRequestClientHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	try {
		if (future.isSuccess()) {
			writeAndFlushNextMessageIfPossible(future.channel());
		} else if (future.cause() != null) {
			notifyAllChannelsOfErrorAndClose(future.cause());
		} else {
			notifyAllChannelsOfErrorAndClose(new IllegalStateException("Sending cancelled by user."));
		}
	} catch (Throwable t) {
		notifyAllChannelsOfErrorAndClose(t);
	}
}
 
Example 9
Source File: PartitionRequestQueue.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	try {
		if (future.isSuccess()) {
			writeAndFlushNextMessageIfPossible(future.channel());
		} else if (future.cause() != null) {
			handleException(future.channel(), future.cause());
		} else {
			handleException(future.channel(), new IllegalStateException("Sending cancelled by user."));
		}
	} catch (Throwable t) {
		handleException(future.channel(), t);
	}
}
 
Example 10
Source File: Client.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	if (future.isSuccess()) {
		handInChannel(future.channel());
	} else {
		close(future.cause());
	}
}
 
Example 11
Source File: AbstractServerHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	long durationNanos = System.nanoTime() - creationNanos;
	long durationMillis = TimeUnit.MILLISECONDS.convert(durationNanos, TimeUnit.NANOSECONDS);

	if (future.isSuccess()) {
		LOG.debug("Request {} was successfully answered after {} ms.", request, durationMillis);
		stats.reportSuccessfulRequest(durationMillis);
	} else {
		LOG.debug("Request {} failed after {} ms due to: {}", request, durationMillis, future.cause());
		stats.reportFailedRequest();
	}
}
 
Example 12
Source File: CreditBasedPartitionRequestClientHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	try {
		if (future.isSuccess()) {
			writeAndFlushNextMessageIfPossible(future.channel());
		} else if (future.cause() != null) {
			notifyAllChannelsOfErrorAndClose(future.cause());
		} else {
			notifyAllChannelsOfErrorAndClose(new IllegalStateException("Sending cancelled by user."));
		}
	} catch (Throwable t) {
		notifyAllChannelsOfErrorAndClose(t);
	}
}
 
Example 13
Source File: PartitionRequestQueue.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	try {
		if (future.isSuccess()) {
			writeAndFlushNextMessageIfPossible(future.channel());
		} else if (future.cause() != null) {
			handleException(future.channel(), future.cause());
		} else {
			handleException(future.channel(), new IllegalStateException("Sending cancelled by user."));
		}
	} catch (Throwable t) {
		handleException(future.channel(), t);
	}
}
 
Example 14
Source File: Client.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	if (future.isSuccess()) {
		handInChannel(future.channel());
	} else {
		close(future.cause());
	}
}
 
Example 15
Source File: AbstractServerHandler.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public void operationComplete(ChannelFuture future) throws Exception {
	long durationNanos = System.nanoTime() - creationNanos;
	long durationMillis = TimeUnit.MILLISECONDS.convert(durationNanos, TimeUnit.NANOSECONDS);

	if (future.isSuccess()) {
		LOG.debug("Request {} was successfully answered after {} ms.", request, durationMillis);
		stats.reportSuccessfulRequest(durationMillis);
	} else {
		LOG.debug("Request {} failed after {} ms", request, durationMillis, future.cause());
		stats.reportFailedRequest();
	}
}