Push the provided broks objects to the broker daemon

        Only used on a Broker daemon by the Arbiter

        :param: broks
        :type: list
        :return: None
178377
def _push_broks(self):
        
        data = cherrypy.request.json
        with self.app.arbiter_broks_lock:
            logger.debug("Pushing %d broks", len(data['broks']))
            self.app.arbiter_broks.extend([unserialize(elem, True) for elem in data['broks']])
435059
def addToCommits(self, commit: Commit, sender: str):
        
        # BLS multi-sig:
        self._bls_bft_replica.process_commit(commit, sender)

        self.commits.addVote(commit, sender)
        self.tryOrder(commit)
18322
def get_broks(self, broker_name):
        
        logger.debug("Broker %s requests my broks list", broker_name)
        res = []
        if not broker_name:
            return res

        for broker_link in list(self.brokers.values()):
            if broker_name == broker_link.name:
                for brok in sorted(broker_link.broks, key=lambda x: x.creation_time):
                    # Only provide broks that did not yet sent to our external modules
                    if getattr(brok, 'sent_to_externals', False):
                        res.append(brok)
                        brok.got = True
                broker_link.broks = [b for b in broker_link.broks if not getattr(b, 'got', False)]
                logger.debug("Providing %d broks to %s", len(res), broker_name)
                break
        else:
            logger.warning("Got a brok request from an unknown broker: %s", broker_name)

        return res
133543
def push(self):
        """"""
        self._refresh_connection()

        # Check if we need to update mappings as this needs to be done
        # before we push anything to the Elasticsearch server.
        # This must be done even if the queue is empty, as otherwise ES
        # will fail when retrieving data.
        if not self._mapping_created:
            logger.debug("Pushing mapping for Elasticsearch index '%s'.", self.__class__.__name__)
            self.create_mapping()

        if not self.push_queue:
            logger.debug("No documents to push, skipping push.")
            return

        logger.debug("Found %s documents to push to Elasticsearch.", len(self.push_queue))

        bulk(connections.get_connection(), (doc.to_dict(True) for doc in self.push_queue), refresh=True)
        self.push_queue = []

        logger.debug("Finished pushing builded documents to Elasticsearch server.")
198031
def mount(self, prefix, adapter):
        
        self.adapters[prefix] = adapter
        keys_to_move = [k for k in self.adapters if len(k) < len(prefix)]

        for key in keys_to_move:
            self.adapters[key] = self.adapters.pop(key)
464287
def push(self, message, callback_arg=None):
        

        if message['action'] == 'upsert':
            message.setdefault('key_names', self.key_names)

        message['client_id'] = self.client_id
        message.setdefault('table_name', self.table_name)

        self._add_message(message, callback_arg)

        batch = self._take_batch(self.target_messages_per_batch)
        if batch:
            self._send_batch(batch)
266717
public static void setCurrentPersistenceBroker(PBKey key, PersistenceBrokerInternal broker)
            throws PBFactoryException
    {
        HashMap map = (HashMap) currentBrokerMap.get();
        WeakHashMap set = null;
        if(map == null)
        {
            map = new HashMap();
            currentBrokerMap.set(map);

            synchronized(lock) {
                loadedHMs.add(map);
            }
        }
        else
        {
            set = (WeakHashMap) map.get(key);
        }

        if(set == null)
        {
            // We emulate weak HashSet using WeakHashMap
            set = new WeakHashMap();
            map.put(key, set);
        }
        set.put(broker, null);
    }
816639
def get_new_broks(self):
        
        for satellites in [self.schedulers, self.pollers, self.reactionners, self.receivers]:
            for satellite_link in list(satellites.values()):
                logger.debug("Getting broks from %s", satellite_link)

                _t0 = time.time()
                try:
                    tmp_broks = satellite_link.get_broks(self.name)
                except LinkError:
                    logger.warning("Daemon %s connection failed, I could not get the broks!",
                                   satellite_link)
                else:
                    if tmp_broks:
                        logger.debug("Got %d Broks from %s in %s",
                                     len(tmp_broks), satellite_link.name, time.time() - _t0)
                        statsmgr.gauge('get-new-broks-count.%s'
                                       % (satellite_link.name), len(tmp_broks))
                        statsmgr.timer('get-new-broks-time.%s'
                                       % (satellite_link.name), time.time() - _t0)
                        for brok in tmp_broks:
                            brok.instance_id = satellite_link.instance_id

                        # Add the broks to our global list
                        self.external_broks.extend(tmp_broks)
1289773
def fill_data_brok_from(self, data, brok_type):
        
        cls = self.__class__
        # Now config properties
        for prop, entry in list(cls.properties.items()):
            # Is this property intended for broking?
            # if 'fill_brok' in entry[prop]:
            if brok_type in entry.fill_brok:
                if hasattr(self, prop):
                    data[prop] = getattr(self, prop)
498064
def push(*resources):
    
    cmd = 'tx push -s'
    if resources:
        for resource in resources:
            execute(cmd + ' -r {resource}'.format(resource=resource))
    else:
        execute(cmd)
268632
def _on_fork(cls):
        
        cls._cls_idle_socketpairs = []
        while cls._cls_all_sockets:
            cls._cls_all_sockets.pop().close()
51221
def skopeo_push(self, repository=None, tag=None):
        
        return self.copy(repository, tag, SkopeoTransport.DOCKER_DAEMON, SkopeoTransport.DOCKER)\
            .using_transport(SkopeoTransport.DOCKER)
274347
def send_broks_to_modules(self):
        
        t00 = time.time()
        nb_sent = 0
        broks = []
        for broker_link in list(self.my_daemon.brokers.values()):
            for brok in broker_link.broks:
                if not getattr(brok, 'sent_to_externals', False):
                    brok.to_send = True
                    broks.append(brok)
        if not broks:
            return
        logger.debug("sending %d broks to modules...", len(broks))

        for mod in self.my_daemon.modules_manager.get_external_instances():
            logger.debug("Look for sending to module %s", mod.get_name())
            module_queue = mod.to_q
            if module_queue:
                to_send = [b for b in broks if mod.want_brok(b)]
                module_queue.put(to_send)
                nb_sent += len(to_send)

        # No more need to send them
        for broker_link in list(self.my_daemon.brokers.values()):
            for brok in broker_link.broks:
                if not getattr(brok, 'sent_to_externals', False):
                    brok.to_send = False
                    brok.sent_to_externals = True
        logger.debug("Time to send %d broks (after %d secs)", nb_sent, time.time() - t00)
1203104
def push(self, index=None):
        
        for ind in self.indexes:
            if index and not isinstance(ind, index):
                continue
            ind.push()
754497
def get_initial_broks_from_satellites(self):
        
        for satellites in [self.conf.brokers, self.conf.schedulers,
                           self.conf.pollers, self.conf.reactionners, self.conf.receivers]:
            for satellite in satellites:
                # Get only if reachable...
                if not satellite.reachable:
                    continue
                logger.debug("Getting initial brok from: %s", satellite.name)
                brok = satellite.get_initial_status_brok()
                logger.debug("Satellite '%s' initial brok: %s", satellite.name, brok)
                self.add(brok)
1004213
def push_all(collector, **kwargs):
    """"""
    configuration = collector.configuration
    configuration["harpoon"].do_push = True
    configuration["harpoon"].only_pushable = True
    make_all(collector, **kwargs)
506856
def push(tuple)
      key = bin_key(tuple)
      @hash[key] ||= TupleBin.new
      @hash[key].add(tuple)
    end