mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Add a warning message for invalid input compression type string
This commit is contained in:
parent
0c74a442e5
commit
1025b1ddc2
@ -22,6 +22,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import io.nosqlbench.adapter.s4j.exception.S4JAdapterInvalidParamException;
|
import io.nosqlbench.adapter.s4j.exception.S4JAdapterInvalidParamException;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.math.NumberUtils;
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -35,6 +37,8 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class S4JClientConfConverter {
|
public class S4JClientConfConverter {
|
||||||
|
|
||||||
|
private final static Logger logger = LogManager.getLogger(S4JClientConfConverter.class);
|
||||||
|
|
||||||
public static Map<String, Object> convertRawClientConf(Map<String, String> pulsarClientConfMapRaw) {
|
public static Map<String, Object> convertRawClientConf(Map<String, String> pulsarClientConfMapRaw) {
|
||||||
Map<String, Object> s4jClientConfObjMap = new HashMap<>();
|
Map<String, Object> s4jClientConfObjMap = new HashMap<>();
|
||||||
s4jClientConfObjMap.putAll(pulsarClientConfMapRaw);
|
s4jClientConfObjMap.putAll(pulsarClientConfMapRaw);
|
||||||
@ -87,6 +91,11 @@ public class S4JClientConfConverter {
|
|||||||
};
|
};
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// Any invalid value will be treated as no compression
|
// Any invalid value will be treated as no compression
|
||||||
|
logger.warn("Invalid producer \"compressionType\" value ({}) in the config properties file. " +
|
||||||
|
"Expecting one of the following values: {}. " +
|
||||||
|
"No message compression will be applied (for producers).",
|
||||||
|
confVal,
|
||||||
|
S4JAdapterUtil.getValidMsgCompressionTypeList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user