Package org.gridgain.internal.columnar
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 TypeMethodDescriptionvoidAdds column to a table.voidclose()voiddestroy()voidPerforms full compaction of the underlying LSM-tree in the partition storage.voiddropColumn(String columnName) Drops a column from table.longlongorg.apache.ignite.internal.storage.secondary.TimestampAndRowIdlong@Nullable UUID@Nullable Stringbyte @Nullable []voidmodifyColumnType(String columnName, org.apache.ignite.internal.type.NativeType type, boolean nullable) Modifies column type.intquery(org.apache.ignite.internal.hlc.HybridTimestamp timestamp) Queries all inserted data to the native storage and returns it as a cursor.@Nullable ByteBufferread(ByteBuffer key, org.apache.ignite.internal.hlc.HybridTimestamp timestamp) Reads a row for a given key.@Nullable org.apache.ignite.internal.schema.BinaryRowread(org.apache.ignite.internal.schema.BinaryRow key, org.apache.ignite.internal.hlc.HybridTimestamp timestamp) booleanremove(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>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) inttableId()Returns table id.voidupdateLease(long leaseStartTime, UUID primaryReplicaNodeId, String primaryReplicaNodeName) voidupdateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm) voidupdateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm, byte[] config) voidupsert(ByteBuffer bin, org.apache.ignite.internal.storage.RowId rowId, org.apache.ignite.internal.hlc.HybridTimestamp timestamp) Upsert single tuple to native storage.voidwriteBatch(List<org.apache.ignite.internal.storage.secondary.BinaryRowAndRowId> rows, org.apache.ignite.internal.hlc.HybridTimestamp timestamp) voidwriteBatch(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, waitMethods inherited from interface org.apache.ignite.internal.storage.secondary.SecondaryStorage
scan
-
Method Details
-
tableId
public int tableId()Returns table id.- Specified by:
tableIdin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
partitionId
public int partitionId()- Specified by:
partitionIdin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
destroy
public void destroy() throws org.apache.ignite.internal.storage.StorageException- Specified by:
destroyin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage- Throws:
org.apache.ignite.internal.storage.StorageException
-
close
- Specified by:
closein interfaceAutoCloseable- 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:
getLastPersistedRowin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
doFullCompaction
public void doFullCompaction()Performs full compaction of the underlying LSM-tree in the partition storage. -
query
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
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:
writeBatchin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
writeBatch
- Specified by:
writeBatchin interfaceorg.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
nullif 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:
readin interfaceorg.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:
scanin interfaceorg.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:
scanWithOperationin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage- Throws:
org.apache.ignite.internal.storage.StorageException
-
updateRaftConfiguration
public void updateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm) - Specified by:
updateRaftConfigurationin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
updateRaftConfiguration
public void updateRaftConfiguration(long lastAppliedIndex, long lastAppliedTerm, byte[] config) - Specified by:
updateRaftConfigurationin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
getRaftNodeConfiguration
public byte @Nullable [] getRaftNodeConfiguration()- Specified by:
getRaftNodeConfigurationin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
getLastAppliedIndex
public long getLastAppliedIndex()- Specified by:
getLastAppliedIndexin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
getLastAppliedTerm
public long getLastAppliedTerm()- Specified by:
getLastAppliedTermin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
updateLease
public void updateLease(long leaseStartTime, UUID primaryReplicaNodeId, String primaryReplicaNodeName) - Specified by:
updateLeasein interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
getLeaseStartTime
public long getLeaseStartTime()- Specified by:
getLeaseStartTimein interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
getPrimaryReplicaNodeId
- Specified by:
getPrimaryReplicaNodeIdin interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-
getPrimaryReplicaNodeName
- Specified by:
getPrimaryReplicaNodeNamein interfaceorg.apache.ignite.internal.storage.secondary.SecondaryStorage
-