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

Adding presto-pinot-driver module #7384

Merged
merged 3 commits into from
Sep 9, 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
Next Next commit
Adding presto-pinot-driver module
  • Loading branch information
xiangfu0 committed Sep 9, 2021
commit b8d0fa74311acdbb20f157d838ef810464d5a71d
3 changes: 3 additions & 0 deletions pinot-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<url>https://pinot.apache.org/</url>
<properties>
<pinot.root>${basedir}/..</pinot.root>
<compiler.default.phase.prop>none</compiler.default.phase.prop>
<compiler.jdk8.phase.prop>compile</compiler.jdk8.phase.prop>
<toolchains.jdk8.phase.prop>validate</toolchains.jdk8.phase.prop>
</properties>
<build>
<!-- Antlr stuff -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.pinot.common.utils.grpc;

import io.grpc.Channel;
import io.grpc.ManagedChannelBuilder;
import java.util.Iterator;
import org.apache.pinot.common.proto.PinotQueryServerGrpc;
Expand All @@ -29,13 +28,44 @@ public class GrpcQueryClient {
private final PinotQueryServerGrpc.PinotQueryServerBlockingStub _blockingStub;

public GrpcQueryClient(String host, int port) {
// Set max message size to 128MB
Channel channel =
ManagedChannelBuilder.forAddress(host, port).maxInboundMessageSize(128 * 1024 * 1024).usePlaintext().build();
_blockingStub = PinotQueryServerGrpc.newBlockingStub(channel);
this(host, port, new Config());
}

public GrpcQueryClient(String host, int port, Config config) {
ManagedChannelBuilder managedChannelBuilder = ManagedChannelBuilder
.forAddress(host, port)
.maxInboundMessageSize(config.getMaxInboundMessageSizeBytes());
if (config.isUsePlainText()) {
managedChannelBuilder.usePlaintext();
}
_blockingStub = PinotQueryServerGrpc.newBlockingStub(managedChannelBuilder.build());
}

public Iterator<Server.ServerResponse> submit(Server.ServerRequest request) {
return _blockingStub.submit(request);
}

public static class Config {
// Default max message size to 128MB
private static final int DEFAULT_MAX_INBOUND_MESSAGE_BYTES_SIZE = 128 * 1024 * 1024;
private final int _maxInboundMessageSizeBytes;
private final boolean _usePlainText;

public Config() {
this(DEFAULT_MAX_INBOUND_MESSAGE_BYTES_SIZE, true);
}

public Config(int maxInboundMessageSizeBytes, boolean usePlainText) {
_maxInboundMessageSizeBytes = maxInboundMessageSizeBytes;
_usePlainText = usePlainText;
}

public int getMaxInboundMessageSizeBytes() {
return _maxInboundMessageSizeBytes;
}

public boolean isUsePlainText() {
return _usePlainText;
}
}
}
1 change: 1 addition & 0 deletions pinot-connectors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<modules>
<module>pinot-spark-connector</module>
<module>presto-pinot-driver</module>
</modules>

<dependencies>
Expand Down
Loading