Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEDE-4869] Upgrade Arrow version to 4.0.0 #16

Merged
merged 78 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
37e3aa7
Make BaseValueVector#MAX_ALLOCATION_SIZE configurable
laurentgo Apr 18, 2016
36934a0
prefix arrow's version with siren
scampi Oct 27, 2017
f775b41
use our version of netty
scampi Oct 27, 2017
965c694
updated readme about siren's changes
scampi Oct 27, 2017
2d95009
fixed dependency issue with our own artifactory
scampi Oct 27, 2017
b49ed93
use our version of netty
scampi Dec 1, 2017
e5ef15b
shade the arrow memory jar
scampi Dec 1, 2017
105f61f
improved doc
scampi Mar 13, 2018
d5a5953
fix readme
scampi Aug 14, 2019
0a97b4a
document the changes done to the arrow fork
scampi Sep 16, 2019
98af6ec
ARROW-5856: [Python] [Packaging] Fix use of C++ / Cython API from wheels
pitrou Jul 16, 2019
98ca086
use our version of netty
scampi Oct 27, 2017
883c893
set drill's default value
scampi Oct 27, 2017
a6f90f2
use our version of netty
scampi Dec 1, 2017
1cf4cbe
bumped to 0.8.0
scampi Mar 13, 2018
49bd8fc
update to 0.14.1
scampi Sep 17, 2019
88a3f62
comment unneeded modules
scampi Sep 19, 2019
90968ce
update release procedure with unneeded modules commented out
scampi Sep 19, 2019
29fd716
bump version to siren-0.14.1-1 and update readme
scampi Nov 19, 2019
ad3b1e0
do not allocate a new offset buffer if the slice starts at 0 since th…
scampi Feb 10, 2020
286f9fb
fix slice bounds
scampi Feb 11, 2020
3580c6f
improved readme
GeorgeAp Feb 18, 2020
37ac963
Upgraded netty dependendcy to siren-4.1.27-3
manseaume Oct 14, 2020
a8c58d9
[FEDE-3917] netty direct memory counter deprecation with bump to sire…
itudoben Nov 23, 2020
a4f50fb
Fix rebase
GeorgeAp Jun 6, 2021
d7824b0
Fix pom
GeorgeAp Jun 7, 2021
c7a17a9
Fix rebase - Bump version to siren-4.0.0-1-SNAPSHOT
GeorgeAp Jun 7, 2021
fd3a41b
Clean-up
GeorgeAp Jun 7, 2021
9967efa
Comment out memory-netty module and remove use siren netty
GeorgeAp Jun 7, 2021
1d8e183
Update siren netty version
GeorgeAp Jun 7, 2021
c2163cb
Fix rebase
GeorgeAp Jun 7, 2021
8e8633d
Comment netty
GeorgeAp Jun 7, 2021
75c489b
Fix TestValueVector
GeorgeAp Jun 7, 2021
c82be02
Remove unused imports
GeorgeAp Jun 7, 2021
814e327
Remove unused import
GeorgeAp Jun 7, 2021
3623c3f
Clean up
GeorgeAp Jun 7, 2021
b26bec2
Clean up - fix checkstyle
GeorgeAp Jun 8, 2021
8fb0a62
Clean up - fix checkstyle 2
GeorgeAp Jun 8, 2021
fe59613
WIP
GeorgeAp Jun 8, 2021
9b2a562
WIP - add siren netty plugin
GeorgeAp Jun 8, 2021
9e8011b
WIP - ignore failing test
GeorgeAp Jun 9, 2021
c3ebc9b
Fix rebase as per peer review
GeorgeAp Jun 9, 2021
115f964
Fix rebase python
GeorgeAp Jun 9, 2021
93c7b41
Fix ZeroVector unused imports
GeorgeAp Jun 9, 2021
9a4b8b3
Fix checkstyle
GeorgeAp Jun 9, 2021
14df3df
Fix rebase
GeorgeAp Jun 9, 2021
a45517b
Fix rebase
GeorgeAp Jun 9, 2021
ffb9291
Fix checkstyle imports violation
GeorgeAp Jun 9, 2021
e25e8ec
Fix checkstyle and update netty version
GeorgeAp Jun 21, 2021
a73101d
Use Arrow's ArrowBuf instead of our own
GeorgeAp Jul 5, 2021
cfa6070
Fix imports
GeorgeAp Jul 5, 2021
3d7bd90
Fix checkstyle
GeorgeAp Jul 8, 2021
6d94b43
Tentative fix: workaround for the shading issue but creat new problems
ggdupont Jul 16, 2021
1b5a35e
fix missing import
ggdupont Jul 16, 2021
7da1af1
Fix import
GeorgeAp Jul 16, 2021
e8f38e9
Fix imports
GeorgeAp Jul 16, 2021
0e5862e
Revert ignored unit tests
GeorgeAp Jul 19, 2021
a1921ea
Revert automatic format changes
GeorgeAp Jul 23, 2021
cede323
Revert format to original format
GeorgeAp Jul 23, 2021
333f1b8
Update vector pom as per peer review
GeorgeAp Jul 23, 2021
b188a31
Revert ignored TestArrowBufHasher.testHasherNegative
GeorgeAp Jul 23, 2021
8942391
Clean up
GeorgeAp Jul 23, 2021
831c485
Update as per peer review
GeorgeAp Aug 2, 2021
388be9c
Undo unnecessary change in tasks.yml
GeorgeAp Aug 2, 2021
4afff23
Undo unnecessary changes
GeorgeAp Aug 2, 2021
fe8a7a6
Revert changes
GeorgeAp Aug 2, 2021
c837af0
Revert changes
GeorgeAp Aug 2, 2021
601fead
Revert changes as per peer review
GeorgeAp Aug 2, 2021
5d79a19
Update as per peer review
GeorgeAp Aug 3, 2021
c636730
Add back class path dependency exclusion
GeorgeAp Aug 3, 2021
8d6d67e
Remove whitespace
GeorgeAp Aug 3, 2021
3aba23a
Update memory access with default value
GeorgeAp Aug 3, 2021
1e22aea
Remove class path exclusion
GeorgeAp Aug 3, 2021
0827e53
Update readme
GeorgeAp Aug 3, 2021
5ed587b
Exclude memory-core from the shaded netty in memory-netty package
GeorgeAp Aug 6, 2021
418aaf6
Add information for checking that Siren version of Netty is used
GeorgeAp Nov 4, 2021
f243f2a
[FEDE-5144] Fix the static initialization of MemoryUtil (#17)
scampi Nov 25, 2021
e7aa338
Update netty version to the stable version siren-4.1.48-1
GeorgeAp Nov 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,73 @@
under the License.
-->

# Siren fork of Arrow

- The properties `drill.enable_unsafe_memory_access` and
`arrow.enable_unsafe_memory_access` are prefixed with `siren` and their
default value is set to `true`. The first property is deprecated.

- In order to avoid conflict with a version of `netty` used in Elasticsearch, we
relocate the netty custom package and dependency in `memory` into a package
named `siren`. The relocation is achieved thanks to the maven shade plugin.

- The Siren's fork of `netty` is used in `vector`. This means that `netty`
imports in that module need to be prefixed with `siren`.

## Check that Siren version of Netty is used
- In order to check that Siren version of Netty is being used,
run the unit test `CheckAccessibleTest` in
`https://github.com/sirensolutions/siren-platform/blob/master/core/src/test/java/io/siren/federate/core/common/CheckAccessibleTest.java`.
- Note: the unit test `CheckAccessibleTest` is currently ignored, please set it again to ignore after running the test.
The unit test is ignored because the settings in `CheckAccessibleTest` is not taken into account when the whole unit test suite is run, therefore it fails.
This could be because when the class is loaded, the default settings is used (which is a static block) and the new settings in the `CheckAccessibleTest` is
then not applied when the test suit is run.

## Build

To build the `memory`, `format` and `vector` modules:

```sh
$ cd java
$ mvn clean package
```

Because of the default value change of `unsafe_memory_access` property, some
tests in `vector` fail.

```sh
mvn -pl memory,memory/memory-core,memory/memory-netty,memory/memory-unsafe,format,vector install -Dsiren.arrow.enable_unsafe_memory_access=false -Dsiren.drill.enable_unsafe_memory_access=false
```

## Make a new release

- Tests should pass.

- Make a new version:

```sh
mvn versions:set -DnewVersion=siren-0.14.1-2
```

- tag the commit for the release

```sh
git tag --sign siren-0.14.1-2
````

- Deploy to Siren's artifactory

```sh
$ mvn deploy -DskipTests=true -P artifactory -Dartifactory_username=<USERNAME> -Dartifactory_password=<PASSWORD>
```

## Update to a new version of Apache Arrow

- add `git@github.com:apache/arrow.git` as the `upstream` remote.
- execute `git fetch --all --tags`
- create a temporary branch from `siren-changes`
- rebase against the new tag.

# Apache Arrow

[![Build Status](https://ci.appveyor.com/api/projects/status/github/apache/arrow/branch/master?svg=true)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/branch/master)
Expand Down Expand Up @@ -98,6 +165,37 @@ integrations in other projects, we'd be happy to have you involved:
- [Learn the format][2]
- Contribute code to one of the reference implementations

### How to Contribute

We prefer to receive contributions in the form of GitHub pull requests. Please
send pull requests against the [github.com/apache/arrow][4] repository.

If you are looking for some ideas on what to contribute, check out the [JIRA
issues][3] for the Apache Arrow project. Comment on the issue and/or contact
[dev@arrow.apache.org](http://mail-archives.apache.org/mod_mbox/arrow-dev/)
with your questions and ideas.

If you’d like to report a bug but don’t have time to fix it, you can still post
it on JIRA, or email the mailing list
[dev@arrow.apache.org](http://mail-archives.apache.org/mod_mbox/arrow-dev/)

To contribute a patch:

1. Break your work into small, single-purpose patches if possible. It’s much
harder to merge in a large change with a lot of disjoint features.
2. Create a JIRA for your patch on the [Arrow Project
JIRA](https://issues.apache.org/jira/browse/ARROW).
3. Submit the patch as a GitHub pull request against the master branch. For a
tutorial, see the GitHub guides on forking a repo and sending a pull
request. Prefix your pull request name with the JIRA name (ex:
https://github.com/apache/arrow/pull/240).
4. Make sure that your code passes the unit tests. You can find instructions
how to run the unit tests for each Arrow component in its respective README
file.
5. Add new unit tests for your code.

Thank you in advance for your contributions!

[1]: mailto:dev-subscribe@arrow.apache.org
[2]: https://github.com/apache/arrow/tree/master/format
[3]: https://issues.apache.org/jira/browse/ARROW
Expand Down
2 changes: 1 addition & 1 deletion java/adapter/orc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<parent>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-java-root</artifactId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion java/format/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<artifactId>arrow-java-root</artifactId>
<groupId>org.apache.arrow</groupId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
GeorgeAp marked this conversation as resolved.
Show resolved Hide resolved
</parent>

<artifactId>arrow-format</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion java/gandiva/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-java-root</artifactId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
</parent>

<groupId>org.apache.arrow.gandiva</groupId>
Expand Down
4 changes: 3 additions & 1 deletion java/memory/memory-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>arrow-memory</artifactId>
<groupId>org.apache.arrow</groupId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -30,10 +30,12 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>2.8.2</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ public class BoundsChecking {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BoundsChecking.class);

static {
String envProperty = System.getenv("ARROW_ENABLE_UNSAFE_MEMORY_ACCESS");
String oldProperty = System.getProperty("drill.enable_unsafe_memory_access");
String envProperty = System.getenv().getOrDefault("SIREN_ARROW_ENABLE_UNSAFE_MEMORY_ACCESS", "true");
String oldProperty = System.getProperty("siren.drill.enable_unsafe_memory_access", "true");
if (oldProperty != null) {
logger.warn("\"drill.enable_unsafe_memory_access\" has been renamed to \"arrow.enable_unsafe_memory_access\"");
logger.warn("\"arrow.enable_unsafe_memory_access\" can be set to: " +
" true (to not check) or false (to check, default)");
logger.warn("\"siren.drill.enable_unsafe_memory_access\" has been renamed to " +
"\"siren.arrow.enable_unsafe_memory_access\"");
logger.warn("\"siren.arrow.enable_unsafe_memory_access\" can be set to: " +
" true (to not check, default) or false (to check)");
}
String newProperty = System.getProperty("arrow.enable_unsafe_memory_access");
String newProperty = System.getProperty("siren.arrow.enable_unsafe_memory_access", "true");

// The priority of determining the unsafe flag:
// 1. The system properties take precedence over the environmental variable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public Object run() {

// get the offset of the address field in a java.nio.Buffer object
Field addressField = java.nio.Buffer.class.getDeclaredField("address");
addressField.setAccessible(true);
BYTE_BUFFER_ADDRESS_OFFSET = UNSAFE.objectFieldOffset(addressField);

Constructor<?> directBufferConstructor;
Expand All @@ -99,10 +98,7 @@ public Object run() {
constructor.setAccessible(true);
logger.debug("Constructor for direct buffer found and made accessible");
return constructor;
} catch (NoSuchMethodException e) {
logger.debug("Cannot get constructor for direct buffer allocation", e);
return e;
} catch (SecurityException e) {
} catch (Exception e) {
logger.debug("Cannot get constructor for direct buffer allocation", e);
return e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ private boolean getFlagValue(ClassLoader classLoader) throws Exception {
}

/**
* Ensure the flag for bounds checking is enabled by default.
* Siren: Ensure the flag for bounds checking is disabled by default.
* This will protect users from JVM crashes.
*/
@Test
public void testDefaultValue() throws Exception {
ClassLoader classLoader = copyClassLoader();
if (classLoader != null) {
boolean boundsCheckingEnabled = getFlagValue(classLoader);
Assert.assertTrue(boundsCheckingEnabled);
Assert.assertFalse(boundsCheckingEnabled);
}
}

Expand Down
46 changes: 45 additions & 1 deletion java/memory/memory-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>arrow-memory</artifactId>
<groupId>org.apache.arrow</groupId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -35,9 +35,11 @@
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</dependency>
<!--provided by elasticsearch-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
Expand All @@ -62,6 +64,48 @@
<user.timezone>UTC</user.timezone>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<relocations>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>siren.io.netty</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<excludes>
<exclude>org.slf4j</exclude>
<exclude>com.google.code.findbugs</exclude>
<exclude>com.google.guava</exclude>
<exclude>org.apache.arrow:arrow-memory-core:*:*</exclude>
</excludes>
</artifactSet>
<!--to prevent the Invalid signature file error -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
2 changes: 1 addition & 1 deletion java/memory/memory-unsafe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<artifactId>arrow-memory</artifactId>
<groupId>org.apache.arrow</groupId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion java/memory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-java-root</artifactId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
</parent>
<artifactId>arrow-memory</artifactId>
<name>Arrow Memory</name>
Expand Down
38 changes: 27 additions & 11 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>org.apache.arrow</groupId>
<artifactId>arrow-java-root</artifactId>
<version>4.0.0</version>
<version>siren-4.0.0-1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Apache Arrow Java Root POM</name>
Expand All @@ -33,7 +33,7 @@
<dep.junit.jupiter.version>5.4.0</dep.junit.jupiter.version>
<dep.slf4j.version>1.7.25</dep.slf4j.version>
<dep.guava.version>20.0</dep.guava.version>
<dep.netty.version>4.1.48.Final</dep.netty.version>
<dep.netty.version>siren-4.1.48-1</dep.netty.version>
<dep.jackson.version>2.11.4</dep.jackson.version>
<dep.hadoop.version>2.7.1</dep.hadoop.version>
<dep.fbs.version>1.12.0</dep.fbs.version>
Expand Down Expand Up @@ -657,15 +657,12 @@
<module>format</module>
<module>memory</module>
<module>vector</module>
<module>tools</module>
<module>adapter/jdbc</module>
<module>plasma</module>
<module>flight/flight-core</module>
<module>flight/flight-grpc</module>
<module>performance</module>
<module>algorithm</module>
<module>adapter/avro</module>
<module>compression</module>
<!--<module>tools</module>-->
<!--<module>adapter/jdbc</module>-->
<!--<module>plasma</module>-->
<!--<module>flight</module>-->
<!--<module>performance</module>-->
<!--<module>algorithm</module>-->
</modules>

<profiles>
Expand Down Expand Up @@ -758,6 +755,25 @@
</plugins>
</build>
</profile>


<!-- To deploy to Siren artifactory -->
<profile>
<id>artifactory</id>

<distributionManagement>
<repository>
<id>artifactory-releases</id>
<name>artifactory-releases</name>
<url>${artifactory.url}/libs-release-local</url>
</repository>
<snapshotRepository>
<id>artifactory-snapshots</id>
<name>artifactory-snapshots</name>
<url>${artifactory.url}/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
</profile>

</profiles>

Expand Down
Loading