"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/rapidminer/repository/search/RepositoryGlobalSearchManager.java" between
rapidminer-studio-9.4.1-src.tar.gz and rapidminer-studio-9.5.0-src.tar.gz

About: RapidMiner Studio is a code-free environment for designing advanced analytic processes with machine learning, data mining, text mining, predictive analytics and business analytics. Java source.

RepositoryGlobalSearchManager.java  (rapidminer-studio-9.4.1-src):RepositoryGlobalSearchManager.java  (rapidminer-studio-9.5.0-src)
skipping to change at line 61 skipping to change at line 61
import com.rapidminer.repository.IOObjectEntry; import com.rapidminer.repository.IOObjectEntry;
import com.rapidminer.repository.Repository; import com.rapidminer.repository.Repository;
import com.rapidminer.repository.RepositoryException; import com.rapidminer.repository.RepositoryException;
import com.rapidminer.repository.RepositoryListener; import com.rapidminer.repository.RepositoryListener;
import com.rapidminer.repository.RepositoryLocation; import com.rapidminer.repository.RepositoryLocation;
import com.rapidminer.repository.RepositoryManager; import com.rapidminer.repository.RepositoryManager;
import com.rapidminer.repository.RepositoryManagerListener; import com.rapidminer.repository.RepositoryManagerListener;
import com.rapidminer.repository.internal.db.DBRepository; import com.rapidminer.repository.internal.db.DBRepository;
import com.rapidminer.repository.internal.remote.RESTRepository; import com.rapidminer.repository.internal.remote.RESTRepository;
import com.rapidminer.repository.internal.remote.RemoteRepository; import com.rapidminer.repository.internal.remote.RemoteRepository;
import com.rapidminer.repository.internal.remote.ResponseContainer;
import com.rapidminer.repository.internal.remote.exception.NotYetSupportedServic
eException;
import com.rapidminer.repository.resource.ResourceRepository; import com.rapidminer.repository.resource.ResourceRepository;
import com.rapidminer.search.AbstractGlobalSearchManager; import com.rapidminer.search.AbstractGlobalSearchManager;
import com.rapidminer.search.GlobalSearchDefaultField; import com.rapidminer.search.GlobalSearchDefaultField;
import com.rapidminer.search.GlobalSearchRegistry; import com.rapidminer.search.GlobalSearchRegistry;
import com.rapidminer.search.GlobalSearchResult; import com.rapidminer.search.GlobalSearchResult;
import com.rapidminer.search.GlobalSearchResultBuilder; import com.rapidminer.search.GlobalSearchResultBuilder;
import com.rapidminer.search.GlobalSearchUtilities; import com.rapidminer.search.GlobalSearchUtilities;
import com.rapidminer.tools.LogService; import com.rapidminer.tools.LogService;
import com.rapidminer.tools.ParameterService; import com.rapidminer.tools.ParameterService;
import com.rapidminer.tools.Tools; import com.rapidminer.tools.Tools;
skipping to change at line 351 skipping to change at line 353
* if {@code true}, RM Server will be asked to create a full index result including metadata (slow); otherwise metadata is omitted * if {@code true}, RM Server will be asked to create a full index result including metadata (slow); otherwise metadata is omitted
*/ */
private void indexRemoteFolder(final List<Document> list, final Folder fo lder, final RemoteRepository repository, final boolean fullIndex) { private void indexRemoteFolder(final List<Document> list, final Folder fo lder, final RemoteRepository repository, final boolean fullIndex) {
// relative path // relative path
String path = folder.getLocation().getPath(); String path = folder.getLocation().getPath();
if (path == null || Character.toString(RepositoryLocation.SEPARAT OR).equals(path)) { if (path == null || Character.toString(RepositoryLocation.SEPARAT OR).equals(path)) {
path = ""; path = "";
} }
try { try {
String apiPath = fullIndex ? API_REST_REMOTE_REPO_DETAILS ResponseContainer globalSearchResult;
: API_REST_REMOTE_REPO_SUMMARY; if (fullIndex) {
HttpURLConnection conn = repository.getHTTPConnection(api globalSearchResult = repository.getClient().getGl
Path, "?subfolder=" + URLEncoder.encode(path, StandardCharsets.UTF_8.name()), tr obalSearchItemDetails(path);
ue); } else {
conn.setRequestMethod("GET"); globalSearchResult = repository.getClient().getGl
conn.setUseCaches(false); obalSearchItemSummary(path);
conn.setAllowUserInteraction(false); }
conn.setRequestProperty("Content-Type", "application/json
"); int responseCode = globalSearchResult.getResponseCode();
int responseCode = conn.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) { if (responseCode == HttpURLConnection.HTTP_OK) {
// query worked, parse JSON to items and add to s earch index // query worked, parse JSON to items and add to s earch index
String json = Tools.readTextFile(conn.getInputStr eam()); String json = Tools.readTextFile(globalSearchResu lt.getInputStream());
RepositoryGlobalSearchItem[] repositorySearchItem s = WebServiceTools.parseJsonString(json, RepositoryGlobalSearchItem[].class, fa lse); RepositoryGlobalSearchItem[] repositorySearchItem s = WebServiceTools.parseJsonString(json, RepositoryGlobalSearchItem[].class, fa lse);
for (RepositoryGlobalSearchItem item : repository SearchItems) { for (RepositoryGlobalSearchItem item : repository SearchItems) {
// If an item has no parent, it's in the root folder. // If an item has no parent, it's in the root folder.
// Because the alias is locally defined, it is not known on RM Server. Set it here. // Because the alias is locally defined, it is not known on RM Server. Set it here.
if (item.getParent().isEmpty()) { if (item.getParent().isEmpty()) {
item.setParent(repository.getAlia s()); item.setParent(repository.getAlia s());
} }
// for the same reason as above, always s et the remote repository alias as repository before the absolute location // for the same reason as above, always s et the remote repository alias as repository before the absolute location
item.setLocation(RepositoryLocation.REPOS ITORY_PREFIX + repository.getAlias() + item.getLocation()); item.setLocation(RepositoryLocation.REPOS ITORY_PREFIX + repository.getAlias() + item.getLocation());
list.add(createDocument(item)); list.add(createDocument(item));
} }
} else { } else {
LogService.getRoot().log(Level.WARNING, "com.rapi dminer.repository.global_search.RepositorySearchManager.error.initial_index_erro r_remote_folder", new Object[]{repository.getName() + path, responseCode}); LogService.getRoot().log(Level.WARNING, "com.rapi dminer.repository.global_search.RepositorySearchManager.error.initial_index_erro r_remote_folder", new Object[]{repository.getName() + path, responseCode});
} }
} catch (IOException | RepositoryException e) { } catch (NotYetSupportedServiceException e) {
LogService.getRoot().log(Level.WARNING, "com.rapidminer.r
epository.global_search.RepositorySearchManager.error.initial_index_error_remote
_folder_old_server", new Object[]{repository.getName() + path});
}catch (IOException | RepositoryException e) {
LogService.getRoot().log(Level.WARNING, "com.rapidminer.r epository.global_search.RepositorySearchManager.error.initial_index_error_remote _folder", new Object[]{repository.getName() + path, e.getMessage()}); LogService.getRoot().log(Level.WARNING, "com.rapidminer.r epository.global_search.RepositorySearchManager.error.initial_index_error_remote _folder", new Object[]{repository.getName() + path, e.getMessage()});
} }
} }
/** /**
* Read all contents of the given REST repository/subfolder and store the m as {@link Document}s. If that fails, logs it. * Read all contents of the given REST repository/subfolder and store the m as {@link Document}s. If that fails, logs it.
* If the repository can not use the global search REST service, * If the repository can not use the global search REST service,
* normal indexing ({@link #indexFolder(List, Folder, boolean, ProgressTh read) indexFolder}) will be used! * normal indexing ({@link #indexFolder(List, Folder, boolean, ProgressTh read) indexFolder}) will be used!
* *
* @param list * @param list
 End of changes. 4 change blocks. 
13 lines changed or deleted 19 lines changed or added

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