Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Setting application attributes

...

Ignite 

  1. Users set attributes with ClientCache#withApplicationAttributes  and must clean it by self. IgniteCache#withApplicationAttributes.
  2. Application attributes are propagated with all messages sent within operation on remote nodes (similar to GridIoSecurityAwareMessage)
  3. Application attributes set to ThreadLocal<Map<String, String>>  in each thread that process operation (similar to SecurityContext#withSecurityContext() )New feature is needed in the ClientBitmaskFeature protocol.


Code Block
languagejava
// Example of usage.
try (IgniteClientIgnite clnign = Ignition.startClientstart(clnCfgignCfg)) {
    Map<String, String> appAttrs = F.asMap("SESSION_ID", "1234");

	ClientCache<IgniteCache<?, ?> cache = clnign.cache("CACHE").withApplicationAttributes(appAttrs);	

 	...
}

...

IgniteClient (Java)

...

 

  1. Users set attributes with ClientCache#withApplicationAttributes  and must clean it by self.
  2. New feature is needed in the ClientBitmaskFeature protocol.

...

Code Block
languagejava
// Example of usage.
try (IgniteClient cln = Ignition.startClient(clnCfg)) {
    Map<String, String> appAttrs = F.asMap("SESSION_ID", "1234");

	ClientCache<?, ?> cache = cln.cache("CACHE").withApplicationAttributes(appAttrs);	

 	...
}

JDBC

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
languagejava
// JDBC connection to Ignite server.
try (Connection conn = DriverManager.getConnection(URL)) {
    conn.setClientInfo("SESSION_ID", "1234");
 
    ...
}

Spreading context across cluster nodes

  1. Via the QueryStartRequest SQL message protocol (for jdbc, SQL transactions)
  2. Via the transaction protocol for handling inserts (CacheInterceptor), since inserts are not always performed on the request initiator node.

Risks and Assumptions

// Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.

Risks and Assumptions

  1. No security checks are performed on the application attributes.
  2. Application attributes keys and values are strings, to avoid serialization problems.
  3. Application attributes should be small. It doesn't work for non-transactional ignite-node SQL but work for JDBC.

Discussion Links

// Links to discussions on the devlist, if applicable.

...