Package java.util.concurrent

Examples of java.util.concurrent.TimeoutException


                    @Override
                    public Path call() throws Exception {
                        LOG.info("Wait: resolve @" + label);
                        latch.countDown();
                        if (latch.await(5, TimeUnit.SECONDS) == false) {
                            throw new TimeoutException();
                        }
                        LOG.info("Start: resolve @" + label);
                        Path result = cache.resolve(path);

                        LOG.info("Finish: resolve @" + label);
                        return result;
                    }
                }));
            }
            executor.shutdown();
            if (executor.awaitTermination(30, TimeUnit.SECONDS) == false) {
                throw new TimeoutException();
            }
        } finally {
            executor.shutdownNow();
        }
        for (Future<Path> future : futures) {
View Full Code Here


    public Socket get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        time = timeout;
        tu = unit;
        try {
            if (!latch.await(timeout, unit) || te != null) {
                throw te == null ? new TimeoutException() : te;
            }
        } finally {
            te = null;
        }
        return socket;
View Full Code Here

import java.util.concurrent.TimeoutException;

public class C5 {

  public static void m() throws TimeoutException {
    throw new TimeoutException();
  }
View Full Code Here

        if (!success)
        {
            StringBuilder sb = new StringBuilder("");
            for (Message message : resolver.getMessages())
                sb.append(message.getFrom()).append(", ");
            throw new TimeoutException("Operation timed out - received only " + received.get() + " responses from " + sb.toString() + " .");
        }

        return blockfor == 1 ? resolver.getData() : resolver.resolve();
    }
View Full Code Here

        while ((res & ClientSession.CLOSED) == 0) {
            nbTrials ++;
            s.authPassword("smx", "buggy");
            res = s.waitFor(ClientSession.CLOSED | ClientSession.WAIT_AUTH, 5000);
            if (res == ClientSession.TIMEOUT) {
                throw new TimeoutException();
            }
        }
        assertTrue(nbTrials > 10);
    }
View Full Code Here

                }
            }
            System.out.println("Waiting for server to appear on port: " + port);
            Thread.sleep(1000);           
        }
        throw new TimeoutException();
    }
View Full Code Here

      if (totalSpaceVariance < CAPACITY_ALLOWED_VARIANCE
          && usedSpaceVariance < CAPACITY_ALLOWED_VARIANCE)
        break; //done

      if (Time.now() > failtime) {
        throw new TimeoutException("Cluster failed to reached expected values of "
            + "totalSpace (current: " + status[0]
            + ", expected: " + expectedTotalSpace
            + "), or usedSpace (current: " + status[1]
            + ", expected: " + expectedUsedSpace
            + "), in more than " + timeout + " msec.");
View Full Code Here

        double nodeUtilization = ((double)datanode.getDfsUsed())
            / datanode.getCapacity();
        if (Math.abs(avgUtilization - nodeUtilization) > BALANCE_ALLOWED_VARIANCE) {
          balanced = false;
          if (Time.now() > failtime) {
            throw new TimeoutException(
                "Rebalancing expected avg utilization to become "
                + avgUtilization + ", but on datanode " + datanode
                + " it remains at " + nodeUtilization
                + " after more than " + TIMEOUT + " msec.");
          }
View Full Code Here

      if (totalSpaceVariance < CAPACITY_ALLOWED_VARIANCE
          && usedSpaceVariance < CAPACITY_ALLOWED_VARIANCE)
        break; //done

      if (System.currentTimeMillis() > failtime) {
        throw new TimeoutException("Cluster failed to reached expected values of "
            + "totalSpace (current: " + status[0]
            + ", expected: " + expectedTotalSpace
            + "), or usedSpace (current: " + status[1]
            + ", expected: " + expectedUsedSpace
            + "), in more than " + timeout + " msec.");
View Full Code Here

            / datanode.getCapacity();
        if (Math.abs(avgUtilization - nodeUtilization) >
            BALANCE_ALLOWED_VARIANCE) {
          balanced = false;
          if (System.currentTimeMillis() > failtime) {
            throw new TimeoutException(
                "Rebalancing expected avg utilization to become "
                + avgUtilization + ", but on datanode " + datanode
                + " it remains at " + nodeUtilization
                + " after more than " + TIMEOUT + " msec.");
          }
View Full Code Here

TOP

Related Classes of java.util.concurrent.TimeoutException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.