Class ColumnarPartitionStorage

java.lang.Object
org.gridgain.internal.columnar.ColumnarPartitionStorage
All Implemented Interfaces:
AutoCloseable, org.apache.ignite.internal.storage.secondary.SecondaryStorage

public class ColumnarPartitionStorage extends Object implements org.apache.ignite.internal.storage.secondary.SecondaryStorage
Columnar storage table.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addColumn(String columnName, org.apache.ignite.internal.type.NativeType type, boolean nullable)
    Adds column to a table.
    void
     
    void
     
    void
    Performs full compaction of the underlying LSM-tree in the partition storage.
    void
    dropColumn(String columnName)
    Drops a column from table.
    long
     
    long
     
    org.apache.ignite.internal.storage.secondary.TimestampAndRowId
     
    long
     
    @Nullable UUID
     
    @Nullable String
     
    byte @Nullable []
     
    void
    modifyColumnType(String columnName, org.apache.ignite.internal.type.NativeType type, boolean nullable)
    Modifies column type.
    int
     
    query(org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
    Queries all inserted data to the native storage and returns it as a cursor.
    @Nullable ByteBuffer
    read(ByteBuffer key, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
    Reads a row for a given key.
    @Nullable org.apache.ignite.internal.schema.BinaryRow
    read(org.apache.ignite.internal.schema.BinaryRow key, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
     
    boolean
    remove(ByteBuffer bin, org.apache.ignite.internal.storage.RowId rowId, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
    Removes a row associated with a given key.
    org.apache.ignite.internal.util.Cursor<org.apache.ignite.internal.schema.BinaryRow>
    scan(org.apache.ignite.internal.hlc.HybridTimestamp timestamp, @Nullable BitSet columnsToInclude)
    Scans the partition and returns a cursor of rows at the given timestamp.
    org.apache.ignite.internal.util.Cursor<org.apache.ignite.internal.schema.BinaryRow>
    scanWithOperation(org.apache.ignite.internal.hlc.HybridTimestamp timestamp, org.apache.ignite.internal.storage.operation.StorageOptimizedOperation operation)
     
    int
    Returns table id.
    void
    updateLease(long leaseStartTime, UUID primaryReplicaNodeId, String primaryReplicaNodeName)
     
    void
    updateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm)
     
    void
    updateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm, byte[] config)
     
    void
    upsert(ByteBuffer bin, org.apache.ignite.internal.storage.RowId rowId, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
    Upsert single tuple to native storage.
    void
    writeBatch(List<org.apache.ignite.internal.storage.secondary.BinaryRowAndRowId> rows, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
     
    void
    writeBatch(List<org.apache.ignite.internal.storage.TimedBinaryRowAndRowId> rows)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.ignite.internal.storage.secondary.SecondaryStorage

    scan
  • Method Details

    • tableId

      public int tableId()
      Returns table id.
      Specified by:
      tableId in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • partitionId

      public int partitionId()
      Specified by:
      partitionId in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • destroy

      public void destroy() throws org.apache.ignite.internal.storage.StorageException
      Specified by:
      destroy in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
      Throws:
      org.apache.ignite.internal.storage.StorageException
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • upsert

      public void upsert(ByteBuffer bin, org.apache.ignite.internal.storage.RowId rowId, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
      Upsert single tuple to native storage.
      Parameters:
      bin - Single tuple in binary tuple format.
      rowId - RowId of the row.
      timestamp - Timestamp.
    • remove

      public boolean remove(ByteBuffer bin, org.apache.ignite.internal.storage.RowId rowId, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
      Removes a row associated with a given key.
      Parameters:
      bin - Single key in binary tuple format.
      rowId - RowId of the row.
      timestamp - Timestamp.
      Returns:
      true in case element was removed, false in case there were no such element.
    • getLastPersistedRow

      public org.apache.ignite.internal.storage.secondary.TimestampAndRowId getLastPersistedRow()
      Specified by:
      getLastPersistedRow in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • doFullCompaction

      public void doFullCompaction()
      Performs full compaction of the underlying LSM-tree in the partition storage.
    • query

      public NativeCursor query(org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
      Queries all inserted data to the native storage and returns it as a cursor.
      Returns:
      An instance of NativeCursor. The cursor must be closed after the initiator stopped processing data.
    • addColumn

      public void addColumn(String columnName, org.apache.ignite.internal.type.NativeType type, boolean nullable)
      Adds column to a table.
      Parameters:
      columnName - New column name, should be unique.
      type - Data type for new column.
      nullable - Nullable flag.
    • dropColumn

      public void dropColumn(String columnName)
      Drops a column from table.
      Parameters:
      columnName - Name of the column to drop.
    • modifyColumnType

      public void modifyColumnType(String columnName, org.apache.ignite.internal.type.NativeType type, boolean nullable)
      Modifies column type.
      Parameters:
      columnName - Name of the modified column, should be unique.
      type - New data type for column.
      nullable - Nullable flag.
    • writeBatch

      public void writeBatch(List<org.apache.ignite.internal.storage.secondary.BinaryRowAndRowId> rows, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
      Specified by:
      writeBatch in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • writeBatch

      public void writeBatch(List<org.apache.ignite.internal.storage.TimedBinaryRowAndRowId> rows)
      Specified by:
      writeBatch in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • read

      @Nullable public @Nullable ByteBuffer read(ByteBuffer key, org.apache.ignite.internal.hlc.HybridTimestamp timestamp)
      Reads a row for a given key.
      Parameters:
      key - Key of row to search for in binary tuple format.
      timestamp - Timestamp.
      Returns:
      Row in binary tuple representation or null if no data has been found for given key.
    • read

      @Nullable public @Nullable org.apache.ignite.internal.schema.BinaryRow read(org.apache.ignite.internal.schema.BinaryRow key, org.apache.ignite.internal.hlc.HybridTimestamp timestamp) throws org.apache.ignite.internal.storage.StorageException
      Specified by:
      read in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
      Throws:
      org.apache.ignite.internal.storage.StorageException
    • scan

      public org.apache.ignite.internal.util.Cursor<org.apache.ignite.internal.schema.BinaryRow> scan(org.apache.ignite.internal.hlc.HybridTimestamp timestamp, @Nullable @Nullable BitSet columnsToInclude) throws org.apache.ignite.internal.storage.StorageException
      Scans the partition and returns a cursor of rows at the given timestamp.
      Specified by:
      scan in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
      Parameters:
      timestamp - Timestamp.
      columnsToInclude - Columns to include.
      Returns:
      Cursor.
      Throws:
      org.apache.ignite.internal.storage.StorageException - If failed to read data from the storage.
    • scanWithOperation

      public org.apache.ignite.internal.util.Cursor<org.apache.ignite.internal.schema.BinaryRow> scanWithOperation(org.apache.ignite.internal.hlc.HybridTimestamp timestamp, org.apache.ignite.internal.storage.operation.StorageOptimizedOperation operation) throws org.apache.ignite.internal.storage.StorageException
      Specified by:
      scanWithOperation in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
      Throws:
      org.apache.ignite.internal.storage.StorageException
    • updateRaftConfiguration

      public void updateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm)
      Specified by:
      updateRaftConfiguration in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • updateRaftConfiguration

      public void updateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm, byte[] config)
      Specified by:
      updateRaftConfiguration in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • getRaftNodeConfiguration

      public byte @Nullable [] getRaftNodeConfiguration()
      Specified by:
      getRaftNodeConfiguration in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • getLastAppliedIndex

      public long getLastAppliedIndex()
      Specified by:
      getLastAppliedIndex in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • getLastAppliedTerm

      public long getLastAppliedTerm()
      Specified by:
      getLastAppliedTerm in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • updateLease

      public void updateLease(long leaseStartTime, UUID primaryReplicaNodeId, String primaryReplicaNodeName)
      Specified by:
      updateLease in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • getLeaseStartTime

      public long getLeaseStartTime()
      Specified by:
      getLeaseStartTime in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • getPrimaryReplicaNodeId

      @Nullable public @Nullable UUID getPrimaryReplicaNodeId()
      Specified by:
      getPrimaryReplicaNodeId in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
    • getPrimaryReplicaNodeName

      @Nullable public @Nullable String getPrimaryReplicaNodeName()
      Specified by:
      getPrimaryReplicaNodeName in interface org.apache.ignite.internal.storage.secondary.SecondaryStorage