JeetKunDoug commented on code in PR #38:
URL:
https://github.com/apache/cassandra-analytics/pull/38#discussion_r1484658554
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/bulkwriter/BulkSparkConf.java:
##########
@@ -128,12 +128,13 @@ public class BulkSparkConf implements Serializable
protected boolean useOpenSsl;
protected int ringRetryCount;
protected final Set<String> blockedInstances;
+ protected final DigestTypeOption digestTypeOption;
public BulkSparkConf(SparkConf conf, Map<String, String> options)
{
this.conf = conf;
Optional<Integer> sidecarPortFromOptions =
MapUtils.getOptionalInt(options, WriterOptions.SIDECAR_PORT.name(), "sidecar
port");
- this.userProvidedSidecarPort = sidecarPortFromOptions.isPresent() ?
sidecarPortFromOptions.get() : getOptionalInt(SIDECAR_PORT).orElse(-1);
+ this.userProvidedSidecarPort = sidecarPortFromOptions.orElseGet(() ->
getOptionalInt(SIDECAR_PORT).orElse(-1));
Review Comment:
Agree with @frankgh here... I prefer `orElseGet` when using optionals.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]