public class Shard
extends java.lang.Object
implements org.apache.hadoop.io.WritableComparable
Constructor and Description |
---|
Shard()
Constructor.
|
Shard(long version,
java.lang.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.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
int |
compareTo(Shard other)
Compare to another shard.
|
boolean |
equals(java.lang.Object o) |
java.lang.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 java.lang.String |
normalizePath(java.lang.String path) |
void |
readFields(java.io.DataInput in) |
static void |
setIndexShards(IndexUpdateConfiguration conf,
Shard[] shards) |
java.lang.String |
toString() |
void |
write(java.io.DataOutput out) |
public Shard()
public Shard(long version, java.lang.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 java.lang.String normalizePath(java.lang.String path)
public static void setIndexShards(IndexUpdateConfiguration conf, Shard[] shards)
public static Shard[] getIndexShards(IndexUpdateConfiguration conf)
public long getVersion()
public java.lang.String getDirectory()
public long getGeneration()
public java.lang.String toString()
toString
in class java.lang.Object
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
java.io.IOException
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int compareTo(Shard other)
other
- another shardpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2009 The Apache Software Foundation