Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ cpp/doxygen/xml
#Java
target

# Local Maven repo created by java/ci/build-in-docker.sh
.m2

# Recreated on every Maven `validate` phase by gmaven-plugin:1.5
java/bin/

# Translations
*.mo
*.pot
Expand Down
25 changes: 20 additions & 5 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,8 @@
<filtering>true</filtering>
</resource>
<resource>
<directory>${basedir}/..</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>LICENSE</include>
</includes>
<!-- Populated by the copy-license execution of maven-resources-plugin. -->
<directory>${project.build.directory}/license-resources</directory>
</resource>
</resources>
<pluginManagement>
Expand Down Expand Up @@ -590,6 +587,24 @@
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-license</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/license-resources/META-INF</outputDirectory>
<resources>
<resource>
<directory>${basedir}/..</directory>
<includes>
<include>LICENSE</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-native-libs</id>
<phase>generate-resources</phase>
Expand Down
69 changes: 69 additions & 0 deletions java/src/main/java/ai/rapids/cudf/ByteRange.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

package ai.rapids.cudf;

import java.util.Objects;

/**
* Immutable byte range describing an offset and size within a file or buffer.
*
* <p>Mirrors {@code cudf::io::text::byte_range_info}.
*
* <p>The APIs in this file are experimental and subject to change.
*/
@Experimental

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be experimental since the cudf::io::test::byte_range_info isn't experimental

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ByteRange is annotated as experimental, since it is only used by HybridScanReader, which is experimental. We can remove the experimental annotation later, if any non-experimental class requires this class.

public final class ByteRange {
private final long offset;
private final long size;

/**
* @param offset starting offset, in bytes, from the beginning of the source
* @param size length of the range, in bytes
*/
public ByteRange(long offset, long size) {
if (offset < 0) {
throw new IllegalArgumentException("offset must be >= 0, got " + offset);
}
if (size < 0) {
throw new IllegalArgumentException("size must be >= 0, got " + size);
}
this.offset = offset;
this.size = size;
}

/** @return starting byte offset within the source. */
public long offset() {
return offset;
}

/** @return length of the byte range, in bytes. */
public long size() {
return size;
}

/** @return {@code true} when the range has zero size. */
public boolean isEmpty() {
return size == 0;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ByteRange)) return false;
ByteRange other = (ByteRange) o;
return offset == other.offset && size == other.size;
}

@Override
public int hashCode() {
return Objects.hash(offset, size);
}

@Override
public String toString() {
return "ByteRange{offset=" + offset + ", size=" + size + "}";
}
}
26 changes: 26 additions & 0 deletions java/src/main/java/ai/rapids/cudf/Experimental.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

package ai.rapids.cudf;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marks a public type whose API is still considered experimental and may change
* without notice. Code annotated with {@code @Experimental} is not subject to
* cuDF Java compatibility guarantees.
*
* <p>Public nested types of an annotated type inherit the experimental status by
* association and do not need a separate marker.
*/
@Documented
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.TYPE)
public @interface Experimental {
Comment thread
paul-aiyedun marked this conversation as resolved.
}
Loading
Loading