Skip to content

Commit

Permalink
IGNITE-24014 Rename some configuration properties
Browse files Browse the repository at this point in the history
* NodeAttributeConfigurationSchema: attribute -> value
* SystemPropertyConfigurationSchema: propertyValue -> value.
  • Loading branch information
sashapolo committed Jan 5, 2025
1 parent b80f11a commit 4a7dff1
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions examples/config/ignite-config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ignite {
]
}
nodeAttributes.nodeAttributes {
region.attribute = US
storage.attribute = SSD
region.value = US
storage.value = SSD
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ItLogicalTopologyTest extends ClusterPerTestIntegrationTest {
+ " port: {},\n"
+ " nodeFinder.netClusterNodes: [ {} ]\n"
+ " },\n"
+ " nodeAttributes.nodeAttributes: {region.attribute = US, storage.attribute = SSD},\n"
+ " nodeAttributes.nodeAttributes: {region.value = US, storage.value = SSD},\n"
+ " storage.profiles: {lru_rocks.engine = rocksdb, segmented_aipersist.engine = aipersist},\n"
+ " clientConnector.port: {},\n"
+ " rest.port: {},\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.ignite.configuration.annotation.Config;
import org.apache.ignite.configuration.annotation.InjectedName;
import org.apache.ignite.configuration.annotation.PublicName;
import org.apache.ignite.configuration.annotation.Value;

/**
Expand All @@ -36,5 +37,6 @@ public class NodeAttributeConfigurationSchema {

/** Node attribute field. */
@Value(hasDefault = true)
@PublicName("value")
public String attribute = "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.ignite.configuration.ConfigurationModule;
import org.apache.ignite.configuration.annotation.Config;
import org.apache.ignite.configuration.annotation.InjectedName;
import org.apache.ignite.configuration.annotation.PublicName;
import org.apache.ignite.configuration.annotation.Value;
import org.apache.ignite.configuration.validation.CamelCaseKeys;
import org.apache.ignite.internal.configuration.validation.LongNumberSystemPropertyValueValidator;
Expand All @@ -42,5 +43,6 @@ public class SystemPropertyConfigurationSchema {
public String name;

@Value
@PublicName("value")
public String propertyValue;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ void testEmptySystemProperties(@InjectConfiguration SystemDistributedConfigurati

@Test
void testValidSystemPropertiesOnStart(
@InjectConfiguration("mock.properties = {"
+ PROPERTY_NAME + ".propertyValue = \"newValue\"}")
@InjectConfiguration("mock.properties = {" + PROPERTY_NAME + ".value = \"newValue\"}")
SystemDistributedConfiguration systemConfig
) {
var config = noopConfigHolder(systemConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class ItDistributionZonesFiltersTest extends ClusterPerTestIntegrationTes
private static final String TABLE_NAME = "table1";

@Language("HOCON")
private static final String NODE_ATTRIBUTES = "{region.attribute = US, storage.attribute = SSD}";
private static final String NODE_ATTRIBUTES = "{region.value = US, storage.value = SSD}";

private static final String STORAGE_PROFILES = String.format("'%s, %s'", DEFAULT_ROCKSDB_PROFILE_NAME, DEFAULT_AIPERSIST_PROFILE_NAME);

Expand Down Expand Up @@ -115,18 +115,18 @@ void testFilteredDataNodesPropagatedToStable() throws Exception {
String filter = "$[?(@.region == \"US\" && @.storage == \"SSD\")]";

// This node do not pass the filter
@Language("HOCON") String firstNodeAttributes = "{region:{attribute:\"EU\"},storage:{attribute:\"SSD\"}}";
@Language("HOCON") String firstNodeAttributes = "{region.value: EU, storage.value: SSD}";

Ignite node = startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));

node.sql().execute(null, createZoneSql(2, 3, IMMEDIATE_TIMER_VALUE, IMMEDIATE_TIMER_VALUE, filter, STORAGE_PROFILES));

node.sql().execute(null, createTableSql());

MetaStorageManager metaStorageManager = (MetaStorageManager) IgniteTestUtils
MetaStorageManager metaStorageManager = IgniteTestUtils
.getFieldValue(node, IgniteImpl.class, "metaStorageMgr");

TableManager tableManager = (TableManager) IgniteTestUtils.getFieldValue(node, IgniteImpl.class, "distributedTblMgr");
TableManager tableManager = IgniteTestUtils.getFieldValue(node, IgniteImpl.class, "distributedTblMgr");

TableViewInternal table = (TableViewInternal) tableManager.table(TABLE_NAME);

Expand All @@ -140,7 +140,7 @@ void testFilteredDataNodesPropagatedToStable() throws Exception {
TIMEOUT_MILLIS
);

@Language("HOCON") String secondNodeAttributes = "{region:{attribute:\"US\"},storage:{attribute:\"SSD\"}}";
@Language("HOCON") String secondNodeAttributes = "{region.value: US, storage.value: SSD}";

// This node pass the filter but storage profiles of a node do not match zone's storage profiles.
// TODO: https://issues.apache.org/jira/browse/IGNITE-21387 recovery of this node is failing,
Expand Down Expand Up @@ -210,7 +210,7 @@ void testAlteringFiltersPropagatedDataNodesToStableImmediately() throws Exceptio
TIMEOUT_MILLIS
);

@Language("HOCON") String firstNodeAttributes = "{region:{attribute:\"US\"},storage:{attribute:\"SSD\"}}";
@Language("HOCON") String firstNodeAttributes = "{region.value: US, storage.value: SSD}";

// This node pass the filter
startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));
Expand Down Expand Up @@ -265,7 +265,7 @@ void testEmptyDataNodesDoNotPropagatedToStableAfterAlteringFilter() throws Excep
TIMEOUT_MILLIS
);

@Language("HOCON") String firstNodeAttributes = "{region:{attribute:\"US\"},storage:{attribute:\"SSD\"}}";
@Language("HOCON") String firstNodeAttributes = "{region.value: US, storage.value: SSD}";

// This node pass the filter
startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));
Expand Down Expand Up @@ -306,7 +306,7 @@ void testFilteredEmptyDataNodesDoNotTriggerRebalance() throws Exception {
Ignite node0 = unwrapIgniteImpl(node(0));

// This node passes the filter
@Language("HOCON") String firstNodeAttributes = "{region:{attribute:\"EU\"},storage:{attribute:\"HDD\"}}";
@Language("HOCON") String firstNodeAttributes = "{region.value: EU, storage.value: HDD}";

Ignite node1 = startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));

Expand All @@ -324,7 +324,7 @@ void testFilteredEmptyDataNodesDoNotTriggerRebalance() throws Exception {

node1.sql().execute(null, createTableSql());

TableManager tableManager = (TableManager) IgniteTestUtils.getFieldValue(node0, IgniteImpl.class, "distributedTblMgr");
TableManager tableManager = IgniteTestUtils.getFieldValue(node0, IgniteImpl.class, "distributedTblMgr");

TableViewInternal table = (TableViewInternal) tableManager.table(TABLE_NAME);

Expand All @@ -350,7 +350,7 @@ void testFilteredEmptyDataNodesDoNotTriggerRebalanceOnReplicaUpdate() throws Exc
IgniteImpl node0 = unwrapIgniteImpl(node(0));

// This node passes the filter
@Language("HOCON") String firstNodeAttributes = "{region:{attribute:\"EU\"},storage:{attribute:\"HDD\"}}";
@Language("HOCON") String firstNodeAttributes = "{region.value: EU, storage.value: HDD}";

startNode(1, createStartConfig(firstNodeAttributes, STORAGE_PROFILES_CONFIGS));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public abstract class BaseDistributionZoneManagerTest extends BaseIgniteAbstract
private final List<IgniteComponent> components = new ArrayList<>();

@InjectConfiguration("mock.properties = {"
+ PARTITION_DISTRIBUTION_RESET_TIMEOUT + ".propertyValue = \"" + IMMEDIATE_TIMER_VALUE + "\", "
+ PARTITION_DISTRIBUTION_RESET_TIMEOUT + ".value = \"" + IMMEDIATE_TIMER_VALUE + "\", "
+ "}")
SystemDistributedConfiguration systemDistributedConfiguration;

Expand Down
11 changes: 4 additions & 7 deletions modules/distribution-zones/tech-notes/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ In the `ignite-config.conf` it looks like this:

```
nodeAttributes.nodeAttributes {
region.attribute = "US"
storage.attribute = "SSD"
region.value = "US"
storage.value = "SSD"
}
```

Expand All @@ -28,10 +28,10 @@ or like this in a `ignite-config.json`:
"nodeAttributes":{
"nodeAttributes":{
"region":{
"attribute":"US"
"value":"US"
},
"storage":{
"attribute":"SSD"
"value":"SSD"
}
}
}
Expand Down Expand Up @@ -65,6 +65,3 @@ To check all capabilities of JSONPath, see https://github.com/json-path/JsonPath

Note that as a default value for filter '$..*' filter is used, meaning that all nodes match the filter.
Also it is important, that if there are no specified attributes for a node, it means that a node match only the default filter.



Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public static boolean equals(Entry act, Entry exp) {
public static String createClusterConfigWithCompactionProperties(long interval, long dataAvailabilityTime) {
return String.format(
"ignite.system.properties: {"
+ "%s.propertyValue= \"%s\", "
+ "%s.propertyValue= \"%s\""
+ "%s.value= \"%s\", "
+ "%s.value= \"%s\""
+ "}",
INTERVAL_SYSTEM_PROPERTY_NAME, interval, DATA_AVAILABILITY_TIME_SYSTEM_PROPERTY_NAME, dataAvailabilityTime
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void testEmptySystemProperties(@InjectConfiguration SystemDistributedConfigurati
@Test
void testValidSystemPropertiesOnStart(
@InjectConfiguration("mock.properties = {"
+ INTERVAL_SYSTEM_PROPERTY_NAME + ".propertyValue = \"100\", "
+ DATA_AVAILABILITY_TIME_SYSTEM_PROPERTY_NAME + ".propertyValue = \"500\""
+ INTERVAL_SYSTEM_PROPERTY_NAME + ".value = \"100\", "
+ DATA_AVAILABILITY_TIME_SYSTEM_PROPERTY_NAME + ".value = \"500\""
+ "}")
SystemDistributedConfiguration systemConfig
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ public class ItReplicaLifecycleTest extends BaseIgniteAbstractTest {
@InjectConfiguration
private static SystemLocalConfiguration systemConfiguration;

@InjectConfiguration("mock.nodeAttributes: {region.attribute = US, storage.attribute = SSD}")
@InjectConfiguration("mock.nodeAttributes: {region.value = US, storage.value = SSD}")
private static NodeAttributesConfiguration nodeAttributes1;

@InjectConfiguration("mock.nodeAttributes: {region.attribute = EU, storage.attribute = SSD}")
@InjectConfiguration("mock.nodeAttributes: {region.value = EU, storage.value = SSD}")
private static NodeAttributesConfiguration nodeAttributes2;

@InjectConfiguration("mock.nodeAttributes: {region.attribute = UK, storage.attribute = SSD}")
@InjectConfiguration("mock.nodeAttributes: {region.value = UK, storage.value = SSD}")
private static NodeAttributesConfiguration nodeAttributes3;

@InjectConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,8 @@ public void changeNodeAttributesConfigurationOnStartTest() {
stopNode(0);

String newAttributesCfg = "{\n"
+ " region.attribute = \"US\"\n"
+ " storage.attribute = \"SSD\"\n"
+ " region.value = \"US\"\n"
+ " storage.value = \"SSD\"\n"
+ "}";

Map<String, String> newAttributesMap = Map.of("region", "US", "storage", "SSD");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
*/
public class ItReplicaStateManagerTest extends BaseIgniteRestartTest {
private static final String[] ATTRIBUTES = {
"{region:{attribute:\"REG0\"}}",
"{region:{attribute:\"REG1\"}}",
"{region:{attribute:\"REG2\"}}"
"{ region.value: REG0 }",
"{ region.value: REG1 }",
"{ region.value: REG2 }"
};

private static final String ZONE_NAME = "TEST_ZONE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class ItUnstableTopologyTest extends BaseSqlIntegrationTest {
+ " },\n"
+ " clientConnector: { port:{} },\n"
+ " nodeAttributes: {\n"
+ " nodeAttributes: {role: {attribute: \"data\"}}\n"
+ " nodeAttributes: { role.value: data }\n"
+ " },\n"
+ " rest.port: {},\n"
+ " failureHandler.dumpThreadsOnFailure: false\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
+ " },\n"
+ " clientConnector: { port:{} },\n"
+ " nodeAttributes: {\n"
+ " nodeAttributes: {region: {attribute: \"US\"}, zone: {attribute: \"global\"}}\n"
+ " nodeAttributes: {region.value: US, zone.value: global}\n"
+ " },\n"
+ " rest.port: {},\n"
+ " failureHandler.dumpThreadsOnFailure: false\n"
Expand All @@ -77,7 +77,7 @@ public class ItRebalanceTriggersRecoveryTest extends ClusterPerTestIntegrationTe
+ " },\n"
+ " clientConnector: { port:{} },\n"
+ " nodeAttributes: {\n"
+ " nodeAttributes: {zone: {attribute: \"global\"}}\n"
+ " nodeAttributes: {zone.value: global}\n"
+ " },\n"
+ " rest.port: {},\n"
+ " failureHandler.dumpThreadsOnFailure: false\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

/** Test suite for the cases with a recovery of the group replication factor after reset by zone filter update. */
public class ItHighAvailablePartitionsRecoveryByFilterUpdateTest extends AbstractHighAvailablePartitionsRecoveryTest {
private static final String GLOBAL_EU_NODES_CONFIG = nodeConfig("{region.attribute = EU, zone.attribute = global}");
private static final String GLOBAL_EU_NODES_CONFIG = nodeConfig("{region.value = EU, zone.value = global}");

private static final String EU_ONLY_NODES_CONFIG = nodeConfig("{region.attribute = EU}");
private static final String EU_ONLY_NODES_CONFIG = nodeConfig("{region.value = EU}");

private static final String GLOBAL_NODES_CONFIG = nodeConfig("{zone.attribute = global}");
private static final String GLOBAL_NODES_CONFIG = nodeConfig("{zone.value = global}");

@Override
protected int initialNodes() {
Expand Down

0 comments on commit 4a7dff1

Please sign in to comment.