Package de.zib.scalaris

Examples of de.zib.scalaris.ConnectionFactory


     *            number of threads to spawn for each existing Scalaris node
     * @param benchmarks
     *            the benchmarks to run (1-9 or -1 for all benchmarks)
     */
    public static void minibench(final int operations, final int threadsPerNode, final Set<Integer> benchmarks) {
        final ConnectionFactory cf = ConnectionFactory.getInstance();
        final List<PeerNode> nodes = cf.getNodes();
        final int parallelRuns = nodes.size();
        // set a connection policy that goes through the available nodes in a round-robin fashion:
        cf.setConnectionPolicy(new RoundRobinConnectionPolicy(nodes));
        System.out.println("Number of available nodes: " + nodes.size());
        System.out.println("-> Using " + parallelRuns + " parallel instances per test run...");
        long[][] results;
        String[] columns;
        String[] rows;
View Full Code Here


     * @throws RuntimeException
     *             if the connection to Scalaris fails
     */
    public WikiDumpPreparedSQLiteToScalaris(String dbFileName) throws RuntimeException {
        this.dbFileName = dbFileName;
        this.cFactory = new ConnectionFactory();
        Random random = new Random();
        String clientName = new BigInteger(128, random).toString(16);
        this.cFactory.setClientName("wiki_import_" + clientName);
        this.cFactory.setClientNameAppendUUID(true);
        this.cFactory.setConnectionPolicy(
View Full Code Here

        } catch (IOException e) {
//            e.printStackTrace();
            properties = null;
        }
       
        ConnectionFactory cFactory;
        if (properties != null) {
            cFactory = new ConnectionFactory(properties);
        } else {
            cFactory = new ConnectionFactory();
            cFactory.setClientName("wiki");
        }
        Random random = new Random();
        String clientName = new BigInteger(128, random).toString(16);
        cFactory.setClientName(cFactory.getClientName() + '_' + clientName);
        cFactory.setClientNameAppendUUID(true);
//        cFactory.setConnectionPolicy(new RoundRobinConnectionPolicy(cFactory.getNodes()));

        cPool = new ConnectionPool(cFactory, CONNECTION_POOL_SIZE);
        loadSiteInfo();
        loadPlugins();
View Full Code Here

TOP

Related Classes of de.zib.scalaris.ConnectionFactory

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.