Search in sources :

Example 1 with ClasspathConfigSource

use of org.apache.gobblin.config.store.deploy.ClasspathConfigSource in project incubator-gobblin by apache.

the class SimpleHdfsConfigStoreTest method testDeploy.

@Test(dependsOnMethods = { "testGetCurrentVersion" })
public void testDeploy() throws Exception {
    Properties props = new Properties();
    props.setProperty(ClasspathConfigSource.CONFIG_STORE_CLASSPATH_RESOURCE_NAME_KEY, "_testDeploy");
    this._simpleHadoopFilesystemConfigStore.deploy(new FsDeploymentConfig(new ClasspathConfigSource(props), "2.0"));
    Path versionPath = PathUtils.combinePaths(CONFIG_DIR_NAME, SimpleHadoopFilesystemConfigStore.CONFIG_STORE_NAME, "2.0");
    Assert.assertTrue(fs.exists(new Path(versionPath, "dir1")));
    Assert.assertTrue(fs.exists(new Path(versionPath, "dir1/f1.conf")));
}
Also used : SingleLinkedListConfigKeyPath(org.apache.gobblin.config.common.impl.SingleLinkedListConfigKeyPath) Path(org.apache.hadoop.fs.Path) ConfigKeyPath(org.apache.gobblin.config.store.api.ConfigKeyPath) FsDeploymentConfig(org.apache.gobblin.config.store.deploy.FsDeploymentConfig) ClasspathConfigSource(org.apache.gobblin.config.store.deploy.ClasspathConfigSource) Properties(java.util.Properties) Test(org.testng.annotations.Test)

Example 2 with ClasspathConfigSource

use of org.apache.gobblin.config.store.deploy.ClasspathConfigSource in project incubator-gobblin by apache.

the class SimpleHdfsConfigStoreTest method testGetCurrentVersion.

@Test
public void testGetCurrentVersion() throws IOException {
    Assert.assertEquals(this._simpleHadoopFilesystemConfigStore.getCurrentVersion(), VERSION);
    String newVersion = "v1.1";
    this._simpleHadoopFilesystemConfigStore.deploy(new FsDeploymentConfig(new ClasspathConfigSource(new Properties()), newVersion));
    Assert.assertEquals(this._simpleHadoopFilesystemConfigStore.getCurrentVersion(), newVersion);
}
Also used : FsDeploymentConfig(org.apache.gobblin.config.store.deploy.FsDeploymentConfig) ClasspathConfigSource(org.apache.gobblin.config.store.deploy.ClasspathConfigSource) Properties(java.util.Properties) Test(org.testng.annotations.Test)

Example 3 with ClasspathConfigSource

use of org.apache.gobblin.config.store.deploy.ClasspathConfigSource in project incubator-gobblin by apache.

the class SimpleHdfsConfigStoreTest method setUp.

@BeforeClass
public void setUp() throws URISyntaxException, ConfigStoreCreationException, IOException {
    this.fs = FileSystem.getLocal(new Configuration());
    this.fs.mkdirs(CONFIG_DIR_PATH);
    SimpleLocalHDFSConfigStoreFactory simpleHDFSConfigStoreConfigFactory = new SimpleLocalHDFSConfigStoreFactory();
    URI storeURI = getStoreURI(System.getProperty("user.dir") + File.separator + CONFIG_DIR_NAME);
    this._simpleHadoopFilesystemConfigStore = simpleHDFSConfigStoreConfigFactory.createConfigStore(storeURI);
    this._simpleHadoopFilesystemConfigStore.deploy(new FsDeploymentConfig(new ClasspathConfigSource(new Properties()), VERSION));
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) FsDeploymentConfig(org.apache.gobblin.config.store.deploy.FsDeploymentConfig) ClasspathConfigSource(org.apache.gobblin.config.store.deploy.ClasspathConfigSource) Properties(java.util.Properties) URI(java.net.URI) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

Properties (java.util.Properties)3 ClasspathConfigSource (org.apache.gobblin.config.store.deploy.ClasspathConfigSource)3 FsDeploymentConfig (org.apache.gobblin.config.store.deploy.FsDeploymentConfig)3 Test (org.testng.annotations.Test)2 URI (java.net.URI)1 SingleLinkedListConfigKeyPath (org.apache.gobblin.config.common.impl.SingleLinkedListConfigKeyPath)1 ConfigKeyPath (org.apache.gobblin.config.store.api.ConfigKeyPath)1 Configuration (org.apache.hadoop.conf.Configuration)1 Path (org.apache.hadoop.fs.Path)1 BeforeClass (org.testng.annotations.BeforeClass)1