Search in sources :

Example 11 with LoadedInstanceConfig

use of com.netflix.exhibitor.core.config.LoadedInstanceConfig 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

LoadedInstanceConfig (com.netflix.exhibitor.core.config.LoadedInstanceConfig)11 PropertyBasedInstanceConfig (com.netflix.exhibitor.core.config.PropertyBasedInstanceConfig)10 Properties (java.util.Properties)6 File (java.io.File)4 Test (org.testng.annotations.Test)3 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 ObjectMetadata (com.amazonaws.services.s3.model.ObjectMetadata)1 S3Object (com.amazonaws.services.s3.model.S3Object)1 ServerStatus (com.netflix.exhibitor.core.entities.ServerStatus)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