com.amazonaws.services.kinesis.model.ProvisionedThroughputExceededException Java Examples

The following examples show how to use com.amazonaws.services.kinesis.model.ProvisionedThroughputExceededException. 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: KinesisProxy.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Determines whether the exception is recoverable using exponential-backoff.
 *
 * @param ex Exception to inspect
 * @return <code>true</code> if the exception can be recovered from, else
 *         <code>false</code>
 */
protected static boolean isRecoverableException(AmazonServiceException ex) {
	if (ex.getErrorType() == null) {
		return false;
	}

	switch (ex.getErrorType()) {
		case Client:
			return ex instanceof ProvisionedThroughputExceededException;
		case Service:
		case Unknown:
			return true;
		default:
			return false;
	}
}
 
Example #2
Source File: KinesisProxy.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Determines whether the exception is recoverable using exponential-backoff.
 *
 * @param ex Exception to inspect
 * @return <code>true</code> if the exception can be recovered from, else
 *         <code>false</code>
 */
protected static boolean isRecoverableException(AmazonServiceException ex) {
	if (ex.getErrorType() == null) {
		return false;
	}

	switch (ex.getErrorType()) {
		case Client:
			return ex instanceof ProvisionedThroughputExceededException;
		case Service:
		case Unknown:
			return true;
		default:
			return false;
	}
}
 
Example #3
Source File: KinesisProxy.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Determines whether the exception is recoverable using exponential-backoff.
 *
 * @param ex Exception to inspect
 * @return <code>true</code> if the exception can be recovered from, else
 *         <code>false</code>
 */
protected static boolean isRecoverableException(AmazonServiceException ex) {
	if (ex.getErrorType() == null) {
		return false;
	}

	switch (ex.getErrorType()) {
		case Client:
			return ex instanceof ProvisionedThroughputExceededException;
		case Service:
		case Unknown:
			return true;
		default:
			return false;
	}
}
 
Example #4
Source File: KinesisProxyTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test
public void testIsRecoverableExceptionWithProvisionedThroughputExceeded() {
	final ProvisionedThroughputExceededException ex = new ProvisionedThroughputExceededException("asdf");
	ex.setErrorType(ErrorType.Client);
	assertTrue(KinesisProxy.isRecoverableException(ex));
}
 
Example #5
Source File: KinesisProxyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testIsRecoverableExceptionWithProvisionedThroughputExceeded() {
	final ProvisionedThroughputExceededException ex = new ProvisionedThroughputExceededException("asdf");
	ex.setErrorType(ErrorType.Client);
	assertTrue(KinesisProxy.isRecoverableException(ex));
}
 
Example #6
Source File: SimplifiedKinesisClientTest.java    From beam with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldHandleProvisionedThroughputExceededExceptionForGetShardIterator() {
  shouldHandleGetShardIteratorError(
      new ProvisionedThroughputExceededException(""), KinesisClientThrottledException.class);
}
 
Example #7
Source File: SimplifiedKinesisClientTest.java    From beam with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldHandleProvisionedThroughputExceededExceptionForShardListing() {
  shouldHandleShardListingError(
      new ProvisionedThroughputExceededException(""), KinesisClientThrottledException.class);
}
 
Example #8
Source File: SimplifiedKinesisClientTest.java    From beam with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldHandleProvisionedThroughputExceededExceptionForGetBacklogBytes() {
  shouldHandleGetBacklogBytesError(
      new ProvisionedThroughputExceededException(""), KinesisClientThrottledException.class);
}
 
Example #9
Source File: KinesisProxyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testIsRecoverableExceptionWithProvisionedThroughputExceeded() {
	final ProvisionedThroughputExceededException ex = new ProvisionedThroughputExceededException("asdf");
	ex.setErrorType(ErrorType.Client);
	assertTrue(KinesisProxy.isRecoverableException(ex));
}