com.nvidia.spark.rapids.format.BufferMeta Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rapids-4-spark_2.12 Show documentation
Show all versions of rapids-4-spark_2.12 Show documentation
Creates the distribution package of the RAPIDS plugin for Apache Spark
// automatically generated by the FlatBuffers compiler, do not modify
package com.nvidia.spark.rapids.format;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class BufferMeta extends Table {
public static BufferMeta getRootAsBufferMeta(ByteBuffer _bb) { return getRootAsBufferMeta(_bb, new BufferMeta()); }
public static BufferMeta getRootAsBufferMeta(ByteBuffer _bb, BufferMeta obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public BufferMeta __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
/**
* ID of this buffer
*/
public int id() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
public boolean mutateId(int id) { int o = __offset(4); if (o != 0) { bb.putInt(o + bb_pos, id); return true; } else { return false; } }
/**
* size of the buffer data in bytes
*/
public long size() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
public boolean mutateSize(long size) { int o = __offset(6); if (o != 0) { bb.putLong(o + bb_pos, size); return true; } else { return false; } }
/**
* size of the uncompressed buffer data
*/
public long uncompressedSize() { int o = __offset(8); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
public boolean mutateUncompressedSize(long uncompressed_size) { int o = __offset(8); if (o != 0) { bb.putLong(o + bb_pos, uncompressed_size); return true; } else { return false; } }
/**
* array of codec buffer descriptors if the data is compressed
*/
public CodecBufferDescriptor codecBufferDescrs(int j) { return codecBufferDescrs(new CodecBufferDescriptor(), j); }
public CodecBufferDescriptor codecBufferDescrs(CodecBufferDescriptor obj, int j) { int o = __offset(10); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
public int codecBufferDescrsLength() { int o = __offset(10); return o != 0 ? __vector_len(o) : 0; }
public static int createBufferMeta(FlatBufferBuilder builder,
int id,
long size,
long uncompressed_size,
int codec_buffer_descrsOffset) {
builder.startObject(4);
BufferMeta.addUncompressedSize(builder, uncompressed_size);
BufferMeta.addSize(builder, size);
BufferMeta.addCodecBufferDescrs(builder, codec_buffer_descrsOffset);
BufferMeta.addId(builder, id);
return BufferMeta.endBufferMeta(builder);
}
public static void startBufferMeta(FlatBufferBuilder builder) { builder.startObject(4); }
public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(0, id, 0); }
public static void addSize(FlatBufferBuilder builder, long size) { builder.addLong(1, size, 0L); }
public static void addUncompressedSize(FlatBufferBuilder builder, long uncompressedSize) { builder.addLong(2, uncompressedSize, 0L); }
public static void addCodecBufferDescrs(FlatBufferBuilder builder, int codecBufferDescrsOffset) { builder.addOffset(3, codecBufferDescrsOffset, 0); }
public static int createCodecBufferDescrsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
public static void startCodecBufferDescrsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
public static int endBufferMeta(FlatBufferBuilder builder) {
int o = builder.endObject();
return o;
}
}