public class Shard extends Object implements WritableComparable
| 构造器和说明 |
|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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. |
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 constructorpublic static void setIndexShards(IndexUpdateConfiguration conf, Shard[] shards)
public static Shard[] getIndexShards(IndexUpdateConfiguration conf)
public long getVersion()
public String getDirectory()
public long getGeneration()
public void write(DataOutput out) throws IOException
Writableout.write 在接口中 Writableout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields 在接口中 Writablein - DataInput to deseriablize this object from.IOExceptionpublic int compareTo(Object o)
compareTo 在接口中 Comparablepublic int compareTo(Shard other)
other - another shardCopyright © 2009 The Apache Software Foundation