public final class HostColumnVector extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
HostColumnVector.Builder
Build
|
protected static class |
HostColumnVector.OffHeapState
Holds the off heap state of the column vector so we can clean it up, even if it is leaked.
|
| Modifier and Type | Method and Description |
|---|---|
static HostColumnVector |
boolFromBytes(byte... values)
Create a new vector from the given values.
|
static HostColumnVector |
build(DType type,
int rows,
java.util.function.Consumer<HostColumnVector.Builder> init)
Create a new vector.
|
static HostColumnVector |
build(int rows,
long stringBufferSize,
java.util.function.Consumer<HostColumnVector.Builder> init) |
static HostColumnVector.Builder |
builder(DType type,
int rows)
Create a new Builder to hold the specified number of rows.
|
static HostColumnVector.Builder |
builder(int rows,
long stringBufferSize)
Create a new Builder to hold the specified number of rows and with enough space to hold the
given amount of string data.
|
void |
close()
Close this Vector and free memory allocated for HostMemoryBuffer and DeviceMemoryBuffer
|
ColumnVector |
copyToDevice()
Copy the data to the device.
|
static HostColumnVector |
daysFromInts(int... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedBooleans(Boolean... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedBytes(Byte... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedDoubles(Double... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedFloats(Float... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedInts(Integer... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBoxedShorts(Short... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromBytes(byte... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromDoubles(double... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromFloats(float... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromInts(int... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromLongs(long... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromShorts(short... values)
Create a new vector from the given values.
|
static HostColumnVector |
fromStrings(String... values)
Create a new string vector from the given values.
|
boolean |
getBoolean(long index)
Get the boolean value at index
|
byte |
getByte(long index)
Get the value at index.
|
double |
getDouble(long index)
Get the value at index.
|
float |
getFloat(long index)
Get the value at index.
|
HostMemoryBuffer |
getHostBufferFor(BufferType type)
Get access to the raw host buffer for this column.
|
long |
getHostMemorySize()
Returns the amount of host memory used to store column/validity data (not metadata).
|
int |
getInt(long index)
Get the value at index.
|
String |
getJavaString(long index)
Get the value at index.
|
long |
getLong(long index)
Get the value at index.
|
long |
getNullCount()
Returns the number of nulls in the data.
|
long |
getRowCount()
Returns the number of rows in this vector.
|
short |
getShort(long index)
Get the value at index.
|
DType |
getType()
Returns the type of this vector.
|
byte[] |
getUTF8(long index)
Get the raw UTF8 bytes at index.
|
boolean |
hasNulls()
Returns if the vector has nulls.
|
boolean |
hasValidityVector()
Returns if the vector has a validity vector allocated or not.
|
HostColumnVector |
incRefCount()
Increment the reference count for this column.
|
boolean |
isNull(long index)
Check if the value at index is null or not.
|
void |
noWarnLeakExpected()
This is a really ugly API, but it is possible that the lifecycle of a column of
data may not have a clear lifecycle thanks to java and GC.
|
static HostColumnVector |
timestampDaysFromBoxedInts(Integer... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampMicroSecondsFromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampMicroSecondsFromLongs(long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampMilliSecondsFromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampMilliSecondsFromLongs(long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampNanoSecondsFromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampNanoSecondsFromLongs(long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampSecondsFromBoxedLongs(Long... values)
Create a new vector from the given values.
|
static HostColumnVector |
timestampSecondsFromLongs(long... values)
Create a new vector from the given values.
|
String |
toString() |
public void noWarnLeakExpected()
public void close()
close in interface AutoCloseablepublic HostColumnVector incRefCount()
public long getRowCount()
public long getHostMemorySize()
public DType getType()
public long getNullCount()
public boolean hasValidityVector()
public boolean hasNulls()
public ColumnVector copyToDevice()
public boolean isNull(long index)
public HostMemoryBuffer getHostBufferFor(BufferType type)
type - the type of buffer to get access to.public byte getByte(long index)
public final short getShort(long index)
public final int getInt(long index)
public final long getLong(long index)
public final float getFloat(long index)
public final double getDouble(long index)
public final boolean getBoolean(long index)
public byte[] getUTF8(long index)
public String getJavaString(long index)
public static HostColumnVector.Builder builder(DType type, int rows)
#build(int, Consumer) instead to avoid needing to
close the builder.type - the type of vector to build.rows - the number of rows this builder can holdpublic static HostColumnVector.Builder builder(int rows, long stringBufferSize)
#build(int, int, Consumer) instead to avoid needing to close the builder.rows - the number of rows this builder can holdstringBufferSize - the size of the string buffer to allocate.public static HostColumnVector build(DType type, int rows, java.util.function.Consumer<HostColumnVector.Builder> init)
type - the type of vector to build.rows - maximum number of rows that the vector can hold.init - what will initialize the vector.public static HostColumnVector build(int rows, long stringBufferSize, java.util.function.Consumer<HostColumnVector.Builder> init)
public static HostColumnVector boolFromBytes(byte... values)
public static HostColumnVector fromBytes(byte... values)
public static HostColumnVector fromShorts(short... values)
public static HostColumnVector fromInts(int... values)
public static HostColumnVector fromLongs(long... values)
public static HostColumnVector fromFloats(float... values)
public static HostColumnVector fromDoubles(double... values)
public static HostColumnVector daysFromInts(int... values)
public static HostColumnVector timestampSecondsFromLongs(long... values)
public static HostColumnVector timestampMilliSecondsFromLongs(long... values)
public static HostColumnVector timestampMicroSecondsFromLongs(long... values)
public static HostColumnVector timestampNanoSecondsFromLongs(long... values)
public static HostColumnVector fromStrings(String... values)
public static HostColumnVector fromBoxedBooleans(Boolean... values)
public static HostColumnVector fromBoxedBytes(Byte... values)
public static HostColumnVector fromBoxedShorts(Short... values)
public static HostColumnVector fromBoxedInts(Integer... values)
public static HostColumnVector fromBoxedLongs(Long... values)
public static HostColumnVector fromBoxedFloats(Float... values)
public static HostColumnVector fromBoxedDoubles(Double... values)
public static HostColumnVector timestampDaysFromBoxedInts(Integer... values)
public static HostColumnVector timestampSecondsFromBoxedLongs(Long... values)
public static HostColumnVector timestampMilliSecondsFromBoxedLongs(Long... values)
public static HostColumnVector timestampMicroSecondsFromBoxedLongs(Long... values)
public static HostColumnVector timestampNanoSecondsFromBoxedLongs(Long... values)
Copyright © 2020. All rights reserved.