Allow RF to be overridden with ReplicationFactor in the given options.
342921
@SuppressWarnings("unchecked")
    private String keyspaceDefaultsToCQLString() {
        // Default defaults:
        boolean durable_writes = true;
        Map<String, Object> replication = new HashMap<String, Object>();
        replication.put("class", "SimpleStrategy");
        replication.put("replication_factor", "1");

        // Legacy support: ReplicationFactor
        if (m_dbservice.getParam("ReplicationFactor") != null) {
            replication.put("replication_factor", m_dbservice.getParamString("ReplicationFactor"));
        }
        
        // Override any options specified in ks_defaults
        Map<String, Object> ksDefs = m_dbservice.getParamMap("ks_defaults");
        if (ksDefs != null) {
            if (ksDefs.containsKey("durable_writes")) {
                durable_writes = Boolean.parseBoolean(ksDefs.get("durable_writes").toString());
            }
            if (ksDefs.containsKey("strategy_class")) {
                replication.put("class", ksDefs.get("strategy_class").toString());
            }
            if (ksDefs.containsKey("strategy_options")) {
                Object value = ksDefs.get("strategy_options");
                if (value instanceof Map) {
                    Map<String, Object> replOpts = (Map<String, Object>)value;
                    if (replOpts.containsKey("replication_factor")) {
                        replication.put("replication_factor", replOpts.get("replication_factor").toString());
                    }
                }
            }
        }
        
        StringBuilder buffer = new StringBuilder();
        buffer.append(" WITH DURABLE_WRITES=");
        buffer.append(durable_writes);
        buffer.append(" AND REPLICATION=");
        buffer.append(mapToCQLString(replication));
        return buffer.toString();
    }
1333798
protected Supplier<Set<HardwareFlavor>> overrideHardwareFlavorSupplier(Injector injector,
      Supplier<Set<HardwareFlavor>> originalSupplier) {
    return originalSupplier;
  }
1225551
def accept_override(self):
        """"""
        conflicts = self.check_conflicts()
        if conflicts:
            for shortcut in conflicts:
                shortcut.key = ''
        self.accept()
494678
protected void setRRSXAResourceFactory(ServiceReference<Object> ref) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "setRRSXAResourceFactory", ref);
        rrsXAResFactorySvcRef.setReference(ref);
    }
848642
int calculateReplicationFactor(List<HostToken> allHostTokens) {
        Map<Long, Integer> groups = new HashMap<>();

        Set<HostToken> uniqueHostTokens = new HashSet<>(allHostTokens);

        String dataCenter = cpConfig.getLocalDataCenter();
        if (dataCenter == null) {
            dataCenter = localRack.substring(0, localRack.length() - 1);
        }

        for (HostToken hostToken: uniqueHostTokens) {
        	if (hostToken.getHost().getRack().contains(dataCenter)) {
				Long token = hostToken.getToken();
				if (groups.containsKey(token)) {
					int current = groups.get(token);
					groups.put(token, current + 1);
				} else {
					groups.put(token, 1);
				}
			}
        }

        Set<Integer> uniqueCounts = new HashSet<>(groups.values());

        if (uniqueCounts.size() > 1) {
            throw new RuntimeException("Invalid configuration - replication factor cannot be asymmetric");
        }

        int rf = uniqueCounts.toArray(new Integer[uniqueCounts.size()])[0];

        if (rf > 3) {
            logger.warn("Replication Factor is high: " + uniqueHostTokens);
        }

        return rf;
    }
586982
function _gpfRequireConfigure (options) {
    _gpfRequireConfigureCheckOptions(options);
    var me = this;
    _gpfArrayForEach(_gpfRequireConfigureOptionNames.filter(function (name) {
        return options[name] !== undefined;
    }), function (name) {
        _gpfRequireConfigureHandler[name](me, options[name]);
    });
}
823231
def override_operation(self, operation, reason):
        """"""
        prev_class = (self.local_classification, self.remote_classification)
        prev_op = self.operation
        assert operation != prev_op
        assert operation in PAIR_OPERATIONS
        if self.any_entry.target.synchronizer.verbose > 3:
            write(
                "override_operation({}, {}) -> {} ({})".format(
                    prev_class, prev_op, operation, reason
                ),
                debug=True,
            )
        self.operation = operation
        self.re_class_reason = reason
275620
private void overrideDeployerDetails(T overrider, Class overriderClass) {
        if (overrider instanceof DeployerOverrider) {
            try {
                Field deployerDetailsField = overriderClass.getDeclaredField("deployerDetails");
                deployerDetailsField.setAccessible(true);
                Object deployerDetails = deployerDetailsField.get(overrider);

                if (deployerDetails == null) {
                    Field oldDeployerDetailsField = overriderClass.getDeclaredField("details");
                    oldDeployerDetailsField.setAccessible(true);
                    Object oldDeployerDetails = oldDeployerDetailsField.get(overrider);
                    if (oldDeployerDetails != null) {
                        ServerDetails deployerServerDetails = createInitialDeployDetailsFromOldDeployDetails((ServerDetails) oldDeployerDetails);
                        deployerDetailsField.set(overrider, deployerServerDetails);
                    }
                }
            } catch (NoSuchFieldException | IllegalAccessException e) {
                converterErrors.add(getConversionErrorMessage(overrider, e));
            }
        }
    }
915931
function(replication_option){
        if( typeof replication_option == 'string'){
            return replication_option;
        }else{
            var properties = [];
            for(var k in replication_option){
                properties.push(util.format("'%s': '%s'", k, replication_option[k] ));
            }
            return util.format('{%s}', properties.join(','));
        }
    }
25614
public void addConstantFactor(String factorName, Factor factor) {
    constantFactors.add(ReplicatedFactor.fromFactor(factor));
    constantFactorNames.add(factorName);
  }
702955
def suspend(rq, ctx, duration):
    ""
    ctx.invoke(
        rq_cli.suspend,
        duration=duration,
        **shared_options(rq)
    )
904174
def _override_options(options, **overrides):
    """"""
    for opt, val in overrides.items():
        passed_value = getattr(options, opt, _Default())
        if opt in ('ignore', 'select') and passed_value:
            value = process_value(opt, passed_value.value)
            value += process_value(opt, val)
            setattr(options, opt, value)
        elif isinstance(passed_value, _Default):
            setattr(options, opt, process_value(opt, val))
983271
def _may_override(self, implem, other):
        """"""
        if isinstance(other, ImplementationProperty):
            # Overriding another custom implementation for the same transition
            # and field
            return (other.transition == implem.transition and other.field_name == self.state_field)

        elif isinstance(other, TransitionWrapper):
            # Overriding the definition that led to adding the current
            # ImplementationProperty.
            return (
                other.trname == implem.transition.name
                and (not other.field or other.field == self.state_field)
                and other.func == implem.implementation)

        return False
1241842
public void setReplicaSettings(java.util.Collection<ReplicaSettingsDescription> replicaSettings) {
        if (replicaSettings == null) {
            this.replicaSettings = null;
            return;
        }

        this.replicaSettings = new java.util.ArrayList<ReplicaSettingsDescription>(replicaSettings);
    }
533793
def export_cmd_options(self, options_override=None, standalone=False):
        
        cmd_options = super(MongodServer, self).export_cmd_options(
            options_override=options_override)

        # reset some props to exporting vals
        cmd_options['dbpath'] = self.get_db_path()

        if 'repairpath' in cmd_options:
            cmd_options['repairpath'] = resolve_path(cmd_options['repairpath'])

        # Add ReplicaSet args if a cluster is configured

        repl_cluster = self.get_replicaset_cluster()
        if repl_cluster is not None:
            if "replSet" not in cmd_options:
                cmd_options["replSet"] = repl_cluster.id

        # apply standalone if specified
        if standalone:
            if "replSet" in cmd_options:
                del cmd_options["replSet"]
            if "keyFile" in cmd_options:
                del cmd_options["keyFile"]

        # add configsvr as needed
        if self.is_config_server():
            cmd_options["configsvr"] = True

        # add shardsvr as needed
        if self.is_shard_server():
            cmd_options["shardsvr"] = True

        # remove wiredTigerCacheSizeGB if its not an int since we set it in runtime parameter
        #  wiredTigerEngineRuntimeConfig in this case
        if "wiredTigerCacheSizeGB" in cmd_options and not isinstance(self.get_cmd_option("wiredTigerCacheSizeGB"), int):
            del cmd_options["wiredTigerCacheSizeGB"]

        return cmd_options
1264333
function defaultOptions(opts) {
    opts.bucketSize = opts.bucketSize || 20;
    opts.concurrency = opts.concurrency || 3;
    opts.expireTime = opts.expireTime || 60 * 60 * 24;
    opts.refreshTime = opts.refreshTime || 60 * 60;
    opts.replicateTime = opts.replicateTime || 60 * 60;
    opts.republishTime = opts.republishTime || 60 * 60 * 24;
}
926237
def set_override(self, newchannels):
        ''''''
        self.override = newchannels
        self.override_counter = 10
        self.send_rc_override()