"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "solr/core/src/java/org/apache/solr/pkg/PackageLoader.java" between
solr-8.4.0-src.tgz and solr-8.4.1-src.tgz

About: Solr is the search platform from the Apache Lucene project. Its major features include full-text search, hit highlighting, faceted search, caching, replication, and a web admin interface.

PackageLoader.java  (solr-8.4.0-src.tgz):PackageLoader.java  (solr-8.4.1-src.tgz)
skipping to change at line 168 skipping to change at line 168
public boolean isDeleted() { public boolean isDeleted() {
return deleted; return deleted;
} }
private synchronized void updateVersions(List<PackageAPI.PkgVersion> modifie d) { private synchronized void updateVersions(List<PackageAPI.PkgVersion> modifie d) {
for (PackageAPI.PkgVersion v : modified) { for (PackageAPI.PkgVersion v : modified) {
Version version = myVersions.get(v.version); Version version = myVersions.get(v.version);
if (version == null) { if (version == null) {
log.info("A new version: {} added for package: {} with artifacts {}", v.version, this.name, v.files); log.info("A new version: {} added for package: {} with artifacts {}", v.version, this.name, v.files);
myVersions.put(v.version, new Version(this, v)); Version ver = null;
try {
ver = new Version(this, v);
} catch (Exception e) {
log.error("package could not be loaded "+ ver.toString(), e);
continue;
}
myVersions.put(v.version, ver);
sortedVersions.add(v.version); sortedVersions.add(v.version);
} }
} }
Set<String> newVersions = new HashSet<>(); Set<String> newVersions = new HashSet<>();
for (PackageAPI.PkgVersion v : modified) { for (PackageAPI.PkgVersion v : modified) {
newVersions.add(v.version); newVersions.add(v.version);
} }
for (String s : new HashSet<>(myVersions.keySet())) { for (String s : new HashSet<>(myVersions.keySet())) {
if (!newVersions.contains(s)) { if (!newVersions.contains(s)) {
skipping to change at line 247 skipping to change at line 254
@Override @Override
public void writeMap(EntryWriter ew) throws IOException { public void writeMap(EntryWriter ew) throws IOException {
ew.put("package", parent.name()); ew.put("package", parent.name());
version.writeMap(ew); version.writeMap(ew);
} }
Version(Package parent, PackageAPI.PkgVersion v) { Version(Package parent, PackageAPI.PkgVersion v) {
this.parent = parent; this.parent = parent;
this.version = v; this.version = v;
List<Path> paths = new ArrayList<>(); List<Path> paths = new ArrayList<>();
List<String> errs = new ArrayList<>();
coreContainer.getPackageStoreAPI().validateFiles(version.files, true, s
-> errs.add(s));
if(!errs.isEmpty()) {
throw new RuntimeException("Cannot load package: " +errs);
}
for (String file : version.files) { for (String file : version.files) {
//ensure that the files are downloaded and available
coreContainer.getPackageStoreAPI().getPackageStore().fetch(file,null);
paths.add(coreContainer.getPackageStoreAPI().getPackageStore().getReal path(file)); paths.add(coreContainer.getPackageStoreAPI().getPackageStore().getReal path(file));
} }
try { try {
loader = new SolrResourceLoader( loader = new SolrResourceLoader(
"PACKAGE_LOADER: " + parent.name() + ":" + version, "PACKAGE_LOADER: " + parent.name() + ":" + version,
paths, paths,
coreContainer.getResourceLoader().getInstancePath(), coreContainer.getResourceLoader().getInstancePath(),
coreContainer.getResourceLoader().getClassLoader()); coreContainer.getResourceLoader().getClassLoader());
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
skipping to change at line 282 skipping to change at line 293
public SolrResourceLoader getLoader() { public SolrResourceLoader getLoader() {
return loader; return loader;
} }
@Override @Override
public void close() throws IOException { public void close() throws IOException {
if (loader != null) { if (loader != null) {
closeWhileHandlingException(loader); closeWhileHandlingException(loader);
} }
} }
@Override
public String toString() {
return jsonStr();
}
} }
} }
private static String findBiggest(String lessThan, List<String> sortedList) { private static String findBiggest(String lessThan, List<String> sortedList) {
String latest = null; String latest = null;
for (String v : sortedList) { for (String v : sortedList) {
if (v.compareTo(lessThan) < 1) { if (v.compareTo(lessThan) < 1) {
latest = v; latest = v;
} else break; } else break;
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)