DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| ID | IEP-126 | ||||||||
| Author | |||||||||
| Sponsor | |||||||||
| Created | 10.09.2024 | ||||||||
| Status |
|
| Table of Contents |
|---|
When processing data, the user wants to have access to client attributes - an associative array specified on the client application side. Usage scenarios:
...
A similar context mechanism exists in Oracle [1].
Code running on the Ignite node has access to client attributes through a static method call:
...
SessionContext can be further extended to retrieve other non-tabular information, such as SecuritySubject, Transaction, ServiceCallContext, etc.
The standard jdbc protocol describes the methods Connection#setClientInfo, which allow changing the values of client attributes during the life of the connection [3]. Implementation features:
...
| Code Block | ||
|---|---|---|
| ||
// JDBC connection to Ignite server.
try (Connection conn = DriverManager.getConnection(URL)) {
conn.setClientInfo("SESSION_ID", "1234");
...
}
|
Implementation features:
ClientAttributes setting to the current thread. In case of using listeners, it is necessary to reinstall the context in a new thread.withClientAttributes call are sent along with each outgoing TcpClientChannel#send message in the BinaryOutputStream (a new feature is needed in the ClientBitmaskFeature protocol)....
| Code Block | ||
|---|---|---|
| ||
try (IgniteClient cln = Ignition.startClient(clnCfg)) {
try (ClientAttributes clnAttrs = cln.withClientAttributes()) {
clnAttrs.setAttribute("SESSION_ID", "1234");
...
}
}
|
The Ignite server node, when receiving client messages, sets ClientAttributes in the ThreadLocal variable, and also handles context transfer to the calls it spawns (in threads and on remote nodes). The same can be done for operations called directly from Ignite:
| Code Block | ||
|---|---|---|
| ||
try (Ignite ign = Ignition.localIgnite()) {
try (ClientAttributes clnAttrs = ign.withClientAttributes()) {
clnAttrs.setAttribute("SESSION_ID", "1234");
...
}
} |
QueryStartRequest SQL message protocol.CacheInterceptor), since inserts are not always performed on the request initiator node.GridNearAtomicAbstractUpdateRequest messages about key changes must contain the ClientAttributes id.CacheInterceptor#onGet is not called in SQL)ClientAttributes on the client)// Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.
// Links to discussions on the devlist, if applicable.
// Links to various reference documents, if applicable.
// Links or report with relevant JIRA tickets.