Package com.basho.riak.client

Examples of com.basho.riak.client.RiakException


        final String strSpec = writeSpec();
        MapReduceSpec spec = new MapReduceSpec(strSpec);
        try {
            return client.mapReduce(spec);
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here


            jg.writeEndObject();
            jg.flush();

            return out.toString("UTF8");
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here

        // TODO, ok, this is lame, but it does the job at the moment
        // revisit when more checked exceptions are needed
        if (TIMEOUT_TUPLE.equals(erlangError)) {
            return new MapReduceTimeoutException();
        } else {
            return new RiakException(erlangError);
        }
    }
View Full Code Here

     *            The error from Riak
     * @return a {@link RiakException} as specific as possible
     * @throws IOException
     */
    public static RiakException parseException(final String json) {
        RiakException ex = null;
        try {
            Map<String, String> exceptionData = parseError(json);

            if (isTimeoutError(exceptionData)) {
                ex = new MapReduceTimeoutException();
            } else {
                ex = new RiakException(json);
            }
        } catch (IOException e) {
            ex = new RiakException(new StringBuilder().append(json).append(PARSE_ERROR).toString(), e);
        }

        return ex;
    }
View Full Code Here

     */
    public WalkResult execute() throws RiakException {
        try {
            return client.linkWalk(new LinkWalkSpec(steps, startBucket, startKey));
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here

     */
    public Iterable<String> keys() throws RiakException {
        try {
            return client.listKeys(name);
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here

        try {
            return client.mapReduce(spec);
        } catch(RiakError e) {
            throw ErlangTermErrorParser.parseErlangError(e.getMessage());
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here

            jg.writeEndObject();
            jg.flush();

            return out.toString("UTF8");
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here

     *            The error from Riak
     * @return a {@link RiakException} as specific as possible
     * @throws IOException
     */
    public static RiakException parseException(final String json) {
        RiakException ex = null;
        try {
            Map<String, String> exceptionData = parseError(json);

            if (isTimeoutError(exceptionData)) {
                ex = new MapReduceTimeoutException();
            } else {
                ex = new RiakException(json);
            }
        } catch (IOException e) {
            ex = new RiakException(new StringBuilder().append(json).append(PARSE_ERROR).toString(), e);
        }

        return ex;
    }
View Full Code Here

     */
    public Iterable<String> keys() throws RiakException {
        try {
            return client.listKeys(name);
        } catch (IOException e) {
            throw new RiakException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.basho.riak.client.RiakException

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.