Skip to content

Commit

Permalink
0002937: Disable and deprecate Grouplets feature in 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichalek committed Dec 8, 2016
1 parent e15063a commit d28853a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
1 change: 0 additions & 1 deletion symmetric-assemble/src/asciidoc/configuration.ad
Expand Up @@ -36,7 +36,6 @@ include::configuration/file-routing.ad[]
include::configuration/conflicts.ad[]
include::configuration/transforms.ad[]
include::configuration/load-filters.ad[]
include::configuration/grouplets.ad[]
include::configuration/extensions.ad[]
include::configuration/parameters.ad[]

Expand Down
23 changes: 0 additions & 23 deletions symmetric-assemble/src/asciidoc/configuration/grouplets.ad

This file was deleted.

Expand Up @@ -380,6 +380,8 @@ private ParameterConstants() {

public final static String FIREBIRD_EXTRACT_VARCHAR_ROW_OLD_PK_DATA = "firebird.extract.varchar.row.old.pk.data";

public final static String GROUPLET_ENABLE = "grouplet.enable";

public static Map<String, ParameterMetaData> getParameterMetaData() {
return parameterMetaData;
}
Expand Down
Expand Up @@ -61,7 +61,12 @@ public GroupletService(ISymmetricEngine engine) {
createSqlReplacementTokens()));
}

@Override
public boolean refreshFromDatabase() {
if (!engine.getParameterService().is(ParameterConstants.GROUPLET_ENABLE)) {
return false;
}

Date date1 = sqlTemplate.queryForObject(getSql("selectMaxGroupletLastUpdateTime"), Date.class);
Date date2 = sqlTemplate.queryForObject(getSql("selectMaxGroupletLinkLastUpdateTime"), Date.class);
Date date3 = sqlTemplate.queryForObject(getSql("selectMaxTriggerRouterGroupletLastUpdateTime"), Date.class);
Expand All @@ -85,6 +90,10 @@ public void clearCache() {
}

public boolean isSourceEnabled(TriggerRouter triggerRouter) {
if (!engine.getParameterService().is(ParameterConstants.GROUPLET_ENABLE)) {
return true;
}

boolean enabled = true;
Node node = engine.getNodeService().findIdentity();
if (node == null) {
Expand Down Expand Up @@ -114,6 +123,9 @@ public boolean isSourceEnabled(TriggerRouter triggerRouter) {
}

public boolean isTargetEnabled(TriggerRouter triggerRouter, Node node) {
if (!engine.getParameterService().is(ParameterConstants.GROUPLET_ENABLE)) {
return true;
}
Set<Node> nodes = new HashSet<Node>(1);
nodes.add(node);
return getTargetEnabled(triggerRouter, nodes).size() > 0;
Expand Down Expand Up @@ -159,6 +171,10 @@ public Set<Node> getTargetEnabled(TriggerRouter triggerRouter, Set<Node> nodes)
}

public List<Grouplet> getGrouplets(boolean refreshCache) {
if (!engine.getParameterService().is(ParameterConstants.GROUPLET_ENABLE)) {
return new ArrayList<Grouplet>();
}

long maxCacheTime = parameterService
.getLong(ParameterConstants.CACHE_TIMEOUT_GROUPLETS_IN_MS);
List<Grouplet> all = cache;
Expand Down
Expand Up @@ -2003,3 +2003,10 @@ smtp.allow.untrusted.cert=false
# DatabaseOverridable: true
# Tags: other
console.report.as.offline.minutes=1440

# Enables the Grouplet functionality
#
# DatabaseOverridable: true
# Tags: grouplet
# Type: boolean
grouplet.enable=false
6 changes: 3 additions & 3 deletions symmetric-core/src/main/resources/symmetric-schema.xml
Expand Up @@ -212,7 +212,7 @@
</foreign-key>
</table>

<table name="grouplet" description="This tables defines named groups to which nodes can belong to based on their external id. Grouplets are used to designate that synchronization should only affect an explicit subset of nodes in a node group.">
<table name="grouplet" description="Deprecated in 3.9. This tables defines named groups to which nodes can belong to based on their external id. Grouplets are used to designate that synchronization should only affect an explicit subset of nodes in a node group.">
<column name="grouplet_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="Unique identifier for the grouplet." />
<column name="grouplet_link_policy" type="CHAR" size="1" required="true" default="I" description="Specified whether the external ids in the grouplet_link are included in the group or excluded from the grouplet. In the case of excluded, the grouplet starts with all external ids and removes the excluded ones listed. Use 'I' for inclusive and 'E' for exclusive." />
<column name="description" type="VARCHAR" size="255" description="A description of this grouplet."/>
Expand All @@ -221,7 +221,7 @@
<column name="last_update_time" type="TIMESTAMP" required="true" description="Timestamp when a user last updated this entry." />
</table>

<table name="grouplet_link" description="This tables defines nodes belong to a grouplet based on their external.id">
<table name="grouplet_link" description="Deprecated in 3.9. This tables defines nodes belong to a grouplet based on their external.id">
<column name="grouplet_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="Unique identifier for the grouplet." />
<column name="external_id" type="VARCHAR" size="255" required="true" primaryKey="true" description="Provides a means to select the nodes that belong to a grouplet. " />
<column name="create_time" type="TIMESTAMP" required="true" description="Timestamp when this entry was created." />
Expand Down Expand Up @@ -840,7 +840,7 @@
</foreign-key>
</table>

<table name="trigger_router_grouplet" description="This tables defines what grouplets are associated with what trigger routers. The existence of the grouplet for a trigger_router enables nodes associated with the grouplet and at the same time it disables the trigger router for all other nodes.">
<table name="trigger_router_grouplet" description="Deprecated in 3.9. This tables defines what grouplets are associated with what trigger routers. The existence of the grouplet for a trigger_router enables nodes associated with the grouplet and at the same time it disables the trigger router for all other nodes.">
<column name="grouplet_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="Unique identifier for the grouplet." />
<column name="trigger_id" type="VARCHAR" size="128" required="true" primaryKey="true" description="The id of a trigger." />
<column name="router_id" type="VARCHAR" size="50" required="true" primaryKey="true" description="The id of a router." />
Expand Down

0 comments on commit d28853a

Please sign in to comment.