Examples of IRiakClient


Examples of com.basho.riak.client.IRiakClient

    private final Bucket bucket;

    RiakRecordWriter(TaskAttemptContext tac) throws RiakException {
        Configuration conf = tac.getConfiguration();
        IRiakClient client = ClientFactory.clusterClient(RiakConfig.getRiakLocatons(conf));
        bucket = client.fetchBucket(RiakConfig.getOutputBucket(conf)).execute();
    }
View Full Code Here

Examples of com.basho.riak.client.IRiakClient

    public static IRiakClient getClient(RiakLocation location) throws RiakException {
        // TODO this should use getRawClient, but DefaultRiakClient's
        // constructor is wrong visibility
        // Either change the visibility or add a method to the factory to accept
        // a delegate (the latter!)
        IRiakClient client = null;
        switch (location.getTransport()) {
        case PB:
            client = RiakFactory.pbcClient(location.getHost(), location.getPort());
            break;
        case HTTP:
View Full Code Here

Examples of com.basho.riak.client.IRiakClient

     * @return
     * @throws IllegalArgumentException
     *             if locations are not all of same {@link RiakTransport}
     */
    public static IRiakClient clusterClient(RiakLocation[] riakLocatons) throws RiakException {
        IRiakClient client = null;
        RiakTransport transport = null;

        if (riakLocatons != null && riakLocatons.length > 0) {
            transport = riakLocatons[0].getTransport();
        }
View Full Code Here

Examples of com.basho.riak.client.IRiakClient

     */
    public static List<BucketKey> getKeys(RiakLocation[] locations, KeyLister keyLister, int attemptNumber)
            throws RiakException {
        final List<BucketKey> keys = new ArrayList<BucketKey>();
        try {
            IRiakClient attemptClient = getClient(locations[attemptNumber]);
            keys.addAll(keyLister.getKeys(attemptClient));
        } catch (RiakException e) {
            if (attemptNumber >= (locations.length - 1)) {
                throw e;
            } else {
View Full Code Here

Examples of com.basho.riak.client.IRiakClient

    Bucket myBucket;

    @PostConstruct
    private void initDB() {
        try {
            IRiakClient client = RiakFactory.pbcClient("localhost", 8087);
            myBucket = client.fetchBucket("test").execute();
        } catch (RiakException ex) {
            Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
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.