Skip to content

Commit

Permalink
datastore: use final in SolrManager members, #TASK-6981
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Oct 2, 2024
1 parent 444088d commit 179f751
Showing 1 changed file with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

public class SolrManager {

private List<String> hosts;
private String mode;
private final List<String> hosts;
private final String mode;
private final SolrClient solrClient;

private final Logger logger = LoggerFactory.getLogger(SolrManager.class);
Expand Down Expand Up @@ -323,7 +323,7 @@ public void close() throws IOException {
}

public SolrClient newSolrClient(int timeout) {
SolrClient solrClient;
final SolrClient solrClient;
if (hosts.get(0).startsWith("http")) {
if (hosts.size() == 1) {
// Single HTTP endpoint.
Expand Down Expand Up @@ -355,10 +355,6 @@ public SolrClient newSolrClient(int timeout) {
}

private boolean isCloud() {
if (StringUtils.isEmpty(mode)) {
logger.warn("Solr 'mode' is empty, setting default 'cloud'");
mode = "cloud";
}
switch (mode.toLowerCase()) {
case "collection":
case "cloud": {
Expand Down Expand Up @@ -388,20 +384,10 @@ public List<String> getHosts() {
return hosts;
}

public SolrManager setHosts(List<String> hosts) {
this.hosts = hosts;
return this;
}

public String getMode() {
return mode;
}

public SolrManager setMode(String mode) {
this.mode = mode;
return this;
}

public SolrClient getSolrClient() {
return solrClient;
}
Expand Down

0 comments on commit 179f751

Please sign in to comment.