All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.basho.riak.client.api.commands.mapreduce.BucketKeyMapReduce Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package com.basho.riak.client.api.commands.mapreduce;

import com.basho.riak.client.core.query.Location;

import java.util.ArrayList;
import java.util.List;

public class BucketKeyMapReduce extends MapReduce
{

	public BucketKeyMapReduce(BucketKeyInput input, Builder builder)
	{
		super(input, builder);
	}

	public static class Builder extends MapReduce.Builder
	{

		private List input =
				new ArrayList();

		@Override
		protected Builder self()
		{
			return this;
		}

		public Builder withLocation(Location location)
		{
			input.add(new BucketKeyInput.IndividualInput(location));
			return this;
		}

		public Builder withLocation(Location location, String keyData)
		{
			input.add(new BucketKeyInput.IndividualInput(location, keyData));
			return this;
		}

		public BucketKeyMapReduce build()
		{
			if (input == null)
			{
				throw new IllegalStateException("At least one location must be specified");
			}

			return new BucketKeyMapReduce(new BucketKeyInput(input), this);
		}

	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy