Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.BaseConfiguration.subset()


        if (!success) throw new IllegalStateException("Could not remove " + homeDirFile);
    }

    public static TitanGraph getInMemoryGraph() {
        BaseConfiguration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "inmemory");
        return TitanFactory.open(config);
    }


    public static Configuration addPermanentCache(Configuration conf) {
View Full Code Here


    public static final String INDEX_NAME = "search";


    public static TitanGraph create(final String directory) {
        BaseConfiguration config = new BaseConfiguration();
        Configuration storage = config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE);
        // configuring local backend
        storage.setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "local");
        storage.setProperty(GraphDatabaseConfiguration.STORAGE_DIRECTORY_KEY, directory);
        // configuring elastic search index
        Configuration index = storage.subset(GraphDatabaseConfiguration.INDEX_NAMESPACE).subset(INDEX_NAME);
View Full Code Here

        System.out.println("localPartition: " + Arrays.toString(localPartition));
    }

    private static TitanGraph getInMemoryGraph() {
        BaseConfiguration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, InMemoryStorageAdapter.class.getCanonicalName());
        config.subset(GraphDatabaseConfiguration.IDS_NAMESPACE).addProperty(GraphDatabaseConfiguration.IDS_FLUSH_KEY, false);
        return TitanFactory.open(config);
    }

    @Test
View Full Code Here

    }

    private static TitanGraph getInMemoryGraph() {
        BaseConfiguration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, InMemoryStorageAdapter.class.getCanonicalName());
        config.subset(GraphDatabaseConfiguration.IDS_NAMESPACE).addProperty(GraphDatabaseConfiguration.IDS_FLUSH_KEY, false);
        return TitanFactory.open(config);
    }

    @Test
    public void testIDAssignment() {
View Full Code Here

        super(getConfiguration());
    }

    public static final Configuration getConfiguration() {
        Configuration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY,"inmemory");
        return config;
    }

    @Override
    public void clopen() {
View Full Code Here

        }
    }
   
    private static Configuration getGraphBaseConfiguration(String ks, String backend) {
        Configuration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(KEYSPACE_KEY, cleanKeyspaceName(ks));
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, backend);
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.CONNECTION_TIMEOUT_KEY, 60000L);
        return config;
    }
   
View Full Code Here

    }
   
    private static Configuration getGraphBaseConfiguration(String ks, String backend) {
        Configuration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(KEYSPACE_KEY, cleanKeyspaceName(ks));
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, backend);
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.CONNECTION_TIMEOUT_KEY, 60000L);
        return config;
    }
   
    private static String loadAbsoluteDirectoryPath(String name, String prop, boolean mustExistAndBeAbsolute) {
View Full Code Here

   
    private static Configuration getGraphBaseConfiguration(String ks, String backend) {
        Configuration config = new BaseConfiguration();
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(KEYSPACE_KEY, cleanKeyspaceName(ks));
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, backend);
        config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.CONNECTION_TIMEOUT_KEY, 60000L);
        return config;
    }
   
    private static String loadAbsoluteDirectoryPath(String name, String prop, boolean mustExistAndBeAbsolute) {
        String s = System.getProperty(prop);
View Full Code Here

        super(getLuceneBDBConfig(), true, true, true);
    }

    public static final Configuration getLuceneBDBConfig() {
        BaseConfiguration config = new BaseConfiguration();
        config.subset(STORAGE_NAMESPACE).addProperty(STORAGE_BACKEND_KEY, "com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager");
        config.subset(STORAGE_NAMESPACE).addProperty(STORAGE_DIRECTORY_KEY, StorageSetup.getHomeDir());
        //Add index
        Configuration sub = config.subset(STORAGE_NAMESPACE).subset(INDEX_NAMESPACE).subset(INDEX);
        sub.setProperty(INDEX_BACKEND_KEY,"com.thinkaurelius.titan.diskstorage.lucene.LuceneIndex");
        sub.setProperty(STORAGE_DIRECTORY_KEY, StorageSetup.getHomeDir("lucene"));
View Full Code Here

    }

    public static final Configuration getLuceneBDBConfig() {
        BaseConfiguration config = new BaseConfiguration();
        config.subset(STORAGE_NAMESPACE).addProperty(STORAGE_BACKEND_KEY, "com.thinkaurelius.titan.diskstorage.berkeleyje.BerkeleyJEStoreManager");
        config.subset(STORAGE_NAMESPACE).addProperty(STORAGE_DIRECTORY_KEY, StorageSetup.getHomeDir());
        //Add index
        Configuration sub = config.subset(STORAGE_NAMESPACE).subset(INDEX_NAMESPACE).subset(INDEX);
        sub.setProperty(INDEX_BACKEND_KEY,"com.thinkaurelius.titan.diskstorage.lucene.LuceneIndex");
        sub.setProperty(STORAGE_DIRECTORY_KEY, StorageSetup.getHomeDir("lucene"));
//        System.out.println(GraphDatabaseConfiguration.toString(config));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.