Package org.apache.marmotta.kiwi.config

Examples of org.apache.marmotta.kiwi.config.KiWiConfiguration


            String jdbcUrl = configurationService.getStringConfiguration("database.url");
            String dbUser  = configurationService.getStringConfiguration("database.user");
            String dbPass  = configurationService.getStringConfiguration("database.password");
            boolean batchCommit = configurationService.getBooleanConfiguration("database.batchcommit", true);

            KiWiConfiguration configuration = new KiWiConfiguration("lmf", jdbcUrl, dbUser, dbPass, dialect, configurationService.getDefaultContext(), configurationService.getInferredContext());
            configuration.setQueryLoggingEnabled(configurationService.getBooleanConfiguration("database.debug.slowqueries",false));
            configuration.setBatchCommit(batchCommit);
            configuration.setBatchSize(configurationService.getIntConfiguration("database.batchsize",10000));
            configuration.setMemorySequences(configurationService.getBooleanConfiguration("database.memsequences",true));

            store = new KiWiStore(configuration);

            tsail = new KiWiTransactionalSail(store);
View Full Code Here


    @BeforeClass
    public static void setup() throws RepositoryException {
        logger = LoggerFactory.getLogger(H2ConcurrencyTest.class);

        KiWiConfiguration h2Config = KiWiDatabaseRunner.createKiWiConfig("H2", new H2Dialect());
        DBConnectionChecker.checkDatabaseAvailability(h2Config);
       
        rnd = new Random();

        store = new KiWiStore(h2Config);
View Full Code Here

    public static void setup() throws RepositoryException {
        logger = LoggerFactory.getLogger(PostgreSQLConcurrencyTest.class);

        logger.info("creating test setup...");

        KiWiConfiguration psql = KiWiDatabaseRunner.createKiWiConfig("PostgreSQL", new PostgreSQLDialect());
        DBConnectionChecker.checkDatabaseAvailability(psql);
       
        rnd = new Random();

        store = new KiWiStore(psql);
View Full Code Here

    @BeforeClass
    public static void setup() throws RepositoryException {
        logger = LoggerFactory.getLogger(MySQLConcurrencyTest.class);

        KiWiConfiguration mysqlConfig = KiWiDatabaseRunner.createKiWiConfig("MySQL", new MySQLDialect());
        DBConnectionChecker.checkDatabaseAvailability(mysqlConfig);
       
        rnd = new Random();

        store = new KiWiStore(mysqlConfig);
View Full Code Here

    private void createKiWiConfig(String database, KiWiDialect dialect, List<KiWiConfiguration> configs) {
        if (forDialects != null && !forDialects.contains(dialect.getClass())) {
            return;
        }
        KiWiConfiguration c = createKiWiConfig(database, dialect);
        if (c!=null) configs.add(c);
    }
View Full Code Here

        KiWiConfiguration c = createKiWiConfig(database, dialect);
        if (c!=null) configs.add(c);
    }
   
    public static KiWiConfiguration createKiWiConfig(String database, KiWiDialect dialect) {
        final KiWiConfiguration config;
        if(!(dialect instanceof H2Dialect) && System.getProperty(database.toLowerCase()+".url") != null) {
            config = new KiWiConfiguration(
                    database,
                    System.getProperty(database.toLowerCase()+".url"),
                    System.getProperty(database.toLowerCase()+".user","kiwi"),
                    System.getProperty(database.toLowerCase()+".pass","kiwi"),
                    dialect);
        } else if (dialect instanceof H2Dialect) {
            config = new KiWiConfiguration(
                    "default-H2",
                    "jdbc:h2:mem:kiwitest;MVCC=true;DB_CLOSE_ON_EXIT=TRUE;DB_CLOSE_DELAY=-1",
                    "kiwi", "kiwi",
                    dialect);
        } else {
            return null;
        }
        config.setDefaultContext("http://localhost/context/default");
        config.setInferredContext("http://localhost/context/inferred");
        return config;
    }
View Full Code Here

    // keep track which memory sequences have been updated and need to be written back
    private Set<String>     sequencesUpdated;

    @Deprecated
    public KiWiPersistence(String name, String jdbcUrl, String db_user, String db_password, KiWiDialect dialect) {
        this(new KiWiConfiguration(name,jdbcUrl,db_user,db_password,dialect));
    }
View Full Code Here

    }

    @Deprecated
    public KiWiStore(String name, String jdbcUrl, String db_user, String db_password, KiWiDialect dialect, String defaultContext, String inferredContext) {
        this(new KiWiConfiguration(name,jdbcUrl,db_user,db_password,dialect, defaultContext, inferredContext));
    }
View Full Code Here

    @Before
    public void setup() throws RepositoryException, IOException, RDFParseException {
        // jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10
        repositoryRDF = new SailRepository(
                new KiWiStore(new KiWiConfiguration(
                        "kiwiTest",
                        "jdbc:h2:mem:facading;MVCC=true;DB_CLOSE_ON_EXIT=TRUE;DB_CLOSE_DELAY=10",
                        "", "", new H2Dialect(),
                        "http://example.com/ctx/default", "http://example.com/ctx/inferred")));
        repositoryRDF.initialize();
View Full Code Here

        String dbPasswd = configuration.getString("backend.kiwi.password");

        log.info("Initializing KiWiLoader for {}; user: {}, password: {}", dbCon, dbUser, String.format("%"+dbPasswd.length()+"s", "*"));

        try {
            KiWiConfiguration kiwi = new KiWiConfiguration("kiwiLoader", dbCon, dbUser, dbPasswd, getDialect(dbCon).newInstance());

            store = new KiWiStore(kiwi);

            repository = new SailRepository(store);
            repository.initialize();



            KiWiLoaderConfiguration loaderConfiguration = new KiWiLoaderConfiguration();
            if(configuration.containsKey(LoaderOptions.CONTEXT)) {
                loaderConfiguration.setContext(configuration.getString(LoaderOptions.CONTEXT));
            }

            loaderConfiguration.setDropIndexes(configuration.getBoolean("backend.kiwi.drop-indexes", false));

            if(kiwi.getDialect() instanceof PostgreSQLDialect) {
                log.info("- using PostgreSQL bulk loader ... ");
                loaderConfiguration.setCommitBatchSize(100000);
                handler = new KiWiPostgresHandler(store,loaderConfiguration);
            } else if(kiwi.getDialect() instanceof MySQLDialect) {
                log.info("- using MySQL bulk loader ... ");
                loaderConfiguration.setCommitBatchSize(100000);
                handler = new KiWiMySQLHandler(store,loaderConfiguration);
            } else {
                log.info("- using generic KiWi loader ... ");
View Full Code Here

TOP

Related Classes of org.apache.marmotta.kiwi.config.KiWiConfiguration

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.