Skip to content

Commit

Permalink
Improve wording for consistency with documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Dec 3, 2024
1 parent 353f8df commit 3ab13f5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import java.io.IOException;

/**
* Decodes the direct and spooled protocols.
* Decodes the direct and spooling protocols.
*
* If the "data" fields starts with an array - this is the direct protocol which requires obtaining JsonParser
* and then parsing rows lazily.
*
* Otherwise, this is an spooled protocol.
* Otherwise, this is a spooling protocol.
*/
public class QueryDataClientJacksonModule
extends SimpleModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import static com.google.common.base.Verify.verify;
import static com.google.common.collect.ImmutableMap.toImmutableMap;
import static java.lang.String.format;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.joining;

Expand All @@ -39,7 +40,7 @@ private QueryDataDecoders() {}
public static Factory get(String encoding)
{
if (!encodingMap.containsKey(encoding)) {
throw new IllegalArgumentException("Unknown spooled protocol encoding: " + encoding);
throw new IllegalArgumentException(format("Unknown spooling protocol encoding '%s'", encoding));
}

Factory factory = encodingMap.get(encoding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ public QueryDataEncoders(SpoolingEnabledConfig enabledConfig, Set<QueryDataEncod
.collect(toImmutableMap(Map.Entry::getKey, Map.Entry::getValue));

if (enabled) {
LOG.info("Spooled client protocol is enabled with encodings: " + getAvailableEncodings());
LOG.info("Spooling protocol is enabled with encodings: " + getAvailableEncodings());
}
}

public boolean exists(String encoding)
{
if (!enabled) {
throw new IllegalStateException("Spooled client protocol is not enabled");
throw new IllegalStateException("Spooling protocol is not enabled");
}
return factories.containsKey(encoding);
}

public QueryDataEncoder.Factory get(String encoding)
{
if (!enabled) {
throw new IllegalStateException("Spooled client protocol is not enabled");
throw new IllegalStateException("Spooling protocol is not enabled");
}
if (!exists(encoding)) {
throw new IllegalArgumentException("Unknown spooled protocol encoding: " + encoding);
throw new IllegalArgumentException("Unknown spooling protocol encoding: " + encoding);
}

return factories.get(encoding);
Expand All @@ -66,7 +66,7 @@ public QueryDataEncoder.Factory get(String encoding)
public Set<String> getAvailableEncodings()
{
if (!enabled) {
throw new IllegalStateException("Spooled client protocol is not enabled");
throw new IllegalStateException("Spooling protocol is not enabled");
}
return factories.keySet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean isAllowInlining()
return allowInlining;
}

@ConfigDescription("Allow spooled protocol to inline data")
@ConfigDescription("Allow spooling protocol to inline data")
@Config("protocol.spooling.inlining.enabled")
public SpoolingConfig setAllowInlining(boolean allowInlining)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public boolean isEnabled()
}

@Config("protocol.spooling.enabled")
@ConfigDescription("Enable spooled client protocol support")
@ConfigDescription("Enable spooling protocol")
public SpoolingEnabledConfig setEnabled(boolean enabled)
{
this.enabled = enabled;
Expand Down

0 comments on commit 3ab13f5

Please sign in to comment.