Package com.netflix.exhibitor.core.config

Examples of com.netflix.exhibitor.core.config.LoadedInstanceConfig


            {
                Closeables.closeQuietly(in);
            }
        }
        PropertyBasedInstanceConfig config = new PropertyBasedInstanceConfig(properties, defaultProperties);
        return new LoadedInstanceConfig(config, propertiesFile.lastModified());
    }
View Full Code Here


        finally
        {
            Closeables.closeQuietly(out);
        }

        return new LoadedInstanceConfig(propertyBasedInstanceConfig, lastModified);
    }
View Full Code Here

                }
            );

            Properties              properties = new Properties();
            properties.setProperty(PropertyBasedInstanceConfig.toName(StringConfigs.ZOO_CFG_EXTRA, PropertyBasedInstanceConfig.ROOT_PROPERTY_PREFIX), "1,2,3");
            LoadedInstanceConfig    loaded1 = config1.storeConfig(new PropertyBasedInstanceConfig(properties, new Properties()), -1);

            Assert.assertTrue(timing.acquireSemaphore(cacheUpdate2));
            timing.sleepABit();

            LoadedInstanceConfig    loaded2 = config2.loadConfig();
            Assert.assertEquals("1,2,3", loaded2.getConfig().getRootConfig().getString(StringConfigs.ZOO_CFG_EXTRA));

            properties.setProperty(PropertyBasedInstanceConfig.toName(StringConfigs.ZOO_CFG_EXTRA, PropertyBasedInstanceConfig.ROOT_PROPERTY_PREFIX), "4,5,6");
            config2.storeConfig(new PropertyBasedInstanceConfig(properties, new Properties()), loaded2.getVersion());

            Assert.assertNull(config1.storeConfig(new PropertyBasedInstanceConfig(properties, new Properties()), loaded1.getVersion()));

            LoadedInstanceConfig    newLoaded1 = config1.loadConfig();
            Assert.assertNotEquals(loaded1.getVersion(), newLoaded1.getVersion());
        }
        finally
        {
            Closeables.closeQuietly(config2);
            Closeables.closeQuietly(config1);
View Full Code Here

            properties.setProperty(PropertyBasedInstanceConfig.toName(StringConfigs.ZOO_CFG_EXTRA, PropertyBasedInstanceConfig.ROOT_PROPERTY_PREFIX), "1,2,3");
            config.storeConfig(new PropertyBasedInstanceConfig(properties, new Properties()), 0);

            timing.sleepABit();

            LoadedInstanceConfig instanceConfig = config.loadConfig();
            Assert.assertEquals("1,2,3", instanceConfig.getConfig().getRootConfig().getString(StringConfigs.ZOO_CFG_EXTRA));
        }
        finally
        {
            Closeables.closeQuietly(config);
        }
View Full Code Here

        statuses.add(new ServerStatus("b", InstanceStateTypes.SERVING.getCode(), "", false));
        statuses.add(new ServerStatus("c", InstanceStateTypes.SERVING.getCode(), "", false));
        Mockito.when(mockExhibitorInstance.getMockForkJoinPool().invoke(Mockito.isA(ClusterStatusTask.class))).thenReturn(statuses);

        AutomaticInstanceManagement management = new AutomaticInstanceManagement(mockExhibitorInstance.getMockExhibitor());
        LoadedInstanceConfig        loadedInstanceConfig = mockExhibitorInstance.getMockExhibitor().getConfigManager().getLoadedInstanceConfig();
        LoadedInstanceConfig        changedCoadedInstanceConfig = new LoadedInstanceConfig(loadedInstanceConfig.getConfig(), loadedInstanceConfig.getVersion() + 1);
        mockExhibitorInstance.getMockExhibitor().getConfigManager().testingSetLoadedInstanceConfig(changedCoadedInstanceConfig);
        management.call();

        Assert.assertEquals(mockExhibitorInstance.getMockExhibitor().getConfigManager().getConfig().getString(StringConfigs.SERVERS_SPEC), "1:a,2:b,3:c")// instance addition should have failed
    }
View Full Code Here

    @Override
    public LoadedInstanceConfig loadConfig() throws Exception
    {
        version.incrementAndGet();
        return new LoadedInstanceConfig(collection, version.get())
        {
            @Override
            public ConfigCollection getConfig()
            {
                return collection;
View Full Code Here

        {
            return null;
        }

        collection = config;
        return new LoadedInstanceConfig(config, compareVersion)
        {
            @Override
            public ConfigCollection getConfig()
            {
                return collection;
View Full Code Here

            {
                Closeables.closeQuietly(raf);
            }
        }
        PropertyBasedInstanceConfig config = new PropertyBasedInstanceConfig(properties, defaults);
        return new LoadedInstanceConfig(config, propertiesFile.lastModified());
    }
View Full Code Here

        finally
        {
            Closeables.closeQuietly(out);
        }

        return new LoadedInstanceConfig(propertyBasedInstanceConfig, lastModified);
    }
View Full Code Here

        {
            version = childData.getStat().getVersion();
            properties.load(new ByteArrayInputStream(childData.getData()));
        }
        PropertyBasedInstanceConfig config = new PropertyBasedInstanceConfig(properties, defaults);
        return new LoadedInstanceConfig(config, version);
    }
View Full Code Here

TOP

Related Classes of com.netflix.exhibitor.core.config.LoadedInstanceConfig

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.