Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Condition.await()


               
                if (condition != null)
                {
                    try
                    {
                        condition.await(lockstep, TimeUnit.MILLISECONDS) ;
                    }
                    catch (final InterruptedException ie)
                    {
                        LOGGER.warn("Waiting delivery thread interupted while waiting on message pickup on InVM queue '" + serviceId + "'.  Exiting pickup wait state.") ;
                    }
View Full Code Here


            {
                public void run()
                {
                    try
                    {
                        condition.await();
                        onMemtableFlush(ctx);
                    }
                    catch (Exception e)
                    {
                        throw new RuntimeException(e);
View Full Code Here

       
        workqueue.schedule(doNothing, 5000);
       
        runLock.lock();
        try {
            runCondition.await();
        } finally {
            runLock.unlock();
        }
       
        assertTrue("expected delay",
View Full Code Here

      while ((callbacksReceived.get() < callbacksExpected.get())
              && !txnFail.get()) {
        timeRemaining = timeout - (System.nanoTime() - startTime);
        timeRemaining = (timeRemaining >= 0) ? timeRemaining : 0;
        try {
          if (!condition.await(timeRemaining, TimeUnit.NANOSECONDS)) {
            txnFail.set(true);
            logger.warn("HBase callbacks timed out. "
                    + "Transaction will be rolled back.");
          }
        } catch (Exception ex) {
View Full Code Here

       
        workqueue.schedule(doNothing, 5000);
       
        runLock.lock();
        try {
            runCondition.await();
        } finally {
            runLock.unlock();
        }
       
        assertTrue("expected delay",
View Full Code Here

        // XXX: hardcoded version numbers
        _conn.send(new ProtocolHeader(1, 0, 10));

        try
        {
            negotiationComplete.await(timeout, TimeUnit.MILLISECONDS);
            if (header != null)
            {
                _conn.close();
                throw new ProtocolVersionException(header.getMajor(), header.getMinor());
            }
View Full Code Here

            // while keeping the wait-for-flush (future.get) out of anything latency-sensitive.
            return commitLogUpdater_.submit(new WrappedRunnable()
            {
                public void runMayThrow() throws InterruptedException, IOException
                {
                    condition.await();
                    if (writeCommitLog)
                    {
                        // if we're not writing to the commit log, we are replaying the log, so marking
                        // the log header with "you can discard anything written before the context" is not valid
                        CommitLog.instance().discardCompletedSegments(table_, columnFamily_, ctx);
View Full Code Here

            // while keeping the wait-for-flush (future.get) out of anything latency-sensitive.
            return commitLogUpdater_.submit(new WrappedRunnable()
            {
                public void runMayThrow() throws InterruptedException, IOException
                {
                    condition.await();
                    if (writeCommitLog)
                    {
                        // if we're not writing to the commit log, we are replaying the log, so marking
                        // the log header with "you can discard anything written before the context" is not valid
                        CommitLog.instance().discardCompletedSegments(table_, columnFamily_, ctx);
View Full Code Here

                        Thread.currentThread().interrupt();
                    }
                }
                else if (info.isLockInterruptibly()) {
                    try {
                        condition.await();
                    }
                    catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
                    }
                }
View Full Code Here

      incrementWaiters(guard);
      try {
        final Condition condition = guard.condition;
        do {
          try {
            condition.await();
          } catch (InterruptedException interrupt) {
            try {
              signalConditionsOfSatisfiedGuards(guard);
            } catch (Throwable throwable) {
              Thread.currentThread().interrupt();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.