Compute a list of queues that were updated in this transaction set
764467
public synchronized List<LocalQueue> updatedQueues()
    {
    	List<LocalQueue> updatedQueues = new ArrayList<>(items.size());
    	for (int i = 0 ; i < items.size() ; i++)
        {
    		TransactionItem item = items.get(i);
            LocalQueue localQueue = item.getDestination();
            if (!updatedQueues.contains(localQueue))
                updatedQueues.add(localQueue);
        }
    	
    	return updatedQueues;
    }
632101
def all_active(cls):
        

        prefix = context.get_current_config()["redis_prefix"]
        queues = []
        for key in context.connections.redis.keys():
            if key.startswith(prefix):
                queues.append(Queue(key[len(prefix) + 3:]))

        return queues
1212733
def MempoolCheck(self):
        
        txs = []
        values = self.MemPool.values()
        for tx in values:
            txs.append(tx)

        for tx in txs:
            res = self.RemoveTransaction(tx)
            if res:
                logger.debug("found tx 0x%s on the blockchain ...removed from mempool" % tx.Hash)
325551
def UpdateFlows(self,
                  client_id_flow_id_pairs,
                  pending_termination=db.Database.unchanged,
                  cursor=None):
    """"""

    if pending_termination == db.Database.unchanged:
      return

    serialized_termination = pending_termination.SerializeToString()
    query = "UPDATE flows SET pending_termination=%s WHERE "
    args = [serialized_termination]
    for index, (client_id, flow_id) in enumerate(client_id_flow_id_pairs):
      query += ("" if index == 0 else " OR ") + " client_id=%s AND flow_id=%s"
      args.extend(
          [db_utils.ClientIDToInt(client_id),
           db_utils.FlowIDToInt(flow_id)])
    cursor.execute(query, args)
201405
public void flushUpdate()
    {
        for (int i = 0; i < numberOfQueues; i++)
        {
            if (!dbUpdateLists[i].isEmpty())
            {
                this.submitTaskToQueue(this.createUpdateTask(dbUpdateLists[i], fileUpdateLists[i]), i, processedUpdates);
                this.dbUpdateLists[i] = new ArrayList(batchSize);
                this.fileUpdateLists[i] = new ArrayList(batchSize);
                this.updatesQueued++;
            }
        }
    }
69745
def multi_rpush(self, queue, values, bulk_size=0, transaction=False):
        '''  '''
        # Check that what we receive is iterable
        if hasattr(values, '__iter__'):
            self._multi_rpush_pipeline(self, queue, values, 0)
        else:
            raise ValueError('Expected an iterable')
221297
def _parse_queue_list(list_output):
    '''
    
    '''
    queues = dict((q.split('/')[-1], q) for q in list_output['stdout'])
    return queues
1062524
def run_queues(self):
        """"""

        if self.exception:
            # pylint: disable=raising-bad-type
            raise self.exception
        listeners = self.__listeners_for_thread
        return sum(l.process() for l in listeners) > 0
329661
@Nullable
    public List<Transaction> getTransactions() {
        return transactions == null ? null : ImmutableList.copyOf(transactions);
    }
1299114
private int getCurrentValuesFromCache(List<CounterUpdateCell> counterUpdateCells,
                                          ColumnFamilyStore cfs,
                                          ClockAndCount[] currentValues)
    {
        int cacheMisses = 0;
        for (int i = 0; i < counterUpdateCells.size(); i++)
        {
            ClockAndCount cached = cfs.getCachedCounter(key(), counterUpdateCells.get(i).name());
            if (cached != null)
                currentValues[i] = cached;
            else
                cacheMisses++;
        }
        return cacheMisses;
    }
1332946
def flush(self):
        
        if self.buffer is None:
            return
        data = self.buffer
        self.buffer = []
        for x in self.dests:
            yield from x.enqueue_task(self, *data)
32236
def updateIfNeeded(self):
        """"""
        headBlock = self.db.reader._get_head_block()
        if headBlock is not None:
            # avoid restarting search if head block is same & we already initialized
            # this is required for fastSync handling
            if self.lastBlock is not None:
                self.lastBlock = max(self.lastBlock, headBlock.number)
            else:
                self.lastBlock = headBlock.number
        lastProcessed = self.db.reader._get_last_indexed_number()
        if lastProcessed is not None:
            self.lastProcessedBlock = utils.big_endian_to_int(lastProcessed)

        # in fast sync head block is at 0 (e.g. in fastSync), we can't use it to determine length
        if self.lastBlock is not None and self.lastBlock == 0:
            self.lastBlock = 2e9

        if self.lastBlock is None or (
            self.lastProcessedBlock is not None
            and self.lastBlock <= self.lastProcessedBlock
        ):
            return

        blockNum = 0
        if self.lastProcessedBlock is not None:
            blockNum = self.lastProcessedBlock + 1
            print(
                "Updating hash-to-address index from block "
                + str(self.lastProcessedBlock)
            )
        else:
            print("Starting hash-to-address index")

        count = 0
        processed = 0

        while blockNum <= self.lastBlock:
            # leveldb cannot be accessed on multiple processes (not even readonly)
            # multithread version performs significantly worse than serial
            try:
                results = self._process(blockNum)
            except:
                break

            # store new mappings
            self.db.writer._start_writing()
            count += len(results)
            for addr in results:
                self.db.writer._store_account_address(addr)

            self.db.writer._commit_batch()

            processed += BATCH_SIZE
            blockNum = min(blockNum + BATCH_SIZE, self.lastBlock + 1)

            cost_time = time.time() - ethereum.start_time
            print(
                "%d blocks processed (in %d seconds), %d unique addresses found, next block: %d"
                % (processed, cost_time, count, min(self.lastBlock, blockNum))
            )

            self.lastProcessedBlock = blockNum - 1
            self.db.writer._set_last_indexed_number(self.lastProcessedBlock)

        print("Finished indexing")
        self.lastBlock = self.lastProcessedBlock
47875
def get_active_queue(self):
        """"""

        # Get dict of active queues keyed by name
        queues = {q['jobQueueName']: q for q in self._client.describe_job_queues()['jobQueues']
                  if q['state'] == 'ENABLED' and q['status'] == 'VALID'}
        if not queues:
            raise Exception('No job queues with state=ENABLED and status=VALID')

        # Pick the first queue as default
        return list(queues.keys())[0]
8266
def QA_SU_save_order_queue(order_queue, client=DATABASE):
    
    collection = client.order_queue
    collection.create_index(
        [('account_cookie',
          ASCENDING),
         ('order_id',
          ASCENDING)],
        unique=True
    )
    for order in order_queue.values():
        order_json = order.to_dict()
        try:
            collection.update_one(
                {
                    'account_cookie': order_json.get('account_cookie'),
                    'order_id': order_json.get('order_id')
                },
                {'$set': order_json},
                upsert=True
            )
        except Exception as e:
            print(e)
156003
function enqueue(queue, update) {
  if (update) {
    queue = queue || [];
    queue.push(update);
  }
  return queue;
}
837342
def fetch_deposits_since(self, since: int) -> List[Deposit]:
        """"""
        return self._transactions_since(self._deposits_since, 'deposits', since)
85540
public synchronized void removeUpdatesForQueue( String queueName )
    {
    	Iterator<TransactionItem> entries = items.iterator();
    	while (entries.hasNext())
		{
    		TransactionItem item = entries.next();
    		if (item.getDestination().getName().equals(queueName))
    		    entries.remove();
		}
    }