类org.apache.hadoop.io.retry.UnreliableInterface.FatalException源码实例Demo

下面列出了怎么用org.apache.hadoop.io.retry.UnreliableInterface.FatalException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hadoop   文件: TestRetryProxy.java
@Test
public void testRetryByException() throws UnreliableException {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByException(RETRY_FOREVER, exceptionToPolicyMap));
  unreliable.failsOnceThenSucceeds();
  try {
    unreliable.alwaysFailsWithFatalException();
    fail("Should fail");
  } catch (FatalException e) {
    // expected
  }
}
 
源代码2 项目: big-c   文件: TestRetryProxy.java
@Test
public void testRetryByException() throws UnreliableException {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByException(RETRY_FOREVER, exceptionToPolicyMap));
  unreliable.failsOnceThenSucceeds();
  try {
    unreliable.alwaysFailsWithFatalException();
    fail("Should fail");
  } catch (FatalException e) {
    // expected
  }
}
 
源代码3 项目: hadoop   文件: TestRetryProxy.java
@Test
public void testRetryByRemoteException() {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByRemoteException(RETRY_FOREVER, exceptionToPolicyMap));
  try {
    unreliable.alwaysFailsWithRemoteFatalException();
    fail("Should fail");
  } catch (RemoteException e) {
    // expected
  }
}
 
源代码4 项目: big-c   文件: TestRetryProxy.java
@Test
public void testRetryByRemoteException() {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByRemoteException(RETRY_FOREVER, exceptionToPolicyMap));
  try {
    unreliable.alwaysFailsWithRemoteFatalException();
    fail("Should fail");
  } catch (RemoteException e) {
    // expected
  }
}
 
源代码5 项目: RDFS   文件: TestRetryProxy.java
public void testRetryByException() throws UnreliableException {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByException(RETRY_FOREVER, exceptionToPolicyMap));
  unreliable.failsOnceThenSucceeds();
  try {
    unreliable.alwaysFailsWithFatalException();
    fail("Should fail");
  } catch (FatalException e) {
    // expected
  }
}
 
源代码6 项目: RDFS   文件: TestRetryProxy.java
public void testRetryByRemoteException() throws UnreliableException {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByRemoteException(RETRY_FOREVER, exceptionToPolicyMap));
  try {
    unreliable.alwaysFailsWithRemoteFatalException();
    fail("Should fail");
  } catch (RemoteException e) {
    // expected
  }
}
 
源代码7 项目: hadoop-gpu   文件: TestRetryProxy.java
public void testRetryByException() throws UnreliableException {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByException(RETRY_FOREVER, exceptionToPolicyMap));
  unreliable.failsOnceThenSucceeds();
  try {
    unreliable.alwaysFailsWithFatalException();
    fail("Should fail");
  } catch (FatalException e) {
    // expected
  }
}
 
源代码8 项目: hadoop-gpu   文件: TestRetryProxy.java
public void testRetryByRemoteException() throws UnreliableException {
  Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
    Collections.<Class<? extends Exception>, RetryPolicy>singletonMap(FatalException.class, TRY_ONCE_THEN_FAIL);
  
  UnreliableInterface unreliable = (UnreliableInterface)
    RetryProxy.create(UnreliableInterface.class, unreliableImpl,
                      retryByRemoteException(RETRY_FOREVER, exceptionToPolicyMap));
  try {
    unreliable.alwaysFailsWithRemoteFatalException();
    fail("Should fail");
  } catch (RemoteException e) {
    // expected
  }
}
 
 类所在包
 同包方法