Example usage for org.apache.hadoop.io.retry RetryPolicies RETRY_FOREVER

List of usage examples for org.apache.hadoop.io.retry RetryPolicies RETRY_FOREVER

Introduction

In this page you can find the example usage for org.apache.hadoop.io.retry RetryPolicies RETRY_FOREVER.

Prototype

RetryPolicy RETRY_FOREVER

To view the source code for org.apache.hadoop.io.retry RetryPolicies RETRY_FOREVER.

Click Source Link

Document

Keep trying forever.

Usage

From source file:rpc.TestRPC.java

License:Apache License

@Test
public void testWrappedStopProxy() throws IOException {
    StoppedProtocol wrappedProxy = RPC.getProxy(StoppedProtocol.class, StoppedProtocol.versionID, null, conf);
    StoppedInvocationHandler invocationHandler = (StoppedInvocationHandler) Proxy
            .getInvocationHandler(wrappedProxy);

    StoppedProtocol proxy = (StoppedProtocol) RetryProxy.create(StoppedProtocol.class, wrappedProxy,
            RetryPolicies.RETRY_FOREVER);

    assertEquals(0, invocationHandler.getCloseCalled());
    RPC.stopProxy(proxy);/*  w ww. ja  v a 2 s  .  com*/
    assertEquals(1, invocationHandler.getCloseCalled());
}