Skip to content
Permalink
Browse files
More License cleanup.
  • Loading branch information
leerho committed Aug 7, 2019
1 parent 93cbe61 commit 710c52974dd5c8d56e751a48f319df6dcdea2382
Showing 15 changed files with 54 additions and 50 deletions.
17 LICENSE
@@ -264,6 +264,23 @@ support library is itself covered by the above license.
* src/test/java/org/apache/datasketches/memory/Utf8Test.java
* src/test/java/org/apache/datasketches/memory/IsValidUtf8TestUtil.java


The BSD-2-Clause License
================================

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This product contains code for encoding, decoding and testing UTF8
adapted from C++ href="https://github.com/Cyan4973/xxHash.
* src/main/java/org/apache/datasketches/memory/XxHash64.java


Public Domain
================================
This product contains the text of Lincoln's Gettysburg Address which is used in various file tests.
@@ -76,8 +76,9 @@ final class AccessByteBuffer {
}

/**
* This method is adapted from https://github.com/odnoklassniki/one-nio\
* /blob/master/src/one/nio/mem/DirectMemory.java : wrap(...). See LICENSE.
* This method is adapted from
* https://github.com/odnoklassniki/one-nio/blob/master/src/one/nio/mem/DirectMemory.java
* : wrap(...). See LICENSE.
*/
static ByteBuffer getDummyReadOnlyDirectByteBuffer(final long address, final int capacity) {
final ByteBuffer buf = ZERO_READ_ONLY_DIRECT_BYTE_BUFFER.duplicate();
@@ -40,12 +40,12 @@
* Allocates direct memory used to memory map files for read operations.
* (including those > 2GB).
*
* <p>Reference native code for map0, unmap0:
* <p>To understand how it works, reference native code for map0, unmap0:
* <a href="http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/f940e7a48b72/src/solaris/native/
* sun/nio/ch/FileChannelImpl.c">
* FileChannelImpl.c</a></p>
*
* <p>Reference native code for load0(), isLoaded0(), and force0():
* <p>To understand how it works, reference native code for load0(), isLoaded0(), and force0():
* <a href="http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/f940e7a48b72/src/solaris/native/
* java/nio/MappedByteBuffer.c">
* MappedByteBuffer.c</a></p>
@@ -29,24 +29,12 @@
interface Map extends AutoCloseable {

/**
* Loads content into physical memory. This method makes a best effort to ensure that, when it
* returns, this buffer's content is resident in physical memory. Invoking this method may cause
* some number of page faults and I/O operations to occur.
*
* @see <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/MappedByteBuffer.html#load--">
* java/nio/MappedByteBuffer.load</a>
*/
void load();

/**
* Tells whether or not the content is resident in physical memory. A return value of true implies
* that it is highly likely that all of the data in this buffer is resident in physical memory and
* may therefore be accessed without incurring any virtual-memory page faults or I/O operations. A
* return value of false does not necessarily imply that the content is not resident in physical
* memory. The returned value is a hint, rather than a guarantee, because the underlying operating
* system may have paged out some of the buffer's data by the time that an invocation of this
* method returns.
*
* @return true if loaded
*
* @see <a href=
@@ -29,18 +29,18 @@
import java.nio.CharBuffer;

/**
* Encoding and decoding implementations of {@link WritableMemory#putCharsToUtf8} and {@link
* Memory#getCharsFromUtf8}.
* Encoding and decoding implementations of {@link WritableMemory#putCharsToUtf8} and
* {@link Memory#getCharsFromUtf8}.
*
* <p>This is specifically designed to reduce the production of intermediate objects (garbage),
* thus significantly reducing pressure on the JVM Garbage Collector.
*
* <p>UTF-8 encoding/decoding is adapted from
* https://github.com/protocolbuffers/protobuf\
* /blob/master/java/core/src/main/java/com/google/protobuf/Utf8.java
* https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/main/java/com/google/protobuf/Utf8.java
*
* <p>Copyright 2008 Google Inc. All rights reserved.
* https://developers.google.com/protocol-buffers/
* See LICENSE.
*
* @author Lee Rhodes
* @author Roman Leventov
@@ -29,24 +29,6 @@
interface WritableMap extends Map {

/**
* Forces any changes made to this content to be written to the storage device containing the
* mapped file.
*
* <p>
* If the file mapped into this buffer resides on a local storage device then when this method
* returns, it is guaranteed that all changes made to the buffer since it was created, or since
* this method was last invoked, will have been written to that device.
* </p>
*
* <p>
* If the file does not reside on a local device then no such guarantee can be made.
* </p>
*
* <p>
* If this buffer was not mapped in read/write mode
* (java.nio.channels.FileChannel.MapMode.READ_WRITE) then invoking this method has no effect.
* </p>
*
* @see <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/MappedByteBuffer.html#force--">
* java/nio/MappedByteBuffer.force</a>
*/
@@ -38,19 +38,19 @@
/**
* The XxHash is a fast, non-cryptographic, 64-bit hash function that has
* excellent avalanche and 2-way bit independence properties.
* This java version used the C++ version and the OpenHFT/Zero-Allocation-Hashing implementation
* This java version adapted the C++ version and the OpenHFT/Zero-Allocation-Hashing implementation
* referenced below as inspiration.
*
* <p>The C++ source repository:
* <a href="https://github.com/Cyan4973/xxHash">
* https://github.com/Cyan4973/xxHash</a>. It has a BSD 2-Clause License:
* <a href="http://www.opensource.org/licenses/bsd-license.php">
* http://www.opensource.org/licenses/bsd-license.php</a>
* http://www.opensource.org/licenses/bsd-license.php</a>. See LICENSE.
*
* <p>Portions of this code were adapted from
* <a href="https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/main/java/net/openhft/hashing/XxHash.java">
* OpenHFT/Zero-Allocation-Hashing</a>,
* which has an Apache 2 license as does this site.
* which has an Apache 2 license as does this site. See LICENSE.
*
* @author Lee Rhodes
*/
@@ -17,6 +17,10 @@
* under the License.
*/

/*
* Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
*/

package org.apache.datasketches.memory;

import static org.testng.Assert.assertEquals;
@@ -17,6 +17,10 @@
* under the License.
*/

/*
* Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
*/

package org.apache.datasketches.memory;

import static org.apache.datasketches.memory.AllocateDirectMap.isFileReadOnly;
@@ -21,11 +21,11 @@

/**
* Stripped down version of
* https://github.com/protocolbuffers/protobuf\
* /blob/master/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java
* https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/test/java/com/google/protobuf/IsValidUtf8TestUtil.java
*
* Copyright 2008 Google Inc. All rights reserved.
* https://developers.google.com/protocol-buffers/
* See LICENSE.
*/
public class IsValidUtf8TestUtil {

@@ -17,6 +17,10 @@
* under the License.
*/

/*
* Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
*/

package org.apache.datasketches.memory;

import static org.testng.Assert.assertEquals;
@@ -35,11 +35,11 @@

/**
* Adapted version of
* https://github.com/protocolbuffers/protobuf\
* /blob/master/java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java
* https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java
*
* Copyright 2008 Google Inc. All rights reserved.
* https://developers.google.com/protocol-buffers/
* See LICENSE.
*/
public class Utf8Test {

@@ -17,6 +17,10 @@
* under the License.
*/

/*
* Note: Lincoln's Gettysburg Address is in the public domain. See LICENSE.
*/

package org.apache.datasketches.memory;

import static org.apache.datasketches.memory.Util.characterPad;
@@ -30,9 +30,9 @@ public class XxHash64LoopingTest {

/*
* This test is adapted from
* <a href="https://github.com/OpenHFT/Zero-Allocation-Hashing\
* /blob/master/src/test/java/net/openhft/hashing/XxHashTest.java">
* <a href="https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/test/java/net/openhft/hashing/XxHashTest.java">
* OpenHFT/Zero-Allocation-Hashing</a> to test hash compatibility with that implementation.
* See LICENSE.
*/
@Test
public void testWithSeed() {
@@ -49,6 +49,7 @@ public void testWithSeed() {
/*This data is from
* <a href="https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/test/java/net/openhft/hashing/XxHashTest.java">
* OpenHFT/Zero-Allocation-Hashing</a> to test hash compatibility with that implementation.
* See LICENSE.
*/
private static final long[] HASHES_OF_LOOPING_BYTES_WITH_SEED_42 = {
-7444071767201028348L,
@@ -79,10 +79,9 @@ public void byteArrChecks() {

/*
* This test is adapted from
* <a href="https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/test/java/net\
* /openhft/hashing/XxHashCollisionTest.java">
* <a href="https://github.com/OpenHFT/Zero-Allocation-Hashing/blob/master/src/test/java/net/openhft/hashing/XxHashCollisionTest.java">
* OpenHFT/Zero-Allocation-Hashing</a> to test hash compatibility with that implementation.
* It is licensed under Apache License, version 2.0.
* It is licensed under Apache License, version 2.0. See LICENSE.
*/
@Test
public void collisionTest() {

0 comments on commit 710c529

Please sign in to comment.