New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove some Internal* abstractions #8904
Conversation
Improves readability. +1 |
@@ -552,7 +549,7 @@ private void applyNewOrUpdatedShards(final ClusterChangedEvent event) throws Ela | |||
continue; | |||
} | |||
|
|||
InternalIndexShard indexShard = (InternalIndexShard) indexService.shard(shardId); | |||
IndexShard indexShard = (IndexShard) indexService.shard(shardId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cast is useless now? (There are a couple of other places that have this unnecessary cast)
+1, thanks for doing this. |
Same here, +1! The change looks good to me, I was looking for some usages of componentSettings that would break due to package name changes, but I could not find any. I think there are just a couple of unnecessary casts that can be removed now that there is a single impl. |
+1, wonderful! |
10802e0
to
57ffe75
Compare
removed unnecessary casts - I think it's ready - I wanna remove this soon since it's a large change |
We have lots of boilerplate code that is unnecessarily abstracting services ie InternalIndexShard and IndexShard or InternalIndexService and IndexService. It's enough to have concrete classes for these core classes.
57ffe75
to
15cd3f1
Compare
@@ -418,7 +407,7 @@ public synchronized void removeShard(int shardId, String reason, @Nullable final | |||
// and close the shard so no operations are allowed to it | |||
if (indexShard != null) { | |||
try { | |||
((InternalIndexShard) indexShard).close(reason); | |||
((IndexShard) indexShard).close(reason); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this cast?
We have lots of boilerplate code that is unnecessarily abstracting services ie InternalIndexShard and IndexShard or InternalIndexService and IndexService. It's enough to have concrete classes for these core classes. Closes #8904 Conflicts: src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java src/main/java/org/elasticsearch/index/IndexService.java src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayService.java src/main/java/org/elasticsearch/index/gateway/local/LocalIndexShardGateway.java src/main/java/org/elasticsearch/index/percolator/PercolatorQueriesRegistry.java src/main/java/org/elasticsearch/index/service/IndexService.java src/main/java/org/elasticsearch/index/shard/IndexShard.java src/main/java/org/elasticsearch/index/shard/service/IndexShard.java src/main/java/org/elasticsearch/index/termvectors/ShardTermVectorService.java src/main/java/org/elasticsearch/indices/InternalIndicesService.java src/test/java/org/elasticsearch/common/lucene/docset/DocIdSetsTests.java src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java src/test/java/org/elasticsearch/test/InternalTestCluster.java
We have lots of boilerplate code that is unnecessarily abstracting
services ie InternalIndexShard and IndexShard or InternalIndexService and
IndexService. It's enough to have concrete classes for these core classes.