Package org.teiid.dqp.internal.process

Examples of org.teiid.dqp.internal.process.DQPWorkContext


    this.clusterName = clusterName;
  }

  public LogonResult logon(Properties connProps) throws LogonException,
      ComponentNotFoundException {
    DQPWorkContext workContext = DQPWorkContext.getWorkContext();
    SessionToken oldToken = workContext.getSessionToken();
        String applicationName = connProps.getProperty(TeiidURL.CONNECTION.APP_NAME);
        // user may be null if using trustedToken to log on
        String user = connProps.getProperty(TeiidURL.CONNECTION.USER_NAME, CoreConstants.DEFAULT_ANON_USERNAME);
        // password may be null if using trustedToken to log on
        String password = connProps.getProperty(TeiidURL.CONNECTION.PASSWORD);
View Full Code Here


  }

  private String updateDQPContext(SessionMetadata s) {
    String sessionID = s.getSessionId();
   
    DQPWorkContext workContext = DQPWorkContext.getWorkContext();
    workContext.setSession(s);
    return sessionID;
  }
View Full Code Here

      throw new AdminProcessingException(e1);
    }

    final long requestID =  0L;
   
    DQPWorkContext context = new DQPWorkContext();
    context.setSession(session);
   
    try {
      return context.runInContext(new Callable<List<List>>() {
        @Override
        public List<List> call() throws Exception {
          ArrayList<List> results = new ArrayList<List>();
         
          long start = System.currentTimeMillis();
View Full Code Here

  }

  static AtomicRequestMessage createNewAtomicRequestMessage(int requestid, int nodeid) throws Exception {
    RequestMessage rm = new RequestMessage();
   
    DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(EXAMPLE_BQT, FakeMetadataFactory.exampleBQTVDB());
    workContext.getSession().setSessionId(String.valueOf(1));
    workContext.getSession().setUserName("foo"); //$NON-NLS-1$
   
    AtomicRequestMessage request = new AtomicRequestMessage(rm, workContext, nodeid);
    request.setCommand(helpGetCommand("SELECT BQT1.SmallA.INTKEY FROM BQT1.SmallA", EXAMPLE_BQT)); //$NON-NLS-1$
    request.setRequestID(new RequestID(requestid));
    request.setConnectorName("testing"); //$NON-NLS-1$
View Full Code Here

    private static final boolean DEBUG = false;
   
    public void helpTestMultiSourcePlan(QueryMetadataInterface metadata, String userSql, String multiModel, int sourceCount, ProcessorDataManager dataMgr, List[] expectedResults, VDBMetaData vdb) throws Exception {
       
       DQPWorkContext dqpContext = FakeMetadataFactory.buildWorkContext(metadata, vdb);
    
        Set<String> multiSourceModels = vdb.getMultiSourceModelNames();
        for (String model:multiSourceModels) {
            char sourceID = 'a';
            // by default every model has one binding associated, but for multi-source there were none assigned.
View Full Code Here

@Ignore(value="Serialization of language objects has been turned off")
public class TestAtomicRequestMessage {

    public static AtomicRequestMessage example() {
        RequestMessage rm = new RequestMessage();
        DQPWorkContext workContext = new DQPWorkContext();
        workContext.getSession().setSessionId(String.valueOf(2));
        AtomicRequestMessage message = new AtomicRequestMessage(rm, workContext, 1000);
        message.setCommand(TestQueryImpl.helpExample(true));
        message.setFetchSize(100);
        message.setPartialResults(true);
        message.setRequestID(new RequestID(5000L));
View Full Code Here

public class TestLogonImpl extends TestCase {

  public void testLogonResult() throws Exception {
    SessionService ssi = Mockito.mock(SessionService.class);
    DQPWorkContext.setWorkContext(new DQPWorkContext());
    String userName = "Fred"; //$NON-NLS-1$
    String applicationName = "test"; //$NON-NLS-1$
    Properties p = new Properties();
    p.setProperty(TeiidURL.CONNECTION.USER_NAME, userName);
    p.setProperty(TeiidURL.CONNECTION.APP_NAME, applicationName);
View Full Code Here

    public Cryptor getCryptor() {
      return new NullCryptor();
    }

    public DQPWorkContext getWorkContext() {
      return new DQPWorkContext();
    }
View Full Code Here

    public static DQPWorkContext buildWorkContext(TransformationMetadata metadata) {
      return buildWorkContext(metadata, metadata.getVdbMetaData());
    }
   
  public static DQPWorkContext buildWorkContext(QueryMetadataInterface metadata, VDBMetaData vdb) {
    DQPWorkContext workContext = new DQPWorkContext();
    SessionMetadata session = new SessionMetadata();
    workContext.setSession(session);
    session.setVDBName(vdb.getName());
    session.setVDBVersion(vdb.getVersion());
    session.setSessionId(String.valueOf(1));
    session.setUserName("foo"); //$NON-NLS-1$
    session.setVdb(vdb);
        workContext.getVDB().addAttchment(QueryMetadataInterface.class, metadata);
        if (metadata instanceof TransformationMetadata) {
          workContext.getVDB().addAttchment(TransformationMetadata.class, (TransformationMetadata)metadata);
        }
        DQPWorkContext.setWorkContext(workContext);
    return workContext;
  }
View Full Code Here

TOP

Related Classes of org.teiid.dqp.internal.process.DQPWorkContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.