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

Utility package cleanup. #177

Merged
merged 2 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -25,24 +25,21 @@
* for interacting with Aerospike
* across the entire implementation
* @author peter
*
*/
@UtilityClass
public class Utils {
/**
* Issues an "Info" request to all nodes in the cluster.
* @param client
* @param infoString
* @return
* @param client An AerospikeClient.
* @param infoString The name of the variable to retrieve.
* @return An "Info" value for the given variable from all the nodes in the cluster.
*/
public static String[] infoAll(AerospikeClient client,
String infoString) {
public static String[] infoAll(AerospikeClient client, String infoString) {
String[] messages = new String[client.getNodes().length];
int index = 0;
for (Node node : client.getNodes()){
for (Node node : client.getNodes()) {
messages[index] = Info.request(node, infoString);
}
return messages;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ public class AerospikeExpirationPolicy {

public static final int DO_NOT_UPDATE_EXPIRATION = -2;
public static final int NEVER_EXPIRE = -1;
public static final int NAMESPACE_DEFAULT_EXPIRATION = 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void propertiesColonSeparated() {
assertThat(stopWritesCount).isEqualTo(0);
assertThat(InfoResponseUtils.getPropertyFromInfoResponse(response, "set-enable-xdr", Function.identity())).isEqualTo("use-default");
assertThat(InfoResponseUtils.getPropertyFromInfoResponse(response, "disable-eviction", Boolean::parseBoolean)).isFalse();

}

@Test
Expand All @@ -47,7 +46,7 @@ void propertyInTheMiddleOfResponse() {
}

@Test
void propertyInvalidTypeInReponse() {
void propertyInvalidTypeInResponse() {
String response = "memory-size=1073741824;default-ttl=2592000;replication-factor=factor;";

assertThatThrownBy(() -> InfoResponseUtils.getPropertyFromConfigResponse(response, "replication-factor", Integer::parseInt))
Expand All @@ -56,7 +55,7 @@ void propertyInvalidTypeInReponse() {
}

@Test
void propertyInvalidFormatInReponse() {
void propertyInvalidFormatInResponse() {
String response = "memory-size=1073741824;default-ttl=2592000;replication-factor;";

assertThatThrownBy(() -> InfoResponseUtils.getPropertyFromConfigResponse(response, "replication-factor", Integer::parseInt))
Expand Down