Skip to content

Conversation

@emerkle826
Copy link
Contributor

Update Startup message so it can take a map of options as a constructor argument. The driver code will be changed to use this new constructor. The 2 existing constructors will remain and simply call the new constructor to the same end effect.

private static final String CQL_VERSION = "3.0.0";

public final Map<String, String> options;
private final Map<String, String> options;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep a public final field here since the map is immutable.
The protocol classes are very simple and low-level, so they generally expose fields directly instead of getters.

}
} else {
this.options = NullAllowingImmutableMap.of(CQL_VERSION_KEY, CQL_VERSION);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

public <B> Message decode(B source, PrimitiveCodec<B> decoder) {
Map<String, String> map = decoder.readStringMap(source);
return new Startup(map.get(COMPRESSION_KEY));
return new Startup(map);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's how it should have been in the first place.

@olim7t olim7t merged commit 314b646 into 1.x Sep 4, 2018
@olim7t olim7t deleted the java1932 branch September 4, 2018 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants