Skip to content

Commit

Permalink
IGNITE-23434 (minor) Strict string length.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtern committed Nov 22, 2024
1 parent 7be26c7 commit 5c84721
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.ignite.internal.systemview.api.SystemViews;
import org.apache.ignite.internal.tx.Lock;
import org.apache.ignite.internal.tx.LockKey;
import org.apache.ignite.internal.type.NativeType;
import org.apache.ignite.internal.util.SubscriptionUtils;

/**
Expand All @@ -39,14 +38,12 @@ public LocksViewProvider(Iterable<Lock> locks) {

/** Returns system view exposing active locks. */
public SystemView<?> get() {
NativeType stringType = stringOf(Short.MAX_VALUE);

return SystemViews.<Lock>nodeViewBuilder()
.name("LOCKS")
.nodeNameColumnAlias("OWNING_NODE_ID")
.<String>addColumn("TX_ID", stringType, lock -> lock.txId().toString())
.<String>addColumn("OBJECT_ID", stringType, lock -> formatLockKey(lock.lockKey()))
.<String>addColumn("MODE", stringType, lock -> lock.lockMode().name())
.<String>addColumn("TX_ID", stringOf(36), lock -> lock.txId().toString())
.<String>addColumn("OBJECT_ID", stringOf(Short.MAX_VALUE), lock -> formatLockKey(lock.lockKey()))
.<String>addColumn("MODE", stringOf(2), lock -> lock.lockMode().name())
.dataProvider(SubscriptionUtils.fromIterable(locks))
.build();
}
Expand Down

0 comments on commit 5c84721

Please sign in to comment.