Package de.zib.scalaris

Examples of de.zib.scalaris.TransactionSingleOp


        if (connection == null) {
            return new ValueResult<String>(false, "no connection to Scalaris",
                    true, statName, System.currentTimeMillis() - timeAtStart);
        }
       
        TransactionSingleOp scalaris_single = new TransactionSingleOp(connection);
        try {
            List<ErlangValue> pages = scalaris_single.read(getArticleListKey()).listValue();
            String randomTitle = pages.get(random.nextInt(pages.size())).stringValue();
            return new ValueResult<String>(randomTitle, statName,
                    System.currentTimeMillis() - timeAtStart);
        } catch (Exception e) {
            return new ValueResult<String>(false,
View Full Code Here


     * @return <tt>true</tt> on success,
     *         <tt>false</tt> if not found or no connection available
     */
    @Override
    protected synchronized boolean loadSiteInfo() {
        TransactionSingleOp scalaris_single;
        try {
            Connection conn = cPool.getConnection(MAX_WAIT_FOR_CONNECTION);
            if (conn == null) {
                System.err.println("Could not get a connection to Scalaris for siteinfo, waited " + MAX_WAIT_FOR_CONNECTION + "ms");
                return false;
            }
            scalaris_single = new TransactionSingleOp(conn);
            try {
                siteinfo = scalaris_single.read("siteinfo").jsonValue(SiteInfo.class);
                // TODO: fix siteinfo's base url
                namespace = new MyNamespace(siteinfo);
                initialized = true;
            } catch (Exception e) {
                // no warning here - this probably is an empty wiki
View Full Code Here

TOP

Related Classes of de.zib.scalaris.TransactionSingleOp

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.