ibessonov commented on code in PR #937:
URL: https://github.com/apache/ignite-3/pull/937#discussion_r920845906
##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbMvPartitionStorage.java:
##########
@@ -95,30 +98,73 @@ public class RocksDbMvPartitionStorage implements
MvPartitionStorage {
/** Partitions column family. */
private final ColumnFamilyHandle cf;
+ /** Meta column family. */
+ private final ColumnFamilyHandle meta;
+
/** Write options. */
private final WriteOptions writeOpts = new WriteOptions();
/** Upper bound for scans and reads. */
private final Slice upperBound;
+ /** Key to store applied index value in meta. */
+ private byte[] appliedIndexKey;
+
/**
* Constructor.
*
* @param partitionId Partition id.
* @param db RocksDB instance.
* @param cf Column family handle to store partition data.
+ * @param meta Column family handle to store partition metadata.
*/
- public RocksDbMvPartitionStorage(int partitionId, RocksDB db,
ColumnFamilyHandle cf) {
+ public RocksDbMvPartitionStorage(int partitionId, RocksDB db,
ColumnFamilyHandle cf, ColumnFamilyHandle meta) {
this.partitionId = partitionId;
this.db = db;
this.cf = cf;
+ this.meta = meta;
heapKeyBuffer = withInitial(() ->
ByteBuffer.allocate(MAX_KEY_SIZE)
.order(BIG_ENDIAN)
);
upperBound = new Slice(partitionEndPrefix());
+
+ appliedIndexKey = ("index" +
partitionId).getBytes(StandardCharsets.UTF_8);
+ }
+
+ @Override
+ public long appliedIndex() {
+ byte[] appliedIndexBytes;
+
+ try {
+
+ appliedIndexBytes = db.get(meta, appliedIndexKey);
+
Review Comment:
Again, I don't see what's changed. Can you please add a comment? Was there
an extra space or something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]