Search in sources :

Example 11 with PropertyBasedInstanceConfig

use of com.netflix.exhibitor.core.config.PropertyBasedInstanceConfig in project exhibitor by soabase.

the class ZookeeperConfigProvider method loadConfig.

@Override
public LoadedInstanceConfig loadConfig() throws Exception {
    int version = -1;
    Properties properties = new Properties();
    ChildData childData = getConfigNode();
    if (childData != null) {
        version = childData.getStat().getVersion();
        properties.load(new ByteArrayInputStream(childData.getData()));
    }
    PropertyBasedInstanceConfig config = new PropertyBasedInstanceConfig(properties, defaults);
    return new LoadedInstanceConfig(config, version);
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) PropertyBasedInstanceConfig(com.netflix.exhibitor.core.config.PropertyBasedInstanceConfig) ChildData(org.apache.curator.framework.recipes.cache.ChildData) Properties(java.util.Properties) LoadedInstanceConfig(com.netflix.exhibitor.core.config.LoadedInstanceConfig)

Aggregations

PropertyBasedInstanceConfig (com.netflix.exhibitor.core.config.PropertyBasedInstanceConfig)11 LoadedInstanceConfig (com.netflix.exhibitor.core.config.LoadedInstanceConfig)10 Properties (java.util.Properties)7 File (java.io.File)4 BufferedOutputStream (java.io.BufferedOutputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 FileOutputStream (java.io.FileOutputStream)2 OutputStream (java.io.OutputStream)2 RandomAccessFile (java.io.RandomAccessFile)2 FileLock (java.nio.channels.FileLock)2 Date (java.util.Date)2 Test (org.testng.annotations.Test)2 ObjectMetadata (com.amazonaws.services.s3.model.ObjectMetadata)1 S3Object (com.amazonaws.services.s3.model.S3Object)1 DefaultProperties (com.netflix.exhibitor.core.config.DefaultProperties)1 BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileInputStream (java.io.FileInputStream)1 Semaphore (java.util.concurrent.Semaphore)1 CuratorFramework (org.apache.curator.framework.CuratorFramework)1