public enum FederatedMode extends Enum<FederatedMode>
Consistency, for federated tables, consists in avoiding having duplicated
rows within two different tables. This can happen depending whether result
for the postfix computation (as given by
PersistingElementOverFederatedTable.getTablePostfix()) keep constant
with time, that is it always returns the same value for a given persisting
element.
Three solutions are proposed to check for consistency:
IllegalStateException when postfix computation
changes over time (computation consistency)
PersistingElementOverFederatedTable.getTablePostfix() on read
operations
PersistingElementOverFederatedTable.getTablePostfix() on write
operations
Full consistency, be it for read or write, consists in checking existence of
the element's identifier in alternative tables. All alternative tables are
queried for the existence of the identifier (using
Store.exists(com.googlecode.n_orm.storeapi.MetaInformation, String, String)).
Tables are queried in sequence in probability order:
Achieving full consistency obviously requires a multiple queries on the data store just for sake of checks. To reduce number of checks, it is possible to restrict consistency checks to the original table, i.e. ignore tables of points 3 and 4. This mode is called "consistency with legacy" as it keeps the table federation consistent when a persisting class is changed from not federated to federated.
Enumerated values are named using the following general pattern:
PersistingElement.activate(String...) or
PersistingElement.existsInStore())
PersistingElement.store())
PersistingElement.delete() uses the most consistent mode between read
and write consistency.FederatedTableManagement for more
implementation details| Enum Constant and Description |
|---|
CONS
Find from the datastore actual table for elements prior to any read or
write operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
INCONS
Table for elements is postfixed by result of
PersistingElementOverFederatedTable.getTablePostfix(). |
LEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read or write operation. |
NONE
A single table (the original table) is to be used for storing elements.
|
PC_CONS
Find from the datastore actual table for elements prior to any read or
write operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
PC_INCONS
Table for elements is postfixed by result of
PersistingElementOverFederatedTable.getTablePostfix(). |
PC_LEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any write operation. |
PC_RCONS
Find from the datastore actual table for elements prior to any read
operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
PC_RCONS_WLEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. |
PC_RLEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. |
PC_RLEG_WCONS
Find from the datastore actual table for elements prior to any write
operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
PC_WCONS
Find from the datastore actual table for elements prior to any write
operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
PC_WLEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any write operation. |
RCONS
Find from the datastore actual table for elements prior to any read
operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
RCONS_WLEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. |
RLEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. |
RLEG_WCONS
Find from the datastore actual table for elements prior to any write
operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
WCONS
Find from the datastore actual table for elements prior to any write
operation before calling
PersistingElementOverFederatedTable.getTablePostfix(). |
WLEG
Finds from the datastore whether table for this element is the original
table or table postfixed with
PersistingElementOverFederatedTable.getTablePostfix() prior to
any write operation. |
| Modifier and Type | Method and Description |
|---|---|
Consistency |
getConsistency(ReadWrite mode) |
boolean |
isCheckForChangingPostfix()
Whether elements of this persisting class should be checked for coherent
results for
PersistingElementOverFederatedTable.getTablePostfix() |
boolean |
isFederated()
Whether elements of this persisting class might be stored in another able
than that one stated by
PersistingMixin.getTable(Class) |
static FederatedMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FederatedMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FederatedMode NONE
public static final FederatedMode INCONS
PersistingElementOverFederatedTable.getTablePostfix(). This can
be dangerous if the latter result changes over time for a given element
as an element can appear in different tables and only one table will be
used for operations.public static final FederatedMode PC_INCONS
PersistingElementOverFederatedTable.getTablePostfix(). Result for
the latter operation are regularly checked not to change over time.public static final FederatedMode RLEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation.public static final FederatedMode PC_RLEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode RCONS
PersistingElementOverFederatedTable.getTablePostfix().public static final FederatedMode PC_RCONS
PersistingElementOverFederatedTable.getTablePostfix(). Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode WLEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any write operation.public static final FederatedMode PC_WLEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any write operation. Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode LEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read or write operation.public static final FederatedMode PC_LEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any write operation. Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode RCONS_WLEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. Regarding write operation, only table with no postfix
is checked.public static final FederatedMode PC_RCONS_WLEG
PersistingElementOverFederatedTable.getTablePostfix() prior to
any read operation. Regarding write operation, only table with no postfix
is checked. Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode WCONS
PersistingElementOverFederatedTable.getTablePostfix().public static final FederatedMode PC_WCONS
PersistingElementOverFederatedTable.getTablePostfix(). Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode RLEG_WCONS
PersistingElementOverFederatedTable.getTablePostfix(). Regarding
read operation, only table with no postfix is checked.public static final FederatedMode PC_RLEG_WCONS
PersistingElementOverFederatedTable.getTablePostfix(). Regarding
read operation, only table with no postfix is checked. Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static final FederatedMode CONS
PersistingElementOverFederatedTable.getTablePostfix().public static final FederatedMode PC_CONS
PersistingElementOverFederatedTable.getTablePostfix(). Result for
PersistingElementOverFederatedTable.getTablePostfix() is
regularly checked to be consistent in case table is postfixed.public static FederatedMode[] values()
for (FederatedMode c : FederatedMode.values()) System.out.println(c);
public static FederatedMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isFederated()
PersistingMixin.getTable(Class)public boolean isCheckForChangingPostfix()
PersistingElementOverFederatedTable.getTablePostfix()public Consistency getConsistency(ReadWrite mode)
Copyright © 2016. All Rights Reserved.