Package com.netflix.exhibitor.core.config

Examples of com.netflix.exhibitor.core.config.EncodedConfigParser$FieldValue


            int value = config.getInt(c);

            configNode.put(fixedName, value);
        }

        EncodedConfigParser     zooCfgParser = new EncodedConfigParser(config.getString(StringConfigs.ZOO_CFG_EXTRA));
        ObjectNode              zooCfgNode = JsonNodeFactory.instance.objectNode();
        for ( EncodedConfigParser.FieldValue fv : zooCfgParser.getFieldValues() )
        {
            zooCfgNode.put(fv.getField(), fv.getValue());
        }
        configNode.put("zooCfgExtra", zooCfgNode);

        if ( context.getExhibitor().getBackupManager().isActive() )
        {
            ObjectNode          backupExtraNode = JsonNodeFactory.instance.objectNode();
            EncodedConfigParser parser = context.getExhibitor().getBackupManager().getBackupConfigParser();
            List<BackupConfigSpec> configs = context.getExhibitor().getBackupManager().getConfigSpecs();
            for ( BackupConfigSpec c : configs )
            {
                String value = parser.getValue(c.getKey());
                backupExtraNode.put(c.getKey(), (value != null) ? value : "");
            }
            configNode.put("backupExtra", backupExtraNode);
        }
View Full Code Here


            {
                String      name = fieldNames.next();
                String      value = backupExtra.get(name).getTextValue();
                values.add(new EncodedConfigParser.FieldValue(name, value));
            }
            backupExtraValue = new EncodedConfigParser(values).toEncoded();
        }

        List<EncodedConfigParser.FieldValue>    zooCfgValues = Lists.newArrayList();
        JsonNode                zooCfgExtra = tree.get("zooCfgExtra");
        Iterator<String>        fieldNames = zooCfgExtra.getFieldNames();
        while ( fieldNames.hasNext() )
        {
            String      name = fieldNames.next();
            String      value = zooCfgExtra.get(name).getTextValue();
            zooCfgValues.add(new EncodedConfigParser.FieldValue(name, value));
        }
        final String          zooCfgExtraValue = new EncodedConfigParser(zooCfgValues).toEncoded();

        final String          finalBackupExtraValue = backupExtraValue;
        return new InstanceConfig()
        {
            @Override
View Full Code Here

        restartCount.incrementAndGet();
    }

    private int getDownInstanceRestartMs(InstanceConfig config)
    {
        EncodedConfigParser     parser = new EncodedConfigParser(exhibitor.getConfigManager().getConfig().getString(StringConfigs.ZOO_CFG_EXTRA));
        int                     tickTime = parseInt(parser.getValue("tickTime"));
        int                     initLimit = parseInt(parser.getValue("initLimit"));
        int                     syncLimit = parseInt(parser.getValue("syncLimit"));

        if ( (tickTime > 0) && ((initLimit > 0) || (syncLimit > 0)) )
        {
            return 2 * tickTime * Math.max(initLimit, syncLimit)// ZK should sync or fail within the initLimit/syncLimit
        }
View Full Code Here

     *
     * @return backup config
     */
    public EncodedConfigParser getBackupConfigParser()
    {
        return new EncodedConfigParser(exhibitor.getConfigManager().getConfig().getString(StringConfigs.BACKUP_EXTRA));
    }
View Full Code Here

    }

    private Map<String, String> getBackupConfig()
    {
        String              backupExtra = exhibitor.getConfigManager().getConfig().getString(StringConfigs.BACKUP_EXTRA);
        EncodedConfigParser encodedConfigParser = new EncodedConfigParser(backupExtra);
        return encodedConfigParser.getSortedMap();
    }
View Full Code Here

        zooKeeperJarPath = findJar(this.zooKeeperDirectory, "zookeeper.*");

        properties = new Properties();
        if ( isValid() )
        {
            EncodedConfigParser     parser = new EncodedConfigParser(exhibitor.getConfigManager().getConfig().getString(StringConfigs.ZOO_CFG_EXTRA));
            for ( EncodedConfigParser.FieldValue fv : parser.getFieldValues() )
            {
                properties.setProperty(fv.getField(), fv.getValue());
            }
            properties.setProperty("dataDir", dataDirectory.getPath());
            properties.setProperty("dataLogDir", this.logDirectory.getPath());
View Full Code Here

    {
        ArrayNode           node = JsonNodeFactory.instance.arrayNode();

        if ( context.getExhibitor().getBackupManager().isActive() )
        {
            EncodedConfigParser parser = context.getExhibitor().getBackupManager().getBackupConfigParser();
            List<BackupConfigSpec>  configs = context.getExhibitor().getBackupManager().getConfigSpecs();
            for ( BackupConfigSpec c : configs )
            {
                ObjectNode      n = JsonNodeFactory.instance.objectNode();
                String          value = parser.getValue(c.getKey());

                n.put("key", c.getKey());
                n.put("name", c.getDisplayName());
                n.put("help", c.getHelpText());
                n.put("value", (value != null) ? value : "");
View Full Code Here

TOP

Related Classes of com.netflix.exhibitor.core.config.EncodedConfigParser$FieldValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.