public class KeyIntervals
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
DESTROY |
static int |
GET |
static int |
INVALIDATE |
static int |
LOCAL_DESTROY |
static int |
LOCAL_INVALIDATE |
static int |
NONE |
static int |
UPDATE_EXISTING_KEY |
| Constructor and Description |
|---|
KeyIntervals(int numKeys)
Constructor to create an instance of KeyInterval using the given number
of keys and all intervals defined in this class.
|
KeyIntervals(int[] includeIntervals,
int numKeys)
Constructor to create an instance of KeyInterval using the given number
of keys and the intervals in includeIntervals.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getFirstKey(int whichInterval)
Given an interval, return its first key index.
|
int |
getLastKey(int whichInterval)
Given an interval, return its last key index.
|
int |
getNumKeys()
Return the total number of keys for all intervals.
|
int |
getNumKeys(int whichInterval)
Return the total number of keys for the given interval.
|
java.lang.String |
intervalToString(int whichInterval)
Given an interval, return a String describing it
|
boolean |
keyInRange(int whichInterval,
long keyIndex)
Determine if a key index is in range of an interval.
|
int |
opForKeyIndex(long keyIndex)
Return the op for the given keyIndex, or -1 if none
|
java.lang.String |
toString()
Return a string describing the intervals in this instance
|
public static final int NONE
public static final int INVALIDATE
public static final int LOCAL_INVALIDATE
public static final int DESTROY
public static final int LOCAL_DESTROY
public static final int UPDATE_EXISTING_KEY
public static final int GET
public KeyIntervals(int[] includeIntervals,
int numKeys)
includeIntervals - - the intervals to use when dividing numKeys into intervalsnumKeys - - the total number of keys to use to divide among the intervals.public KeyIntervals(int numKeys)
numKeys - - the total number of keys to use to divide among the intervals.public int getFirstKey(int whichInterval)
whichInterval - - the interval to get the first key for.public int getLastKey(int whichInterval)
whichInterval - - the interval to get the last key for.public int getNumKeys()
public int getNumKeys(int whichInterval)
public java.lang.String intervalToString(int whichInterval)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean keyInRange(int whichInterval,
long keyIndex)
whichInterval - The interval to consider for the range.keyIndex - The specific key index.public int opForKeyIndex(long keyIndex)
keyIndex - Find the op for this keyIndexCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.