|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvoldemort.store.readonly.ReadOnlyUtils
public class ReadOnlyUtils
| Field Summary | |
|---|---|
static int |
POSITION_SIZE
|
| Constructor Summary | |
|---|---|
ReadOnlyUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
checkVersionDirName(java.io.File versionDir)
Checks if the name of the file follows the version-n format |
static int |
chunk(byte[] key,
int numChunks)
|
static java.io.File[] |
findKthVersionedDir(java.io.File[] versionDirs,
int start,
int end)
Returns the directories sorted and indexed between [start, end] where start >= 0 and end < len(files) |
static int |
getChunkId(java.lang.String fileName)
Returns the chunk id for the file name |
static java.io.File |
getCurrentVersion(java.io.File storeDirectory)
Retrieve the dir pointed to by 'latest' symbolic-link or the current version dir |
static java.io.File |
getLatestDir(java.io.File parentDir)
Retrieve the directory pointed by latest symbolic link |
static Pair<java.lang.Integer,java.lang.Integer> |
getPartitionReplicaTuple(java.lang.String fileName)
Given a file name first checks whether it belongs to storage format v2 and then retieves the tuple of |
static java.io.File[] |
getVersionDirs(java.io.File rootDir)
Returns all the version directories present in the root directory specified |
static java.io.File[] |
getVersionDirs(java.io.File rootDir,
long minId,
long maxId)
Returns all the version directories present in the root directory specified |
static long |
getVersionId(java.io.File versionDir)
Extracts the version id from the directory |
static boolean |
isFormatCorrect(java.lang.String fileName,
ReadOnlyStorageFormat format)
Given a file name and read-only storage format, tells whether the file name format is correct |
static byte[] |
readKey(java.nio.ByteBuffer index,
int indexByteOffset,
byte[] foundKey)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int POSITION_SIZE
| Constructor Detail |
|---|
public ReadOnlyUtils()
| Method Detail |
|---|
public static int chunk(byte[] key,
int numChunks)
public static byte[] readKey(java.nio.ByteBuffer index,
int indexByteOffset,
byte[] foundKey)
public static boolean isFormatCorrect(java.lang.String fileName,
ReadOnlyStorageFormat format)
fileName - The name of the fileformat - The RO format
public static Pair<java.lang.Integer,java.lang.Integer> getPartitionReplicaTuple(java.lang.String fileName)
fileName - The name of the file
public static int getChunkId(java.lang.String fileName)
fileName - The file name
public static java.io.File getCurrentVersion(java.io.File storeDirectory)
public static java.io.File getLatestDir(java.io.File parentDir)
parentDir - The root directory
public static boolean checkVersionDirName(java.io.File versionDir)
versionDir - The directory
public static long getVersionId(java.io.File versionDir)
versionDir - The directory path
public static java.io.File[] getVersionDirs(java.io.File rootDir)
rootDir - The parent directory
public static java.io.File[] getVersionDirs(java.io.File rootDir,
long minId,
long maxId)
rootDir - The parent directorymaxId - The
public static java.io.File[] findKthVersionedDir(java.io.File[] versionDirs,
int start,
int end)
TODO: Can be made better using 'selection algorithm'
versionDirs - The list of files to search instart - Starting indexend - End index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||