Search in sources :

Example 16 with PropertyEventShutdownCallback

use of com.linkedin.d2.discovery.event.PropertyEventThread.PropertyEventShutdownCallback in project rest.li by linkedin.

the class PropertyStoreTest method testShutdown.

@Test(groups = { "small", "back-end" })
public void testShutdown() throws InterruptedException, PropertyStoreException {
    PropertyStore<String> store = getStore();
    final CountDownLatch latch = new CountDownLatch(1);
    store.shutdown(new PropertyEventShutdownCallback() {

        @Override
        public void done() {
            latch.countDown();
        }
    });
    if (!latch.await(5, TimeUnit.SECONDS)) {
        fail("unable to shut down store");
    }
}
Also used : PropertyEventShutdownCallback(com.linkedin.d2.discovery.event.PropertyEventThread.PropertyEventShutdownCallback) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.testng.annotations.Test)

Aggregations

PropertyEventShutdownCallback (com.linkedin.d2.discovery.event.PropertyEventThread.PropertyEventShutdownCallback)16 CountDownLatch (java.util.concurrent.CountDownLatch)14 Test (org.testng.annotations.Test)7 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)5 Map (java.util.Map)5 None (com.linkedin.common.util.None)4 ClusterProperties (com.linkedin.d2.balancer.properties.ClusterProperties)4 ServiceProperties (com.linkedin.d2.balancer.properties.ServiceProperties)4 UriProperties (com.linkedin.d2.balancer.properties.UriProperties)4 LoadBalancerStrategy (com.linkedin.d2.balancer.strategies.LoadBalancerStrategy)4 URIRequest (com.linkedin.d2.balancer.util.URIRequest)4 RequestContext (com.linkedin.r2.message.RequestContext)4 TransportClientFactory (com.linkedin.r2.transport.common.TransportClientFactory)4 URI (java.net.URI)4 FutureCallback (com.linkedin.common.callback.FutureCallback)3 ServiceUnavailableException (com.linkedin.d2.balancer.ServiceUnavailableException)3 RewriteClient (com.linkedin.d2.balancer.clients.RewriteClient)3 PartitionData (com.linkedin.d2.balancer.properties.PartitionData)3 LoadBalancerStrategyFactory (com.linkedin.d2.balancer.strategies.LoadBalancerStrategyFactory)3