Skip to content

Commit

Permalink
Reformat FlightWorkManager
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-telles committed Aug 12, 2021
1 parent 2831b77 commit 7c02250
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 123 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.dremio.service.flight.impl;

import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -67,7 +68,8 @@ public FlightWorkManager(Provider<UserWorker> workerProvider,
* @return A FlightPreparedStatement which consumes the result of the job.
*/
public FlightPreparedStatement createPreparedStatement(FlightDescriptor flightDescriptor,
Supplier<Boolean> isRequestCancelled, UserSession userSession) {
Supplier<Boolean> isRequestCancelled,
UserSession userSession) {
final String query = getQuery(flightDescriptor);

final UserProtos.CreatePreparedStatementArrowReq createPreparedStatementReq =
Expand All @@ -88,7 +90,8 @@ public FlightPreparedStatement createPreparedStatement(FlightDescriptor flightDe
return new FlightPreparedStatement(flightDescriptor, query, createPreparedStatementResponseHandler);
}

public void runPreparedStatement(TicketContent.PreparedStatementTicket ticket, FlightProducer.ServerStreamListener listener,
public void runPreparedStatement(TicketContent.PreparedStatementTicket ticket,
FlightProducer.ServerStreamListener listener,
BufferAllocator allocator, UserSession userSession) {
UserProtos.PreparedStatementHandle handle = ticket.getHandle();
runPreparedStatement(handle, listener, allocator, userSession);
Expand All @@ -112,20 +115,20 @@ public void runPreparedStatement(UserProtos.PreparedStatementHandle handle,
final UserResponseHandler responseHandler = runQueryResponseHandlerFactory.getHandler(runExternalId, userSession,
workerProvider, optionManagerProvider, listener, allocator);

workerProvider.get().submitWork(runExternalId, userSession, responseHandler, userRequest, TerminationListenerRegistry.NOOP);
workerProvider.get()
.submitWork(runExternalId, userSession, responseHandler, userRequest, TerminationListenerRegistry.NOOP);
}

public void getCatalogs(FlightProducer.ServerStreamListener listener, BufferAllocator allocator,
UserSession userSession) {
final UserBitShared.ExternalId runExternalId = ExternalIdHelper.generateExternalId();
final UserRequest userRequest =
new UserRequest(UserProtos.RpcType.GET_CATALOGS,
UserProtos.GetCatalogsReq.newBuilder()
.build()); // TODO
new UserRequest(UserProtos.RpcType.GET_CATALOGS, UserProtos.GetCatalogsReq.newBuilder().build());

final UserResponseHandler responseHandler = new GetCatalogsResponseHandler(allocator, listener);

workerProvider.get().submitWork(runExternalId, userSession, responseHandler, userRequest, TerminationListenerRegistry.NOOP);
workerProvider.get()
.submitWork(runExternalId, userSession, responseHandler, userRequest, TerminationListenerRegistry.NOOP);
}

@VisibleForTesting
Expand Down

0 comments on commit 7c02250

Please sign in to comment.