SOLR-14680: make jdk 8 compatible

This commit is contained in:
noblepaul 2020-08-13 13:47:40 +10:00
parent d517361bb1
commit 0b55c94ad6
3 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ public interface SimpleMap<T> extends MapWriter {
* @param fun Consume each entry and return a boolean to signal whether to proceed or not. If true, continue, if false stop
*/
default void abortableForEach(BiFunction<String, ? super T, Boolean> fun) {
forEachEntry(new BiConsumer<>() {
forEachEntry(new BiConsumer<String, T>() {
boolean end = false;
@Override
public void accept(String k, T v) {

View File

@ -66,7 +66,7 @@ public class LazySolrCluster implements SolrCluster {
return Boolean.FALSE;
});
return new SimpleMap<>() {
return new SimpleMap<CollectionConfig>() {
@Override
public CollectionConfig get(String key) {
if (configNames.contains(key)) {
@ -91,7 +91,7 @@ public class LazySolrCluster implements SolrCluster {
}
private SimpleMap<SolrNode> lazyNodeMap() {
return new SimpleMap<>() {
return new SimpleMap<SolrNode>() {
@Override
public SolrNode get(String key) {
if (!zkStateReader.getClusterState().liveNodesContain(key)) {
@ -115,7 +115,7 @@ public class LazySolrCluster implements SolrCluster {
}
private SimpleMap<SolrCollection> lazyCollectionsWithAlias(ZkStateReader zkStateReader) {
return new SimpleMap<>() {
return new SimpleMap<SolrCollection>() {
@Override
public SolrCollection get(String key) {
SolrCollection result = collections.get(key);
@ -145,7 +145,7 @@ public class LazySolrCluster implements SolrCluster {
}
private SimpleMap<SolrCollection> lazyCollectionsMap(ZkStateReader zkStateReader) {
return new SimpleMap<>() {
return new SimpleMap<SolrCollection>() {
@Override
public SolrCollection get(String key) {
return _collection(key, null);
@ -338,7 +338,7 @@ public class LazySolrCluster implements SolrCluster {
@Override
public String name() {
return replica.name;
return replica.getName();
}
@Override
@ -363,7 +363,7 @@ public class LazySolrCluster implements SolrCluster {
@Override
public Replica.Type type() {
return replica.type;
return replica.getType();
}
@Override

View File

@ -109,7 +109,7 @@ public class SimpleZkMap implements SimpleMap<Resource> {
try {
Map<String, List<String>> withKids = new LinkedHashMap<>();
for (String child : childrenList) {
String relativePath = parent.isBlank() ? child: parent+"/"+child;
String relativePath = parent.isEmpty() ? child: parent+"/"+child;
if(!fun.apply(relativePath, readZkNode(relativePath))) return false;
List<String> l1 = zkStateReader.getZkClient().getChildren(basePath+ "/"+ relativePath, null, true);
if(l1 != null && !l1.isEmpty()) {