/** * <code>optional .exec.shared.UserCredentials credentials = 14;</code> */ public Builder mergeCredentials(com.dremio.exec.proto.UserBitShared.UserCredentials value) { if (credentialsBuilder_ == null) { if (((bitField0_ & 0x00000800) == 0x00000800) && credentials_ != com.dremio.exec.proto.UserBitShared.UserCredentials.getDefaultInstance()) { credentials_ = com.dremio.exec.proto.UserBitShared.UserCredentials.newBuilder(credentials_).mergeFrom(value).buildPartial(); } else { credentials_ = value; } onChanged(); } else { credentialsBuilder_.mergeFrom(value); } bitField0_ |= 0x00000800; return this; } /**
final QueryId queryId = QueryId.PARSER.parseFrom(pBody); final Ack ack = worker.cancelQuery(ExternalIdHelper.toExternal(queryId), connection.getSession().getCredentials().getUserName()); responseSender.send(new Response(RpcType.ACK, ack)); break;
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getUserNameBytes()); } getUnknownFields().writeTo(output); }
if (hasCredentials()) { result = result && getCredentials() .equals(other.getCredentials());
injector.injectChecked(queryContext.getExecutionControls(), "run-try-beginning", ForemanException.class); observers.queryStarted(queryRequest, queryContext.getSession().getCredentials().getUserName());
req.getTableNameFilter()); if (tableName != null ) { dContext.getCatalogService().getCatalog(SchemaConfig.newBuilder(session.getCredentials().getUserName()).build()) .getTable(tableName);
.equals(context.getSession() .getCredentials() .getUserName()));
userService.authenticate(inbound.getCredentials().getUserName(), password); } catch (UserLoginException ex) { return handleFailure(respBuilder, HandshakeStatus.AUTH_FAILED, ex.getMessage(), ex);
break; case 14: builder.setCredentials(input.mergeObject(com.dremio.exec.proto.UserBitShared.UserCredentials.newBuilder(), com.dremio.exec.proto.SchemaUserBitShared.UserCredentials.MERGE));
bitField0_ = (bitField0_ & ~0x00000400); if (credentialsBuilder_ == null) { credentials_ = com.dremio.exec.proto.UserBitShared.UserCredentials.getDefaultInstance(); } else { credentialsBuilder_.clear();
.withCredentials(UserBitShared.UserCredentials.newBuilder().setUserName("foo").build()) .withUserProperties(UserProperties.getDefaultInstance()) .withOptionManager(nodeContext1.getOptionManager())
.withCredentials(UserCredentials.newBuilder() .setUserName("foo") .build())
.withCredentials(UserBitShared.UserCredentials.newBuilder() .setUserName(username) .build())
break; case 4: builder.setCredentials(input.mergeObject(com.dremio.exec.proto.UserBitShared.UserCredentials.newBuilder(), com.dremio.exec.proto.SchemaUserBitShared.UserCredentials.MERGE));
this.bufferManager = new BufferManagerImpl(allocator); final String queryUserName = session.getCredentials().getUserName(); final ViewExpansionContext viewExpansionContext = new ViewExpansionContext(queryUserName); final SchemaConfig schemaConfig = SchemaConfig.newBuilder(queryUserName)
bitField0_ = (bitField0_ & ~0x00000004); if (credentialsBuilder_ == null) { credentials_ = com.dremio.exec.proto.UserBitShared.UserCredentials.getDefaultInstance(); } else { credentialsBuilder_.clear();
@Override public void submitLocalQuery( ExternalId externalId, QueryObserver observer, Object query, boolean prepare, LocalExecutionConfig config) { try{ // make sure we keep a local observer out of band. final QueryObserver oobJobObserver = new OutOfBandQueryObserver(observer, executor); UserSession session = UserSession.Builder.newBuilder() .setSupportComplexTypes(true) .withCredentials(UserCredentials .newBuilder() .setUserName(config.getUsername()) .build()) .exposeInternalSources(config.isExposingInternalSources()) .withDefaultSchema(config.getSqlContext()) .withSubstitutionSettings(config.getSubstitutionSettings()) .withOptionManager(options) .withClientInfos(UserRpcUtils.getRpcEndpointInfos("Dremio Java local client")) .build(); final ReAttemptHandler attemptHandler = newInternalAttemptHandler(options, config.isFailIfNonEmptySent()); submit(externalId, oobJobObserver, session, new UserRequest(prepare ? RpcType.CREATE_PREPARED_STATEMENT : RpcType.RUN_QUERY, query), TerminationListenerRegistry.NOOP, config, attemptHandler); }catch(Exception ex){ throw Throwables.propagate(ex); } } }
private void initFields() { handle_ = com.dremio.exec.proto.ExecProtos.FragmentHandle.getDefaultInstance(); networkCost_ = 0F; cpuCost_ = 0F; diskCost_ = 0F; memoryCost_ = 0F; fragmentJson_ = com.google.protobuf.ByteString.EMPTY; leafFragment_ = false; assignment_ = com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.getDefaultInstance(); foreman_ = com.dremio.exec.proto.CoordinationProtos.NodeEndpoint.getDefaultInstance(); memInitial_ = 20000000L; memMax_ = 2000000000L; credentials_ = com.dremio.exec.proto.UserBitShared.UserCredentials.getDefaultInstance(); optionsJson_ = com.google.protobuf.ByteString.EMPTY; context_ = com.dremio.exec.proto.CoordExecRPC.QueryContextInformation.getDefaultInstance(); collector_ = java.util.Collections.emptyList(); priority_ = com.dremio.exec.proto.CoordExecRPC.FragmentPriority.getDefaultInstance(); fragmentCodec_ = com.dremio.exec.proto.CoordExecRPC.FragmentCodec.NONE; allAssignment_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1;
public void setup() { try { storeProvider = new LocalKVStoreProvider(DremioTest.CLASSPATH_SCAN_RESULT, null, true, false); storeProvider.start(); final Provider<KVStoreProvider> storeProviderProvider = new Provider<KVStoreProvider>() { @Override public KVStoreProvider get() { return storeProvider; } }; provider = new KVPersistentStoreProvider(storeProviderProvider); options = new SystemOptionManager(result, persistence, provider); options.init(); compiler = new CodeCompiler(config, options); ec = new ExecutionControls(options, NodeEndpoint.getDefaultInstance()); functionLookup = new FunctionImplementationRegistry(config, result); contextInformation = new ContextInformationImpl(UserCredentials.getDefaultInstance(), QueryContextInformation.getDefaultInstance()); }catch(Exception e){ throw new RuntimeException(e); } }
private void print(String fragmentFile, int bitCount, int expectedFragmentCount) throws Exception{ System.out.println(String.format("=================Building plan fragments for [%s]. Allowing %d total Nodes.==================", fragmentFile, bitCount)); PhysicalPlanReader ppr = PhysicalPlanReaderTestFactory.defaultPhysicalPlanReader(DEFAULT_SABOT_CONFIG, CLASSPATH_SCAN_RESULT); Fragment fragmentRoot = getRootFragment(ppr, fragmentFile); SimpleParallelizer par = new SimpleParallelizer(1000*1000, 5, 10, 1.2, AbstractAttemptObserver.NOOP, true, 1.5d); List<NodeEndpoint> endpoints = Lists.newArrayList(); NodeEndpoint localBit = null; for(int i =0; i < bitCount; i++) { NodeEndpoint b1 = NodeEndpoint.newBuilder().setAddress("localhost").setFabricPort(1234+i).build(); if (i == 0) { localBit = b1; } endpoints.add(b1); } final QueryContextInformation queryContextInfo = Utilities.createQueryContextInfo("dummySchemaName"); List<PlanFragment> qwu = par.getFragments(new OptionList(), localBit, QueryId.getDefaultInstance(), endpoints, ppr, fragmentRoot, UserSession.Builder.newBuilder().withCredentials(UserBitShared.UserCredentials.newBuilder().setUserName("foo").build()).build(), queryContextInfo, null); assertEquals(expectedFragmentCount, qwu.size() + 1 /* root fragment is not part of the getFragments() list*/); }