Skip to content

Commit

Permalink
Release RapidMiner Belt 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gisa Meier committed Mar 25, 2021
1 parent 50f85ee commit 8c5c4c3
Show file tree
Hide file tree
Showing 258 changed files with 3,387 additions and 910 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ It provides utility methods for creating, reading, and modifying such tables.
This copy of RapidMiner Belt is licensed under the Affero General Public License version 3.
See the attached [LICENSE file](LICENSE) for details.

**This is a beta version.**
Be cautious when using the Belt project in production code:
the API is not finalized yet and might undergo smaller changes until the release of version 1.0.

## Table of Contents

- [Concepts and example](#belt-introduction)
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.rapidminer</groupId>
<artifactId>belt</artifactId>
<version>1.0.0-BETA6</version>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>belt</name>
<organization>
Expand Down Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rapidminer/belt/buffer/Buffers.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rapidminer/belt/buffer/ObjectBuffer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rapidminer/belt/buffer/RealBuffer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rapidminer/belt/buffer/TimeBuffer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
57 changes: 54 additions & 3 deletions src/main/java/com/rapidminer/belt/column/CacheMappedColumn.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand All @@ -16,7 +16,12 @@

package com.rapidminer.belt.column;

import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;

import com.rapidminer.belt.execution.ExecutionAbortedException;
import com.rapidminer.belt.util.Mapping;


/**
Expand All @@ -39,6 +44,52 @@ public interface CacheMappedColumn {
* map from old mapping to merged mapping when merged with the given mapping
* @return a mapped column
*/
Column map(int[] mapping, boolean preferView, Map<int[], int[]> cache);
Column map(int[] mapping, boolean preferView, ConcurrentHashMap<int[], CompletableFuture<int[]>> cache);

/**
* Merges the key with the mapping or waits until someone else has computed the result.
*
* @param key
* the current mapping
* @param mapping
* the mapping to merge
* @param cache
* the cache containing merged mappings or ongoing computations
* @return the merged mapping
*/
default int[] waitForOrCompute(int[] key, int[] mapping,
ConcurrentHashMap<int[], CompletableFuture<int[]>> cache) {
int[] merged;
CompletableFuture<int[]> completableFuture = new CompletableFuture<>();
CompletableFuture<int[]> before = cache.putIfAbsent(key, completableFuture);
if (before != null) {
try {
merged = before.get();
} catch (InterruptedException e) {
throw new ExecutionAbortedException("Execution aborted by invoker");
} catch (ExecutionException e) {
//checked exceptions cannot happen by setup, handle unchecked ones
Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
} else if (cause instanceof Error) {
throw (Error) cause;
} else {
throw new ExecutionAbortedException("Computation aborted with checked exception", cause);
}
}
} else {
try {
merged = Mapping.merge(mapping, key);
completableFuture.complete(merged);
} catch (Throwable t) {
//need to complete for other waiters in any case
completableFuture.completeExceptionally(t);
throw t;
}
}

return merged;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* This file is part of the RapidMiner Belt project.
* Copyright (C) 2017-2020 RapidMiner GmbH
* Copyright (C) 2017-2021 RapidMiner GmbH
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
Expand Down
Loading

0 comments on commit 8c5c4c3

Please sign in to comment.