diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/LicenseHeadersTask.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/LicenseHeadersTask.java index 45b6b1d142963..57e21836b331d 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/LicenseHeadersTask.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/LicenseHeadersTask.java @@ -166,8 +166,6 @@ public void runRat() { matchers.add(subStringMatcher("BSD4 ", "Original BSD License (with advertising clause)", "All advertising materials")); // Apache matchers.add(subStringMatcher("AL ", "Apache", "Licensed to Elasticsearch B.V. under one or more contributor")); - // Apache lz4-java - matchers.add(subStringMatcher("ALLZ4", "Apache LZ4-Java", "Copyright 2020 Adrien Grand and the lz4-java contributors")); // Generated resources matchers.add(subStringMatcher("GEN ", "Generated", "ANTLR GENERATED CODE")); // Vendored Code diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Compressor.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Compressor.java index 4e05139a8b187..80d60abbaeb3a 100644 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Compressor.java +++ b/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Compressor.java @@ -1,20 +1,9 @@ /* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.lz4; @@ -24,8 +13,9 @@ import java.nio.ByteBuffer; import java.util.Arrays; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4JavaSafeCompressor. * * It modifies the original implementation to use custom LZ4SafeUtils and SafeUtils implementations which diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Decompressor.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Decompressor.java index 38fcd020bca71..adc0892ca2521 100644 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Decompressor.java +++ b/libs/lz4/src/main/java/org/elasticsearch/lz4/ESLZ4Decompressor.java @@ -1,20 +1,9 @@ /* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ package org.elasticsearch.lz4; @@ -23,8 +12,9 @@ import java.nio.ByteBuffer; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4JavaSafeFastDecompressor. * * It modifies the original implementation to use custom LZ4SafeUtils and SafeUtils implementations which diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Constants.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Constants.java index 002f378c49d38..a10ba3902be79 100644 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Constants.java +++ b/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Constants.java @@ -1,26 +1,16 @@ /* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. * */ - package org.elasticsearch.lz4; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4Constants. * * There are no modifications. It is copied to this package for reuse as the original implementation is diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4SafeUtils.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4SafeUtils.java index f615f4040c3aa..5da6201a17ee2 100644 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4SafeUtils.java +++ b/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4SafeUtils.java @@ -1,22 +1,10 @@ /* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.lz4; import net.jpountz.lz4.LZ4Exception; @@ -31,8 +19,9 @@ import static org.elasticsearch.lz4.LZ4Constants.ML_MASK; import static org.elasticsearch.lz4.LZ4Constants.RUN_MASK; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4SafeUtils. * * It modifies the original implementation to use Java9 array mismatch method and varhandle performance diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Utils.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Utils.java index 996e1e4b2d6a8..4937cc0ce60fc 100644 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Utils.java +++ b/libs/lz4/src/main/java/org/elasticsearch/lz4/LZ4Utils.java @@ -1,22 +1,10 @@ /* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.lz4; import static org.elasticsearch.lz4.LZ4Constants.HASH_LOG; @@ -24,8 +12,9 @@ import static org.elasticsearch.lz4.LZ4Constants.HASH_LOG_HC; import static org.elasticsearch.lz4.LZ4Constants.MIN_MATCH; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4Utils. * * There are no modifications. It is copied to this package for reuse as the original implementation is diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/SafeUtils.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/SafeUtils.java index de8d1e3f0a458..2b397e75523e4 100644 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/SafeUtils.java +++ b/libs/lz4/src/main/java/org/elasticsearch/lz4/SafeUtils.java @@ -1,21 +1,10 @@ /* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.lz4; import net.jpountz.util.Utils; @@ -24,8 +13,9 @@ import java.lang.invoke.VarHandle; import java.nio.ByteOrder; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.SafeUtils. * * It modifies the original implementation to use Java9 varhandle performance improvements. Comments diff --git a/libs/lz4/src/main/java/org/elasticsearch/lz4/package-info.java b/libs/lz4/src/main/java/org/elasticsearch/lz4/package-info.java deleted file mode 100644 index a92712d4feb5d..0000000000000 --- a/libs/lz4/src/main/java/org/elasticsearch/lz4/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * @notice - * - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Modifications copyright (C) 2021 Elasticsearch B.V. - */ - -package org.elasticsearch.lz4; diff --git a/libs/lz4/src/test/java/org/elasticsearch/lz4/AbstractLZ4TestCase.java b/libs/lz4/src/test/java/org/elasticsearch/lz4/AbstractLZ4TestCase.java index d432c7868c40f..94e89dd93aac2 100644 --- a/libs/lz4/src/test/java/org/elasticsearch/lz4/AbstractLZ4TestCase.java +++ b/libs/lz4/src/test/java/org/elasticsearch/lz4/AbstractLZ4TestCase.java @@ -1,21 +1,10 @@ /* - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Modifications copyright (C) 2021 Elasticsearch B.V. + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.lz4; import net.jpountz.lz4.LZ4Compressor; @@ -33,8 +22,9 @@ import java.nio.ByteOrder; import java.util.Arrays; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.AbstractLZ4Test. * * It modifies the abstract test case to only test byte arrays and byte array backed byte buffers. These are diff --git a/libs/lz4/src/test/java/org/elasticsearch/lz4/ESLZ4Tests.java b/libs/lz4/src/test/java/org/elasticsearch/lz4/ESLZ4Tests.java index ff2c0b0378c2b..016ca742d05e0 100644 --- a/libs/lz4/src/test/java/org/elasticsearch/lz4/ESLZ4Tests.java +++ b/libs/lz4/src/test/java/org/elasticsearch/lz4/ESLZ4Tests.java @@ -1,21 +1,10 @@ /* - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Modifications copyright (C) 2021 Elasticsearch B.V. + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.lz4; import net.jpountz.lz4.LZ4Compressor; @@ -29,8 +18,9 @@ import java.nio.ByteBuffer; import java.util.Arrays; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular, it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4Test. * * It modifies the test case to remove unneeded tests (safe decompressor, native libs, etc). Additionally, diff --git a/server/src/main/java/org/elasticsearch/transport/ReuseBuffersLZ4BlockOutputStream.java b/server/src/main/java/org/elasticsearch/transport/ReuseBuffersLZ4BlockOutputStream.java index 312e716b99e17..205ee4452eed2 100644 --- a/server/src/main/java/org/elasticsearch/transport/ReuseBuffersLZ4BlockOutputStream.java +++ b/server/src/main/java/org/elasticsearch/transport/ReuseBuffersLZ4BlockOutputStream.java @@ -1,24 +1,13 @@ /* - * Copyright 2020 Adrien Grand and the lz4-java contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - package org.elasticsearch.transport; -import net.jpountz.lz4.LZ4BlockInputStream; import net.jpountz.lz4.LZ4Compressor; -import net.jpountz.lz4.LZ4FrameOutputStream; import net.jpountz.util.SafeUtils; import org.apache.lucene.util.BytesRef; @@ -27,8 +16,9 @@ import java.io.IOException; import java.io.OutputStream; -/** - * This file is forked from https://github.com/lz4/lz4-java. In particular it forks the following file +/* + * This file is forked from https://github.com/lz4/lz4-java, which is licensed under Apache-2 and Copyright + * 2020 Adrien Grand and the lz4-java contributors. In particular, it forks the following file * net.jpountz.lz4.LZ4BlockOutputStream. * * It modifies the original lz4-java code to allow the reuse of local thread local byte arrays. This prevents