All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nvidia.spark.rapids.format.BufferMeta Maven / Gradle / Ivy

There is a newer version: 24.08.1
Show newest version
// 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 uncompressed buffer data in bytes
   */
  public long actualSize() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
  public boolean mutateActualSize(long actual_size) { int o = __offset(6); if (o != 0) { bb.putLong(o + bb_pos, actual_size); return true; } else { return false; } }
  /**
   * size of the compressed buffer data if a codec is used
   */
  public long compressedSize() { int o = __offset(8); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
  public boolean mutateCompressedSize(long compressed_size) { int o = __offset(8); if (o != 0) { bb.putLong(o + bb_pos, compressed_size); return true; } else { return false; } }
  /**
   * type of compression codec used
   */
  public byte codec() { int o = __offset(10); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public boolean mutateCodec(byte codec) { int o = __offset(10); if (o != 0) { bb.put(o + bb_pos, codec); return true; } else { return false; } }

  public static int createBufferMeta(FlatBufferBuilder builder,
      int id,
      long actual_size,
      long compressed_size,
      byte codec) {
    builder.startObject(4);
    BufferMeta.addCompressedSize(builder, compressed_size);
    BufferMeta.addActualSize(builder, actual_size);
    BufferMeta.addId(builder, id);
    BufferMeta.addCodec(builder, codec);
    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 addActualSize(FlatBufferBuilder builder, long actualSize) { builder.addLong(1, actualSize, 0L); }
  public static void addCompressedSize(FlatBufferBuilder builder, long compressedSize) { builder.addLong(2, compressedSize, 0L); }
  public static void addCodec(FlatBufferBuilder builder, byte codec) { builder.addByte(3, codec, 0); }
  public static int endBufferMeta(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy