Wait until a scan of the table completes without seeing notifications AND without the Oracle
issuing any timestamps during the scan.
18452
private static void waitUntilFinished(FluoConfiguration config) {
    try (Environment env = new Environment(config)) {
      List<TableRange> ranges = getRanges(env);

      outer: while (true) {
        long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp();
        for (TableRange range : ranges) {
          boolean sawNotifications = waitTillNoNotifications(env, range);
          if (sawNotifications) {
            ranges = getRanges(env);
            // This range had notifications. Processing those notifications may have created
            // notifications in previously scanned ranges, so start over.
            continue outer;
          }
        }
        long ts2 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp();

        // Check to ensure the Oracle issued no timestamps during the scan for notifications.
        if (ts2 - ts1 == 1) {
          break;
        }
      }
    } catch (Exception e) {
      log.error("An exception was thrown -", e);
      System.exit(-1);
    }
  }
464990
private void waitForAsyncSendCompletion() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "waitForAsyncSendCompletion");

        while (!(_asyncSendQueue.isEmpty() && (currentAsyncSendObject == null))) {
            try {
                synchronized (_asyncSendQueue) {
                    // after twenty second.. again check is made if the async send queue is empty.
                    //the sleep time is precautinary measure.. to avoid a futuristic scenario in which notification would not come.
                    _asyncSendQueue.wait(1000 * 20);
                }
            } catch (InterruptedException e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(tc, "waitForAsyncSendCompletion got interrupted", e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "waitForAsyncSendCompletion");
    }
556569
protected void waitingNotify()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "waitingNotify");

        this.lock();
        try
        {
            if (_waiting)
                _waiter.signal();
        } finally
        {
            this.unlock();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "waitingNotify");
    }
457390
def wait(self, dwMilliseconds = None):
        
        if self.value is None:
            raise ValueError("Handle is already closed!")
        if dwMilliseconds is None:
            dwMilliseconds = INFINITE
        r = WaitForSingleObject(self.value, dwMilliseconds)
        if r != WAIT_OBJECT_0:
            raise ctypes.WinError(r)
401907
def wait_for_completion(self, interval=1):
        

        while not self.is_terminated(retry=True):
            try:
                time.sleep(interval)
            except KeyboardInterrupt:
                break
486947
def _WaitForStatusNotRunning(self):
    """"""
    # We wait slightly longer than the status check sleep time.
    time.sleep(2.0)
    time_slept = 2.0
    while self._status_is_running:
      time.sleep(0.5)
      time_slept += 0.5
      if time_slept >= self._PROCESS_JOIN_TIMEOUT:
        break
441251
def wait(self, till=None):
        
        waiter = Signal()
        if self.waiting:
            DEBUG and _Log.note("waiting with {{num}} others on {{name|quote}}", num=len(self.waiting), name=self.name, stack_depth=1)
            self.waiting.insert(0, waiter)
        else:
            DEBUG and _Log.note("waiting by self on {{name|quote}}", name=self.name)
            self.waiting = [waiter]

        try:
            self.lock.release()
            DEBUG and _Log.note("out of lock {{name|quote}}", name=self.name)
            (waiter | till).wait()
            if DEBUG:
                _Log.note("done minimum wait (for signal {{till|quote}})", till=till.name if till else "", name=self.name)
        except Exception as e:
            if not _Log:
                _late_import()
            _Log.warning("problem", cause=e)
        finally:
            self.lock.acquire()
            DEBUG and _Log.note("re-acquired lock {{name|quote}}", name=self.name)

        try:
            self.waiting.remove(waiter)
            DEBUG and _Log.note("removed own signal from {{name|quote}}", name=self.name)
        except Exception:
            pass

        return bool(waiter)
1067704
def wait_while(self, condition, *args, **kw):
    
    return self.wait_for(lambda: not condition(), *args, **kw)
900066
def wait_till_page_load(self,driver,max_wait_time):
		'''
			
		'''
		sleepCount = max_wait_time		# wait for a fixed max_wait_time only 

		# A page that's fully loaded has the word 'Current Status'

		while self.tracking_no not in driver.page_source and 'Invalid Input' not in driver.page_source:		
			sleep(1)
			sleepCount -= 1
			if sleepCount is 0:
				raise Exception('Request timed out!')
441130
private ScanResult scan(ScanRequest scanRequest) {
        m_logger.debug("Performing scan() request on table {}", scanRequest.getTableName());
        
        Timer timer = new Timer();
        boolean bSuccess = false;
        ScanResult scanResult = null;
        for (int attempts = 1; !bSuccess; attempts++) {
            try {
                scanResult = m_ddbClient.scan(scanRequest);
                if (attempts > 1) {
                    m_logger.info("scan() succeeded on attempt #{}", attempts);
                }
                bSuccess = true;
                m_logger.debug("Time to scan table {}: {}", scanRequest.getTableName(), timer.toString());
            } catch (ProvisionedThroughputExceededException e) {
                if (attempts >= m_max_read_attempts) {
                    String errMsg = "All retries exceeded; abandoning scan() for table: " + scanRequest.getTableName();
                    m_logger.error(errMsg, e);
                    throw new RuntimeException(errMsg, e);
                }
                m_logger.warn("scan() attempt #{} failed: {}", attempts, e);
                try {
                    Thread.sleep(attempts * m_retry_wait_millis);
                } catch (InterruptedException ex2) {
                    // ignore
                }
            }
        }
        return scanResult;
    }
183255
function ensureTimestamps(columns, allowSyncedAt) {
  var now = Date.now();
  if (!allowSyncedAt || !columns.syncedAt) {
    columns.syncedAt = now;
  }
  if (!columns.createdAt) {
    // Take the value from the client, if present:
    columns.createdAt = columns.updatedAt;
  }
}
550996
function checkTable(count) {
      // Make sure we don't go into an infinite loop
      if (++count > 1000) return cb(new Error('Wait limit exceeded'))

      self.describeTable(function(err, data) {
        if (err) return cb(err)
        if (data.TableStatus !== 'ACTIVE' || (data.GlobalSecondaryIndexes &&
            !data.GlobalSecondaryIndexes.every(function (idx) {return idx.IndexStatus === 'ACTIVE'}))) {
          return setTimeout(checkTable, 1000, count)
        }

        // If the table is ACTIVE then return
        cb(null, data)
      })
    }
608523
synchronized TriggerData popPair() {

        if (rowsQueued == 0) {
            try {
                wait();    // this releases the lock monitor
            } catch (InterruptedException e) {

                /* ignore and resume */
            }
        }

        rowsQueued--;

        notify();    // notify push's wait

        if (pendingQueue.size() == 0) {
            return null;
        } else {
            return (TriggerData) pendingQueue.removeFirst();
        }
    }
1285592
def wait_until_done(self):
        
        wait = 1
        while True:
            time.sleep(wait)
            self.get_info()
            if self.info['status']['isFinished']:
                break
            # implements a crude exponential back off
            wait = min(wait * 2, 60)
1305393
def wait(self):
        
        self._write_footer()
        super(ColumnFormat, self).wait()
        self._write_header()
373012
public void waitWhileRunning(long ms) {

        int i = 0;
        // wait until it is done or time is over
        synchronized (this) {
            try {
                Thread.sleep(100); // wait a bit to give the publish engine the chance to actualize the state
            } catch (InterruptedException e) {
                // ignore
                e.printStackTrace();
            }
            while (isRunning() && ((MS_ONE_SECOND * i) <= ms)) {
                try {
                    Thread.sleep(MS_ONE_SECOND); // wait a second
                } catch (InterruptedException e) {
                    // ignore
                    e.printStackTrace();
                }
                i++;
            }
        }
    }
904778
def wait_until_table_is_available(full_table_name, delay = 5, max_attempts = 5)
      puts "Waiting for Table #{full_table_name} to be available."
      puts "Waiting with a #{delay} second delay between attempts, for a maximum of #{max_attempts} attempts."
      max_time = Time.at(delay * max_attempts).utc.strftime('%H:%M:%S')
      puts "Max waiting time will be: #{max_time} (approximate)."
      # wait until the table has updated to being fully available
      # waiting for ~2min at most; an error will be thrown afterwards

      started_waiting_at = Time.now
      max_attempts.times do |attempt|
        puts "Attempt #{attempt + 1}/#{max_attempts}, \
        #{Time.at(Time.now - started_waiting_at).utc.strftime('%H:%M:%S')}/#{max_time}"

        details = retrieve_table_details(full_table_name)

        if details.table_status != 'ACTIVE'
          puts "Table: #{full_table_name} is not yet available. Status: #{details.table_status}. Retrying..."
        else
          updating_indexes = details.global_secondary_indexes.reject do |global_index|
            global_index.index_status == 'ACTIVE'
          end
          return true if updating_indexes.empty?
          puts 'Table is available, but the global indexes are not:'
          puts(updating_indexes.map { |global_index| "#{global_index.index_name}, #{global_index.index_status}" })
        end
        Kernel.sleep(delay.seconds)
      end

      raise Exception, "Table #{full_table_name} did not become available after #{max_attempts} attempts. " \
        'Try again later or inspect the AWS console.'
    end