Skip to content

Commit c4b8316

Browse files
MINOR: Remove some deadcode in NodeEnv and Related (#34133)
1 parent 94df8ec commit c4b8316

File tree

3 files changed

+3
-26
lines changed

3 files changed

+3
-26
lines changed

server/src/main/java/org/elasticsearch/env/NodeEnvironment.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,8 @@ public void deleteIndexDirectoryUnderLock(Index index, IndexSettings indexSettin
551551
* @param index the index to lock shards for
552552
* @param lockTimeoutMS how long to wait for acquiring the indices shard locks
553553
* @return the {@link ShardLock} instances for this index.
554-
* @throws IOException if an IOException occurs.
555554
*/
556-
public List<ShardLock> lockAllForIndex(Index index, IndexSettings settings, long lockTimeoutMS)
557-
throws IOException, ShardLockObtainFailedException {
555+
public List<ShardLock> lockAllForIndex(Index index, IndexSettings settings, long lockTimeoutMS) throws ShardLockObtainFailedException {
558556
final int numShards = settings.getNumberOfShards();
559557
if (numShards <= 0) {
560558
throw new IllegalArgumentException("settings must contain a non-null > 0 number of shards");
@@ -842,7 +840,7 @@ public Set<String> availableIndexFoldersForPath(final NodePath nodePath) throws
842840
/**
843841
* Resolves all existing paths to <code>indexFolderName</code> in ${data.paths}/nodes/{node.id}/indices
844842
*/
845-
public Path[] resolveIndexFolder(String indexFolderName) throws IOException {
843+
public Path[] resolveIndexFolder(String indexFolderName) {
846844
if (nodePaths == null || locks == null) {
847845
throw new IllegalStateException("node is not configured to store local location");
848846
}
@@ -987,17 +985,6 @@ public void ensureAtomicMoveSupported() throws IOException {
987985
}
988986
}
989987

990-
/**
991-
* Resolve the custom path for a index's shard.
992-
* Uses the {@code IndexMetaData.SETTING_DATA_PATH} setting to determine
993-
* the root path for the index.
994-
*
995-
* @param indexSettings settings for the index
996-
*/
997-
public Path resolveBaseCustomLocation(IndexSettings indexSettings) {
998-
return resolveBaseCustomLocation(indexSettings, sharedDataPath, nodeLockId);
999-
}
1000-
1001988
/**
1002989
* Resolve the custom path for a index's shard.
1003990
* Uses the {@code IndexMetaData.SETTING_DATA_PATH} setting to determine

server/src/main/java/org/elasticsearch/env/ShardLock.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* directory. Internal processes should acquire a lock on a shard
3030
* before executing any write operations on the shards data directory.
3131
*
32-
* @see org.elasticsearch.env.NodeEnvironment
32+
* @see NodeEnvironment
3333
*/
3434
public abstract class ShardLock implements Closeable {
3535

@@ -56,13 +56,6 @@ public final void close() {
5656

5757
protected abstract void closeInternal();
5858

59-
/**
60-
* Returns true if this lock is still open ie. has not been closed yet.
61-
*/
62-
public final boolean isOpen() {
63-
return closed.get() == false;
64-
}
65-
6659
@Override
6760
public String toString() {
6861
return "ShardLock{" +

server/src/main/java/org/elasticsearch/indices/store/TransportNodesListShardStoreMetaData.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,6 @@ public void writeTo(StreamOutput out) throws IOException {
254254

255255
public static class NodesStoreFilesMetaData extends BaseNodesResponse<NodeStoreFilesMetaData> {
256256

257-
NodesStoreFilesMetaData() {
258-
}
259-
260257
public NodesStoreFilesMetaData(ClusterName clusterName, List<NodeStoreFilesMetaData> nodes, List<FailedNodeException> failures) {
261258
super(clusterName, nodes, failures);
262259
}

0 commit comments

Comments
 (0)