Package org.elasticsearch.index.shard
Class ShardPath
org.elasticsearch.index.shard.ShardPath
public final class ShardPath
extends
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
deleteLeftoverShardDirectory(org.apache.logging.log4j.Logger logger, NodeEnvironment env, ShardLock lock, IndexSettings indexSettings, <[]> listener)
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
o)
boolean
exists()
Returns the data-path root for this shard.Returns the state-path root for this shard.int
hashCode()
boolean
Returnstrue
iff the data location is a custom data location and therefore outside of the nodes configured data paths.static ShardPath
loadShardPath(org.apache.logging.log4j.Logger logger, NodeEnvironment env, ShardId shardId, customDataPath)
This method walks through the nodes shard paths to find the data and state path for the given shard.static ShardPath
loadShardPath(org.apache.logging.log4j.Logger logger, ShardId shardId, customDataPath, [] availableShardPaths, int nodeLockId, sharedDataPath)
This method walks through the nodes shard paths to find the data and state path for the given shard.static ShardPath
selectNewPathForShard(NodeEnvironment env, ShardId shardId, IndexSettings indexSettings, long avgShardSizeInBytes, <,> dataPathToShardCount)
toString()
Methods inherited from class java.lang.
, , , , , , ,
-
Field Details
-
INDEX_FOLDER_NAME
public static final INDEX_FOLDER_NAME- See Also:
- Constant Field Values
-
TRANSLOG_FOLDER_NAME
public static final TRANSLOG_FOLDER_NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
ShardPath
-
-
Method Details
-
resolveTranslog
public resolveTranslog() -
resolveIndex
public resolveIndex() -
getDataPath
public getDataPath() -
exists
public boolean exists() -
getShardId
-
getShardStatePath
public getShardStatePath() -
getRootDataPath
public getRootDataPath()Returns the data-path root for this shard. The root is a parent ofgetDataPath()
without the index name and the shard ID. -
getRootStatePath
public getRootStatePath()Returns the state-path root for this shard. The root is a parent ofgetRootStatePath()
()} without the index name and the shard ID. -
isCustomDataPath
public boolean isCustomDataPath()Returnstrue
iff the data location is a custom data location and therefore outside of the nodes configured data paths. -
loadShardPath
public static ShardPath loadShardPath(org.apache.logging.log4j.Logger logger, NodeEnvironment env, ShardId shardId, customDataPath) throwsThis method walks through the nodes shard paths to find the data and state path for the given shard. If multiple directories with a valid shard state exist the one with the highest version will be used. Note: this method resolves custom data locations for the shard if such a custom data path is provided.- Throws:
-
loadShardPath
public static ShardPath loadShardPath(org.apache.logging.log4j.Logger logger, ShardId shardId, customDataPath, [] availableShardPaths, int nodeLockId, sharedDataPath) throwsThis method walks through the nodes shard paths to find the data and state path for the given shard. If multiple directories with a valid shard state exist the one with the highest version will be used. Note: this method resolves custom data locations for the shard.- Throws:
-
deleteLeftoverShardDirectory
public static void deleteLeftoverShardDirectory(org.apache.logging.log4j.Logger logger, NodeEnvironment env, ShardLock lock, IndexSettings indexSettings, <[]> listener) throwsThis 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.- Throws:
-
selectNewPathForShard
public static ShardPath selectNewPathForShard(NodeEnvironment env, ShardId shardId, IndexSettings indexSettings, long avgShardSizeInBytes, <,> dataPathToShardCount) throws- Throws:
-
equals
public boolean equals( o)- Overrides:
in class
-
hashCode
public int hashCode()- Overrides:
in class
-
toString
public toString()- Overrides:
in class
-