Perform a SCAN in the cluster.
359456
static <T extends ScanCursor, K, V> Mono<T> clusterScan(StatefulRedisClusterConnectionImpl<K, V> connection,
            ScanCursor cursor, BiFunction<RedisKeyReactiveCommands<K, V>, ScanCursor, Mono<T>> scanFunction,
            ClusterScanSupport.ScanCursorMapper<Mono<T>> mapper) {

        List<String> nodeIds = ClusterScanSupport.getNodeIds(connection, cursor);
        String currentNodeId = ClusterScanSupport.getCurrentNodeId(cursor, nodeIds);
        ScanCursor continuationCursor = ClusterScanSupport.getContinuationCursor(cursor);

        AsyncClusterConnectionProvider connectionProvider = (AsyncClusterConnectionProvider) connection
                .getClusterDistributionChannelWriter().getClusterConnectionProvider();

        Mono<T> scanCursor = getMono(connectionProvider.<K, V> getConnectionAsync(Intent.WRITE, currentNodeId)).flatMap(
                conn -> scanFunction.apply(conn.reactive(), continuationCursor));
        return mapper.map(nodeIds, currentNodeId, scanCursor);
    }
324463
def cluster_reset(self, *, hard=False):
        """"""
        reset = hard and b'HARD' or b'SOFT'
        fut = self.execute(b'CLUSTER', b'RESET', reset)
        return wait_ok(fut)
788222
def scan(args):
    
    p = OptionParser(scan.__doc__)
    p.add_option("-n", "--min_size", dest="n", type="int", default=4,
            help="minimum number of anchors in a cluster [default: %default]")
    p.add_option("--liftover",
            help="Scan BLAST file to find extra anchors [default: %default]")
    p.set_stripnames()

    blast_file, anchor_file, dist, opts = add_options(p, args, dist=20)
    qbed, sbed, qorder, sorder, is_self = check_beds(blast_file, p, opts)

    filtered_blast = read_blast(blast_file, qorder, sorder, \
                                is_self=is_self, ostrip=False)

    fw = open(anchor_file, "w")
    logging.debug("Chaining distance = {0}".format(dist))

    clusters = batch_scan(filtered_blast, xdist=dist, ydist=dist, N=opts.n)
    for cluster in clusters:
        print("###", file=fw)
        for qi, si, score in cluster:
            query, subject = qbed[qi].accn, sbed[si].accn
            print("\t".join((query, subject, str(int(score)))), file=fw)

    fw.close()
    summary([anchor_file])

    lo = opts.liftover
    if not lo:
        return anchor_file

    bedopts = ["--qbed=" + opts.qbed, "--sbed=" + opts.sbed]
    ostrip = [] if opts.strip_names else ["--no_strip_names"]
    newanchorfile = liftover([lo, anchor_file] + bedopts + ostrip)
    return newanchorfile
538946
private Node scanTerritory(DistanceMap map, String desired, String supported) {
    Node node;
    for (String partition : PARTITION_TABLE.getRegionPartition(desired)) {
      node = map.get(partition, supported);
      if (node != null) {
        return node;
      }
    }
    
    for (String partition : PARTITION_TABLE.getRegionPartition(supported)) {
      node = map.get(desired, partition);
      if (node != null) {
        return node;
      }
    }
    
    return null;
  }
619034
def broadcast(self, data):
        """"""
        for destination in self.cluster:
            asyncio.ensure_future(self.send(data, destination), loop=self.loop)
94019
def execute(self):
        """"""
        cluster_name = self.params.cluster
        creator = make_creator(self.params.config,
                               storage_path=self.params.storage)
        try:
            cluster = creator.load_cluster(cluster_name)
        except (ClusterNotFound, ConfigurationError) as e:
            log.error("Cannot load cluster `%s`: %s", cluster_name, e)
            return os.EX_NOINPUT
        print("Resuming cluster `%s` ..." % cluster_name)
        cluster.resume()
808983
def _advance_cluster_time(self, cluster_time):
        """"""
        if self._cluster_time is None:
            self._cluster_time = cluster_time
        elif cluster_time is not None:
            if cluster_time["clusterTime"] > self._cluster_time["clusterTime"]:
                self._cluster_time = cluster_time
57489
private void scan() {
        if (ivScanned) {
            return;
        }

        ivScanned = true;

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        for (Class<?> klass = ivClass; klass != null && klass != Object.class; klass = klass.getSuperclass()) {
            if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled()))
                Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData,
                         "scanning " + klass.getName());

            ivCurrentClassName = klass.getName();
            ivCurrentPrivateMethodMetaData = null;

            ClassLoader classLoader = klass.getClassLoader();
            if (classLoader == null) {
                classLoader = getBootClassLoader(); // d742751
            }

            String resourceName = klass.getName().replace('.', '/') + ".class";
            InputStream input = classLoader.getResourceAsStream(resourceName);

            if (input == null) // d728537
            {
                if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled()))
                    Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData,
                             "failed to find " + resourceName + " from " + classLoader);

                ivScanException = new FileNotFoundException(resourceName);
                return;
            }

            try {
                ClassReader classReader = new ClassReader(input);
                classReader.accept(this, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
            }
            // If the class is malformed, ASM might throw any exception.    d728537
            catch (Throwable t) {
                FFDCFilter.processException(t, CLASS_NAME + ".scan", "168", this,
                                            new Object[] { resourceName, klass, classLoader });

                if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled()))
                    Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData,
                             "scan exception", t);

                ivScanException = t;
                return;
            } finally {
                try {
                    input.close();
                } catch (IOException ex) {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "error closing input stream", ex);
                }
            }
        }
    }
187248
def _checkIfClusterExists(self):
        
        ansibleArgs = {
            'resgrp': self.clusterName,
            'region': self._zone
        }
        try:
            self.callPlaybook(self.playbook['check-cluster'], ansibleArgs, wait=True)
        except RuntimeError:
            logger.info("The cluster could not be created. Try deleting the cluster if it already exits.")
            raise
874082
def cluster_forget(self, node_id):
        """"""
        fut = self.execute(b'CLUSTER', b'FORGET', node_id)
        return wait_ok(fut)
300294
function scan(sp, cb) {
    cb = u.onceMaybe(cb);
    var timer = u.timer();
    sp.route = sp.route || '/';

    var src = sp.src;

    // only construct src, defaults, sendOpts etc. once
    if (!src) {
      sp.name = sp.name || 'staticPath:' + sp.path;
      sp.depth = sp.depth || opts.staticDepth || 5;
      sp.maxAge = 'maxAge' in sp ? sp.maxAge : '10m';
      sp.includeBinaries = true;
      src = sp.src = fsbase(sp);
      if (src.isfile()) { sp.depth = 1; }
      sp.sendOpts = u.assign(
        u.pick(sp, 'maxAge', 'lastModified', 'etag'),
        { dotfiles:'ignore',
          index:false,      // handled at this level
          extensions:false, // ditto
          root:src.path } );
    }

    src.listfiles(function(err, files) {
      if (err) return cb(log(err));
      sp.files = files;
      self.scanCnt++;
      mapAllFiles();
      debug('static scan %s-deep %sms %s', sp.depth, timer(), sp.path.replace(/.*\/node_modules\//g, ''));
      debug(files.length > 10 ? '[' + files.length + ' files]' : u.pluck(files, 'filepath'));
      cb();
    });
  }
196577
public void scan(final ClassVisitor visitor) {
        if (scanned == null) {
            performScan();
        }
        for (Class<?> cls : scanned) {
            visitor.visit(cls);
        }
    }
1005286
def cluster_get_keys_in_slots(self, slot, count, *, encoding):
        """"""
        return self.execute(b'CLUSTER', b'GETKEYSINSLOT', slot, count,
                            encoding=encoding)
1170519
def _update_cluster_view(self):
        """"""
        logger.log(5, "Update the cluster view.")
        cluster_ids = [int(c) for c in self.clustering.cluster_ids]
        self.cluster_view.set_rows(cluster_ids)
1096402
def scan(self, match="*", count=1000, cursor=0):
        
        cursor, data = self._client.sscan(
            self.key_prefix, cursor=cursor, match=match, count=count)
        return (cursor, set(map(self._loads, data)))
778570
def scan(self):
        """"""

        self._logger.info("iface '%s' scans", self.name())

        self._wifi_ctrl.scan(self._raw_obj)
1023140
def parallel_scan(self, scan_id, target):
        
        try:
            ret = self.exec_scan(scan_id, target)
            if ret == 0:
                self.add_scan_host_detail(scan_id, name='host_status',
                                          host=target, value='0')
            elif ret == 1:
                self.add_scan_host_detail(scan_id, name='host_status',
                                          host=target, value='1')
            elif ret == 2:
                self.add_scan_host_detail(scan_id, name='host_status',
                                          host=target, value='2')
            else:
                logger.debug('%s: No host status returned', target)
        except Exception as e:
            self.add_scan_error(scan_id, name='', host=target,
                                value='Host process failure (%s).' % e)
            logger.exception('While scanning %s:', target)
        else:
            logger.info("%s: Host scan finished.", target)