public final class ShardPath extends Object
Modifier and Type | Field and Description |
---|---|
static String |
INDEX_FOLDER_NAME |
static String |
TRANSLOG_FOLDER_NAME |
Constructor and Description |
---|
ShardPath(boolean isCustomDataPath,
Path dataPath,
Path shardStatePath,
String indexUUID,
ShardId shardId) |
Modifier and Type | Method and Description |
---|---|
static void |
deleteLeftoverShardDirectory(ESLogger logger,
NodeEnvironment env,
ShardLock lock,
Settings indexSettings)
This method tries to delete left-over shards where the index name has been reused but the UUID is different
to allow the new shard to be allocated.
|
boolean |
equals(Object o) |
boolean |
exists() |
Path |
getDataPath() |
String |
getIndexUUID() |
Path |
getRootDataPath()
Returns the data-path root for this shard.
|
Path |
getRootStatePath()
Returns the state-path root for this shard.
|
ShardId |
getShardId() |
Path |
getShardStatePath() |
int |
hashCode() |
boolean |
isCustomDataPath()
Returns
true iff the data location is a custom data location and therefore outside of the nodes configured data paths. |
static ShardPath |
loadShardPath(ESLogger logger,
NodeEnvironment env,
ShardId shardId,
Settings indexSettings)
This method walks through the nodes shard paths to find the data and state path for the given shard.
|
Path |
resolveIndex() |
Path |
resolveTranslog() |
static ShardPath |
selectNewPathForShard(NodeEnvironment env,
ShardId shardId,
Settings indexSettings,
long avgShardSizeInBytes,
Map<Path,Integer> dataPathToShardCount) |
String |
toString() |
public static final String INDEX_FOLDER_NAME
public static final String TRANSLOG_FOLDER_NAME
public Path resolveTranslog()
public Path resolveIndex()
public Path getDataPath()
public boolean exists()
public String getIndexUUID()
public ShardId getShardId()
public Path getShardStatePath()
public Path getRootDataPath()
getDataPath()
without the index name
and the shard ID.public Path getRootStatePath()
getRootStatePath()
()} without the index name
and the shard ID.public boolean isCustomDataPath()
true
iff the data location is a custom data location and therefore outside of the nodes configured data paths.public static ShardPath loadShardPath(ESLogger logger, NodeEnvironment env, ShardId shardId, Settings indexSettings) throws IOException
IOException
public static void deleteLeftoverShardDirectory(ESLogger logger, NodeEnvironment env, ShardLock lock, Settings indexSettings) throws IOException
IOException
public static ShardPath selectNewPathForShard(NodeEnvironment env, ShardId shardId, Settings indexSettings, long avgShardSizeInBytes, Map<Path,Integer> dataPathToShardCount) throws IOException
IOException
Copyright © 2009–2017. All rights reserved.