use of org.apache.ignite.internal.configuration.storage.StorageException in project ignite-3 by apache.
the class ConfigurationChanger method start.
/**
* Start component.
*/
// ConfigurationChangeException, really?
public void start() throws ConfigurationChangeException {
Data data;
try {
data = storage.readAll();
} catch (StorageException e) {
throw new ConfigurationChangeException("Failed to initialize configuration: " + e.getMessage(), e);
}
SuperRoot superRoot = new SuperRoot(rootCreator());
Map<String, ?> dataValuesPrefixMap = toPrefixMap(data.values());
for (RootKey<?, ?> rootKey : rootKeys.values()) {
Map<String, ?> rootPrefixMap = (Map<String, ?>) dataValuesPrefixMap.get(rootKey.key());
InnerNode rootNode = createRootNode(rootKey);
if (rootPrefixMap != null) {
fillFromPrefixMap(rootNode, rootPrefixMap);
}
superRoot.addRoot(rootKey, rootNode);
}
// Workaround for distributed configuration.
addDefaults(superRoot);
storageRoots = new StorageRoots(superRoot, data.changeId());
storage.registerConfigurationListener(this::updateFromListener);
}
Aggregations