Skip to content

Commit

Permalink
Release RapidMiner 9.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Timm committed Sep 26, 2019
1 parent 869802f commit 5d7d832
Show file tree
Hide file tree
Showing 192 changed files with 6,286 additions and 2,102 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ repositories {
dependencies {

// belt project for new data core
compile 'com.rapidminer:belt:1.0.0-BETA'
compile 'com.rapidminer:belt:1.0.0-BETA2'

// belt adapter for conversion between old and new core
compile ('com.rapidminer:belt-adapter:0.3'){
compile ('com.rapidminer:belt-adapter:0.5') {
exclude group: 'com.rapidminer.studio', module: 'rapidminer-studio-core'
exclude group: 'com.rapidminer', module: 'belt'
}

// OS X adapter to add platform specific UI
compile 'com.rapidminer.studio:rapidminer-studio-osx-adapter:1.0.2'

// RapidMiner license framework for license management
compile 'com.rapidminer.license:rapidminer-license-api:4.1.2'
compile('com.rapidminer.license:rapidminer-license-commons:4.1.2'){
compile "com.rapidminer.license:rapidminer-license-api:$licenseVersion"
compile("com.rapidminer.license:rapidminer-license-commons:$licenseVersion") {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
version=9.3.0
version=9.4.1
group=com.rapidminer.studio

licenseVersion=4.2.2
7 changes: 4 additions & 3 deletions src/main/java/com/rapidminer/Process.java
Original file line number Diff line number Diff line change
Expand Up @@ -1312,10 +1312,11 @@ private IOContainer execute(IOContainer input, boolean storeOutput, Handler logH
ActionStatisticsCollector.getInstance().logExecution(this);

IOContainer result;
if (Boolean.parseBoolean(ParameterService.getParameterValue(RapidMiner.PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES))) {
result = executeRootInPool(input, storeOutput);
} else {
// RA-2105: prevent pooled process execution for web apps
if (rootOperator.getUserData("WEBAPP_EXECUTION") != null) {
result = executeRoot(input, storeOutput);
} else {
result = executeRootInPool(input, storeOutput);
}
long end = System.currentTimeMillis();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rapidminer/RapidMiner.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public boolean isLoadingManagedExtensions() {
* the beta features should be set to disabled again for everyone. The settings.xml and Settings.properties
* have to be adjusted as well.
*/
public static final String PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES = "rapidminer.update.beta_features.v2";
public static final String PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES = "rapidminer.update.beta_features.v3";

/**
* The name of the property indicating whether or not additional permissions should be enabled
Expand Down
51 changes: 0 additions & 51 deletions src/main/java/com/rapidminer/adaption/belt/AtPortConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
*/
package com.rapidminer.adaption.belt;

import com.rapidminer.RapidMiner;
import com.rapidminer.belt.table.BeltConverter;
import com.rapidminer.core.concurrency.ConcurrencyContext;
import com.rapidminer.example.ExampleSet;
import com.rapidminer.operator.IOObject;
import com.rapidminer.operator.ports.Port;
import com.rapidminer.studio.internal.Resources;
import com.rapidminer.tools.ParameterService;
import com.rapidminer.tools.parameter.ParameterChangeListener;


/**
Expand All @@ -43,29 +40,6 @@ public final class AtPortConverter {
// Suppress default constructor for noninstantiability
private AtPortConverter() {throw new AssertionError();}

private static boolean betaMode = Boolean.parseBoolean(
ParameterService.getParameterValue(RapidMiner.PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES));

private static final ParameterChangeListener betaFeaturesListener = new ParameterChangeListener() {

@Override
public void informParameterChanged(String key, String value) {
if (RapidMiner.PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES.equals(key)) {
setBetaMode(value);
}
}

@Override
public void informParameterSaved() {
// do nothing
}

};

static {
ParameterService.registerParameterChangeListener(betaFeaturesListener);
}

/**
* Checks if is is possible to convert the dataClass into the desired class. Only conversion from an {@link
* ExampleSet} to a {@link IOTable} and vice versa is possible.
Expand Down Expand Up @@ -101,29 +75,4 @@ public static IOObject convert(IOObject data, Port port) {
}
}

/**
* Converts an {@link IOObject} if it is a type that should not leave an operator.
*
* @param data
* the data to check
* @param port
* the port where the conversion takes place
* @return a converted object or the same object if no conversion is necessary.
*/
public static IOObject convertIfNecessary(IOObject data, Port port) {
if (data instanceof IOTable && !betaMode) {
ConcurrencyContext context = Resources.getConcurrencyContext(port.getPorts().getOwner().getOperator());
return BeltConverter.convert((IOTable) data, context);
} else {
return data;
}
}

/**
* Set the beta mode static field to the parsed value.
*/
private static void setBetaMode(String value) {
betaMode = Boolean.parseBoolean(value);
}

}
5 changes: 4 additions & 1 deletion src/main/java/com/rapidminer/adaption/belt/IOTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ public Table getTable() {
public String toString() {
StringBuilder str = new StringBuilder(this.getClass().getSimpleName() + ":" + Tools.getLineSeparator());
str.append(table.height()).append(" examples,").append(Tools.getLineSeparator());
str.append(table.width()).append(" attributes,").append(Tools.getLineSeparator());

List<String> withRoles = table.select().withMetaData(ColumnRole.class).labels();
str.append(table.width() - withRoles.size()).append(" regular attributes,").append(Tools.getLineSeparator());

boolean first = true;
for (String label : withRoles) {
if (first) {
str.append("special attributes = {").append(Tools.getLineSeparator());
first = false;
} else {
str.append(',');
}
str.append(" ").append(BeltConverter.convertRole(table, label)).append(" = ").append(label)
.append(Tools.getLineSeparator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.rapidminer.connection.util.GenericHandlerRegistry;
import com.rapidminer.connection.util.GenericRegistrationEventListener;
import com.rapidminer.operator.OperatorVersion;
import com.rapidminer.tools.mail.connection.MailConnectionHandler;


/**
Expand All @@ -36,6 +37,12 @@ public final class ConnectionHandlerRegistry extends GenericHandlerRegistry<Conn

private static final ConnectionHandlerRegistry INSTANCE = new ConnectionHandlerRegistry();

static {
for (MailConnectionHandler handler : MailConnectionHandler.values()) {
getInstance().registerHandler(handler);
}
}

/**
* Singleton class, no instantiation allowed except for internal purpose
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
Expand All @@ -34,12 +35,16 @@
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.AccessController;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.UUID;
import java.util.logging.Level;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -296,6 +301,82 @@ public static ConnectionInformation loadFromZipFile(Path zipFile) throws IOExcep
return ConnectionInformationSerializer.LOCAL.loadConnection(new FileInputStream(zipFile.toFile()));
}

/**
* This method tries to add native libraries from a connection (defined as other files ending in *.so, *.dylib, and
* *.dll) to the native library lookup path. If a native lib has already been added, it will not be added again. If
* the connection does not have any files when calling {@link ConnectionInformation#getOtherFiles()}, nothing
* happens.
*
* @param ci the connection, never {@code null}
* @since 9.4.0
*/
public static void addNativeLibraries(ConnectionInformation ci) {
if (ci == null) {
throw new IllegalArgumentException("ci must not be null!");
}

for (Path otherFile : ci.getOtherFiles()) {
String fileName = otherFile.getFileName().toString();
if (isNativeLibrary(fileName)) {
String parentFolderPath = otherFile.getParent().toAbsolutePath().toString();

// add folders to usr_paths in ClassLoader (static variable), if they are not yet contained in there
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
try {
final Field usrPathsField = ClassLoader.class.getDeclaredField("usr_paths");
usrPathsField.setAccessible(true);
String[] paths = (String[]) usrPathsField.get(null);
if (paths == null) {
// if not yet initialized, trigger loading a fake lib so the arrays in the Classloader class get initialized
try {
System.loadLibrary(UUID.randomUUID().toString());
} catch (Throwable t) {
// ignore
}
paths = (String[]) usrPathsField.get(null);
}
boolean skipLoading = false;
// need to add path?
for (String path : paths) {
if (path != null && path.equals(parentFolderPath)) {
skipLoading = true;
break;
}
}

if (!skipLoading) {
// path not yet contained, add it
final String[] newPaths = Arrays.copyOf(paths, paths.length + 1);
newPaths[newPaths.length - 1] = parentFolderPath;
usrPathsField.set(null, newPaths);
LogService.getRoot().log(Level.INFO, "com.rapidminer.connection.ConnectionInformationFileUtils.added_to_native_path", fileName);
}
} catch (Throwable t) {
LogService.getRoot().log(Level.SEVERE, "com.rapidminer.connection.ConnectionInformationFileUtils.failed_add_native_path", fileName);
LogService.getRoot().log(Level.SEVERE, "", t);
}

return null;
});
}
}
}

/**
* Checks if the given file name indicates a native library (ends in *.dll, *.so, or *.dylib).
*
* @param fileName the file name including file suffix, must not be {@code null}
* @return {@code true} if it is a native library according to the file name; {@code false} otherwise
* @since 9.4.0
*/
public static boolean isNativeLibrary(String fileName) {
if (fileName == null) {
throw new IllegalArgumentException("fileName must not be null!");
}

return fileName.endsWith(".so") || fileName.endsWith(".dylib") || fileName.endsWith(".dll");
}

private static Path getCacheLocation() {
return FileSystemService.getUserRapidMinerDir().toPath().resolve(FileSystemService.RAPIDMINER_INTERNAL_CACHE_CONNECTION_FULL);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public List<ParameterType> getParameterTypes() {
parametersByGroup().forEach((group, names) -> names.forEach(name -> {
ParameterType parameterType = parameters.getParameterType(name);
// ignore irrelevant parameters
if (parameterType == null || parameterType.isOptional()) {
if (parameterType == null || parameterType.isOptional() || parameterType.isHidden()) {
return;
}
String fullKey = group + '.' + name;
Expand Down Expand Up @@ -610,13 +610,11 @@ public Object getDefaultValue() {
cis = new ConnectionInformationSelector(operator, handler.getType());
provider.setConnectionSelector(cis);
cis.makeDefaultPortTransformation();
operator.getTransformer().addRule(() -> {
Optional.ofNullable(provider.getConnectionSelector())
.filter(sel -> sel.getInput() == null || !sel.getInput().isConnected())
.flatMap(suppress(sel -> operator.getParameter(PARAMETER_CONNECTION_SOURCE)).andThen(o -> Optional.of(o == null ? PREDEFINED_MODE : o)))
.filter(PREDEFINED_MODE::equals).map(s -> new SimpleProcessSetupError(Severity.WARNING, operator.getPortOwner(), "connection.deprecated"))
.ifPresent(operator::addError);
});
operator.getTransformer().addRule(() -> Optional.ofNullable(provider.getConnectionSelector())
.filter(sel -> sel.getInput() == null || !sel.getInput().isConnected())
.flatMap(suppress(sel -> operator.getParameter(PARAMETER_CONNECTION_SOURCE)).andThen(o -> Optional.of(o == null ? PREDEFINED_MODE : o)))
.filter(PREDEFINED_MODE::equals).map(s -> new SimpleProcessSetupError(Severity.WARNING, operator.getPortOwner(), "connection.deprecated"))
.ifPresent(operator::addError));
}
if (cis.getInput() != null) {
connectionSource.registerDependencyCondition(
Expand All @@ -639,24 +637,7 @@ public Object getDefaultValue() {
* the operator to add the rule to; must not be {@code null}
*/
public static <O extends Operator & ConnectionSelectionProvider> MDTransformationRule createProcessSetupRule(O operator) {
return () -> {
ConnectionInformationSelector selector = operator.getConnectionSelector();
if (selector == null) {
return;
}
ProcessSetupError error = selector.checkConnectionTypeMatch(operator);
if (error == null) {
return;
}
if (error instanceof MetaDataError) {
InputPort input = selector.getInput();
if (input != null) {
input.addError((MetaDataError) error);
return;
}
}
operator.addError(error);
};
return ConnectionInformationSelector.makeConnectionCheckTransformation(operator);
}

/**
Expand All @@ -677,7 +658,7 @@ public static <T extends Configurable> T getAdapter(Operator operator, String ol
* <li>If the {@link ConnectionInformationSelector#getInput() input port} exists and connected will take
* a {@link ConnectionInformation} from there</li>
* <li>If the {@value #REPOSITORY_MODE} is selected for {@value #PARAMETER_CONNECTION_SOURCE}, uses the parameter
* {@value ConnectionInformationSelector#PARAMETER_CONNECTION_ENTRY} to find the {@link ConnectionInformation} </li>
* {@link ConnectionInformationSelector#getParameterKey()} to find the {@link ConnectionInformation} </li>
* <li>If the {@value #PREDEFINED_MODE} is selected for {@value #PARAMETER_CONNECTION_SOURCE}, uses the parameter
* {@code oldParameterKey} to find the {@link ConfigurationManager#lookup(String, String, RepositoryAccessor) adapter}</li>
* </ol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ protected void addInjectableTab(ConnectionParameterGroupModel group, JComponent
String typeKey = getConnectionModel().getType();
String groupKey = group.getName();
String title = ConnectionI18N.getGroupName(typeKey, groupKey, ConnectionI18N.LABEL_SUFFIX, groupKey);
String tip = ConnectionI18N.getGroupName(typeKey, groupKey, ConnectionI18N.LABEL_SUFFIX, null);
String tip = ConnectionI18N.getGroupName(typeKey, groupKey, ConnectionI18N.TIP_SUFFIX, null);
Icon icon = ConnectionI18N.getGroupIcon(typeKey, groupKey);

getTabbedPane().addTab(title, icon, panelAndInject, tip);
Expand Down Expand Up @@ -464,4 +464,20 @@ public static JPanel addInformationIcon(JComponent parameterInputComponent, Stri
return informationWrapper;
}

/**
* Updates and links visibility of the component to its parameter's enabled state.
*
* @param component
* the component to be wrapped; must not be {@code null}
* @param parameter
* the parameter, whose enabled state should be listened to; must not be {@code null}
* @return the component with visibility awareness
* @since 9.4.1
*/
public static JComponent visibilityWrapper(JComponent component, ConnectionParameterModel parameter) {
parameter.enabledProperty().addListener((observable, oldValue, newValue) -> SwingTools.invokeLater(() -> component.setVisible(newValue)));
component.setVisible(parameter.isEnabled());
return component;
}

}
Loading

0 comments on commit 5d7d832

Please sign in to comment.