|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.contrib.index.mapred.Shard
public class Shard
This class represents the metadata of a shard. Version is the version number of the entire index. Directory is the directory where this shard resides in. Generation is the Lucene index's generation. Version and generation are reserved for future use. Note: Currently the version number of the entire index is not used and defaults to -1.
Constructor Summary | |
---|---|
Shard()
Constructor. |
|
Shard(long version,
String dir,
long gen)
Construct a shard from a versio number, a directory and a generation number. |
|
Shard(Shard shard)
Construct using a shard object. |
Method Summary | |
---|---|
int |
compareTo(Object o)
|
int |
compareTo(Shard other)
Compare to another shard. |
boolean |
equals(Object o)
|
String |
getDirectory()
Get the directory where this shard resides. |
long |
getGeneration()
Get the generation of the Lucene instance. |
static Shard[] |
getIndexShards(IndexUpdateConfiguration conf)
|
long |
getVersion()
Get the version number of the entire index. |
int |
hashCode()
|
static String |
normalizePath(String path)
|
void |
readFields(DataInput in)
Deserialize the fields of this object from in . |
static void |
setIndexShards(IndexUpdateConfiguration conf,
Shard[] shards)
|
String |
toString()
|
void |
write(DataOutput out)
Serialize the fields of this object to out . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Shard()
public Shard(long version, String dir, long gen)
version
- the version number of the entire indexdir
- the directory where this shard residesgen
- the generation of the Lucene instancepublic Shard(Shard shard)
shard
- the shard used by the constructorMethod Detail |
---|
public static String normalizePath(String path)
public static void setIndexShards(IndexUpdateConfiguration conf, Shard[] shards)
public static Shard[] getIndexShards(IndexUpdateConfiguration conf)
public long getVersion()
public String getDirectory()
public long getGeneration()
public String toString()
toString
in class Object
public void write(DataOutput out) throws IOException
Writable
out
.
write
in interface Writable
out
- DataOuput
to serialize this object into.
IOException
public void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.
IOException
public int compareTo(Object o)
compareTo
in interface Comparable
public int compareTo(Shard other)
other
- another shard
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |