Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMWK-357 Fix setting hosts in configuration #719

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,18 @@ protected AerospikeSettings aerospikeSettings(AerospikeDataSettings dataSettings
// values set via configureDataSettings() have precedence over the parameters from application.properties
configureDataSettings(dataSettings);

// getHosts() return value has precedence over hosts parameter from application.properties
// getHosts() has precedence over hosts parameter from application.properties
Collection<Host> hosts;
if ((hosts = getHosts()) != null) {
connectionSettings.setHostsArray(hosts.toArray(new Host[0]));
} else if (!StringUtils.hasText(connectionSettings.getHosts())) {
} else if (StringUtils.hasText(connectionSettings.getHosts())) {
connectionSettings.setHostsArray(Host.parseHosts(connectionSettings.getHosts(), getDefaultPort()));
} else {
throw new IllegalStateException("No hosts found, please set hosts parameter in application.properties or " +
"override getHosts() method");
}
connectionSettings.setHostsArray(Host.parseHosts(connectionSettings.getHosts(), getDefaultPort()));

// nameSpace() return value has precedence over namespace parameter from application.properties
// nameSpace() has precedence over namespace parameter from application.properties
String namespace;
if ((namespace = nameSpace()) != null) connectionSettings.setNamespace(namespace);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface AerospikeConverter extends AerospikeReader<Object>, AerospikeWr
/**
* Key that identifies POJO's class.
*/
public static final String CLASS_KEY = "@_class";
String CLASS_KEY = "@_class";

/**
* Access Aerospike-specific conversion service.
Expand Down
Loading