org.usergrid.persistence.cassandra
Class SimpleIndexBucketLocatorImpl
java.lang.Object
org.usergrid.persistence.cassandra.SimpleIndexBucketLocatorImpl
- All Implemented Interfaces:
- IndexBucketLocator
public class SimpleIndexBucketLocatorImpl
- extends Object
- implements IndexBucketLocator
Simple implementation that does static hashing across 100 rows. Future
implementations should be smarter and create new tokens as required when
buckets become too large for an entity property within an application for the given index type.
- Author:
- tnine
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MINIMUM
public static final BigInteger MINIMUM
MAXIMUM
public static final BigInteger MAXIMUM
SimpleIndexBucketLocatorImpl
public SimpleIndexBucketLocatorImpl(int size)
- Create a bucket locator with the specified size
- Parameters:
size
-
SimpleIndexBucketLocatorImpl
public SimpleIndexBucketLocatorImpl()
- Base constructor that creates a ring of 100 tokens
getBucket
public String getBucket(UUID applicationId,
IndexBucketLocator.IndexType type,
UUID entityId,
String... components)
- Description copied from interface:
IndexBucketLocator
- Return the bucket to use for indexing this entity
- Specified by:
getBucket
in interface IndexBucketLocator
- Parameters:
applicationId
- The application idtype
- The type of the index. This way indexing on the same property
value for different types of indexes does not cause collisions
on partitioning and lookupsentityId
- The entity id to be indexedcomponents
- The strings and uniquely identify the path to this index. I.E
entityType and propName, collection name etc This string must
remain the same for all reads and writes
- Returns:
getBuckets
public List<String> getBuckets(UUID applicationId,
IndexBucketLocator.IndexType type,
String... components)
- Description copied from interface:
IndexBucketLocator
- Get all buckets that exist for this application with the given entity
type, and property name
- Specified by:
getBuckets
in interface IndexBucketLocator
- Parameters:
applicationId
- The application idtype
- The type of indexcomponents
- The strings and uniquely identify the path to this index. I.E
entityType and propName, collection name etc
- Returns:
- All buckets for this application at the given component path
Copyright © 2013. All Rights Reserved.