Refactor KeyEffectiveStatementImpl 43/86843/10
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 9 Jan 2020 17:04:07 +0000 (18:04 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 13 Jan 2020 12:17:28 +0000 (13:17 +0100)
commit11d4ce226da8231118f5480ef5884b8e079ff437
tree2a7bb7f98c1ef32106364d09495ec5d16869edb0
parent312068b3e5eca1b3c336fa029a5a81c7b6a031c0
Refactor KeyEffectiveStatementImpl

KeyEffectiveStatementImpl costs 32 bytes each instance in common
Linux deployment. This turns out to be unnecessary, as be can easily
drop the size to 16/24 bytes, based on whether the key is referenced
in the same module as it is defined.

The method we do this by is to provide 4 distinct implementations,
based on 2x2 matrix of locality w.r.t declared statement (same module
means we can can reuse declared argument) and number of substatements
-- "key" with a substatement is exceedingly unlikely, hence we can
usually not store substatements.

JIRA: YANGTOOLS-1065
Change-Id: Id1235131a8568236870521cb988e730a233ea96c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/AbstractKeyEffectiveStatement.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/EmptyForeignKeyEffectiveStatement.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/EmptyLocalKeyEffectiveStatement.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/KeyEffectiveStatementImpl.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/KeyStatementSupport.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/RegularForeignKeyEffectiveStatement.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/key/RegularLocalKeyEffectiveStatement.java [new file with mode: 0644]