core/src/main/java/org/elasticsearch/indices/IndicesService.java
public boolean canDeleteIndexContents(Index index, IndexSettings indexSettings, boolean closed) {
        final IndexService indexService = this.indices.get(index.getName());
        // Closed indices may be deleted, even if they are on a shared
        // filesystem. Since it is closed we aren't deleting it for relocation
        if (indexSettings.isOnSharedFilesystem() == false || closed) {
            if (indexService == null && nodeEnv.hasNodeFile()) {
                return true;
            }
        } else {
            logger.trace("{} skipping index directory deletion due to shadow replicas", index);
        }
        return false;
    }
/**
     * This method returns true if the current node is allowed to delete the
     * given index. If the index uses a shared filesystem this method always
     * returns false.
     * @param index {@code Index} to check whether deletion is allowed
     * @param indexSettings {@code IndexSettings} for the given index
     * @return true if the index can be deleted on this node
     */
This method returns true if the current node is allowed to delete the
given index. If the index uses a shared filesystem this method always
returns false.
@param index  Index to check whether deletion is allowed
@param indexSettings  IndexSettings for the given index
@return true if the index can be deleted on this node
This method returns true if the current node is allowed to delete the given index . If the index uses a shared filesystem this method always returns false . @param index Index to check whether deletion is allowed @param indexSettings IndexSettings for the given index @return true if the index can be deleted on this node
public boolean canDeleteIndexContents(Index index, IndexSettings indexSettings, boolean closed) {
        final IndexService indexService = this.indices.get(index.getName());
        if (indexSettings.isOnSharedFilesystem() == false || closed) {
            if (indexService == null && nodeEnv.hasNodeFile()) {
                return true;
            }
        } else {
            logger.trace("{} skipping index directory deletion due to shadow replicas", index);
        }
        return false;
    }
public boolean canDeleteIndexContents ( Index index , IndexSettings indexSettings , boolean closed ) { final IndexService indexService = this . indices . get ( index . getName ( ) ) ; if ( indexSettings . isOnSharedFilesystem ( ) == false || closed ) { if ( indexService == null && nodeEnv . hasNodeFile ( ) ) { return true ; } } else { logger . trace ( "{} skipping index directory deletion due to shadow replicas" , index ) ; } return false ; }
This method returns true if the current node is allowed to delete the
 given index.
This method returns true if the current node is allowed to delete the given index .
// Closed indices may be deleted, even if they are on a shared // filesystem. Since it is closed we aren't deleting it for relocation