public CacheID(DQPWorkContext context, ParseInfo pi, String sql){ this(pi, sql, context.getVdbName(), context.getVdbVersion(), context.getSessionId(), context.getUserName()); }
public CacheID(DQPWorkContext context, ParseInfo pi, String sql){ this(pi, sql, context.getVdbName(), context.getVdbVersion(), context.getSessionId(), context.getUserName()); }
public CacheID(DQPWorkContext context, ParseInfo pi, String sql){ this(pi, sql, context.getVdbName(), context.getVdbVersion(), context.getSessionId(), context.getUserName()); }
public MetadataResult getMetadata(long requestID) throws TeiidComponentException, TeiidProcessingException { DQPWorkContext workContext = DQPWorkContext.getWorkContext(); MetaDataProcessor processor = new MetaDataProcessor(this, this.prepPlanCache, workContext.getVdbName(), workContext.getVdbVersion()); return processor.processMessage(workContext.getRequestID(requestID), workContext, null, true); }
public MetadataResult getMetadata(long requestID) throws TeiidComponentException, TeiidProcessingException { DQPWorkContext workContext = DQPWorkContext.getWorkContext(); MetaDataProcessor processor = new MetaDataProcessor(this, this.prepPlanCache, workContext.getVdbName(), workContext.getVdbVersion()); return processor.processMessage(workContext.getRequestID(requestID), workContext, null, true); }
public MetadataResult getMetadata(long requestID) throws TeiidComponentException, TeiidProcessingException { DQPWorkContext workContext = DQPWorkContext.getWorkContext(); MetaDataProcessor processor = new MetaDataProcessor(this, this.prepPlanCache, workContext.getVdbName(), workContext.getVdbVersion()); return processor.processMessage(workContext.getRequestID(requestID), workContext, null, true); }
public MetadataResult getMetadata(long requestID, String preparedSql, boolean allowDoubleQuotedVariable) throws TeiidComponentException, TeiidProcessingException { DQPWorkContext workContext = DQPWorkContext.getWorkContext(); checkActive(workContext); MetaDataProcessor processor = new MetaDataProcessor(this, this.prepPlanCache, workContext.getVdbName(), workContext.getVdbVersion()); return processor.processMessage(workContext.getRequestID(requestID), workContext, preparedSql, allowDoubleQuotedVariable); }
public MetadataResult getMetadata(long requestID, String preparedSql, boolean allowDoubleQuotedVariable) throws TeiidComponentException, TeiidProcessingException { DQPWorkContext workContext = DQPWorkContext.getWorkContext(); checkActive(workContext); MetaDataProcessor processor = new MetaDataProcessor(this, this.prepPlanCache, workContext.getVdbName(), workContext.getVdbVersion()); return processor.processMessage(workContext.getRequestID(requestID), workContext, preparedSql, allowDoubleQuotedVariable); }
public MetadataResult getMetadata(long requestID, String preparedSql, boolean allowDoubleQuotedVariable) throws TeiidComponentException, TeiidProcessingException { DQPWorkContext workContext = DQPWorkContext.getWorkContext(); checkActive(workContext); MetaDataProcessor processor = new MetaDataProcessor(this, this.prepPlanCache, workContext.getVdbName(), workContext.getVdbVersion()); return processor.processMessage(workContext.getRequestID(requestID), workContext, preparedSql, allowDoubleQuotedVariable); }
void initialize(RequestMessage requestMsg, BufferManager bufferManager, ProcessorDataManager processorDataManager, TransactionService transactionService, TempTableStore tempTableStore, DQPWorkContext workContext, SessionAwareCache<PreparedPlan> planCache) { this.requestMsg = requestMsg; this.vdbName = workContext.getVdbName(); this.vdbVersion = workContext.getVdbVersion(); this.bufferManager = bufferManager; this.processorDataManager = processorDataManager; this.transactionService = transactionService; this.tempTableStore = tempTableStore; this.workContext = workContext; this.requestId = workContext.getRequestID(this.requestMsg.getExecutionId()); this.connectorManagerRepo = workContext.getVDB().getAttachment(ConnectorManagerRepository.class); this.planCache = planCache; }
void initialize(RequestMessage requestMsg, BufferManager bufferManager, ProcessorDataManager processorDataManager, TransactionService transactionService, TempTableStore tempTableStore, DQPWorkContext workContext, SessionAwareCache<PreparedPlan> planCache) { this.requestMsg = requestMsg; this.vdbName = workContext.getVdbName(); this.vdbVersion = workContext.getVdbVersion(); this.bufferManager = bufferManager; this.processorDataManager = processorDataManager; this.transactionService = transactionService; this.tempTableStore = tempTableStore; this.workContext = workContext; this.requestId = workContext.getRequestID(this.requestMsg.getExecutionId()); this.connectorManagerRepo = workContext.getVDB().getAttachment(ConnectorManagerRepository.class); this.planCache = planCache; }
void initialize(RequestMessage requestMsg, BufferManager bufferManager, ProcessorDataManager processorDataManager, TransactionService transactionService, TempTableStore tempTableStore, DQPWorkContext workContext, SessionAwareCache<PreparedPlan> planCache) { this.requestMsg = requestMsg; this.vdbName = workContext.getVdbName(); this.vdbVersion = workContext.getVdbVersion(); this.bufferManager = bufferManager; this.processorDataManager = processorDataManager; this.transactionService = transactionService; this.tempTableStore = tempTableStore; this.workContext = workContext; this.requestId = workContext.getRequestID(this.requestMsg.getExecutionId()); this.connectorManagerRepo = workContext.getVDB().getAttachment(ConnectorManagerRepository.class); this.planCache = planCache; }
@Override public void visit(AlterView obj) { Table t = (Table)obj.getTarget().getMetadataID(); String sql = obj.getDefinition().toString(); if (getMetadataRepository(vdb, t.getParent().getName()) != null) { getMetadataRepository(vdb, t.getParent().getName()).setViewDefinition(workContext.getVdbName(), workContext.getVdbVersion(), t, sql); } alterView(vdb, t, sql, false); if (pdm.getEventDistributor() != null) { pdm.getEventDistributor().setViewDefinition(workContext.getVdbName(), workContext.getVdbVersion(), t.getParent().getName(), t.getName(), sql); } }
@Override public void visit(AlterProcedure obj) { Procedure p = (Procedure)obj.getTarget().getMetadataID(); String sql = obj.getDefinition().toString(); if (getMetadataRepository(vdb, p.getParent().getName()) != null) { getMetadataRepository(vdb, p.getParent().getName()).setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p, sql); } alterProcedureDefinition(vdb, p, sql, false); if (pdm.getEventDistributor() != null) { pdm.getEventDistributor().setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p.getParent().getName(), p.getName(), sql); } }
@Override public void visit(AlterView obj) { Table t = (Table)obj.getTarget().getMetadataID(); String sql = obj.getDefinition().toString(); if (getMetadataRepository(vdb, t.getParent().getName()) != null) { getMetadataRepository(vdb, t.getParent().getName()).setViewDefinition(workContext.getVdbName(), workContext.getVdbVersion(), t, sql); } alterView(vdb, t, sql, false); if (pdm.getEventDistributor() != null) { pdm.getEventDistributor().setViewDefinition(workContext.getVdbName(), workContext.getVdbVersion(), t.getParent().getName(), t.getName(), sql); } }
@Override public void visit(AlterProcedure obj) { Procedure p = (Procedure)obj.getTarget().getMetadataID(); String sql = obj.getDefinition().toString(); if (getMetadataRepository(vdb, p.getParent().getName()) != null) { getMetadataRepository(vdb, p.getParent().getName()).setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p, sql); } alterProcedureDefinition(vdb, p, sql, false); if (pdm.getEventDistributor() != null) { pdm.getEventDistributor().setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p.getParent().getName(), p.getName(), sql); } }
@Override public void visit(AlterProcedure obj) { Procedure p = (Procedure)obj.getTarget().getMetadataID(); String sql = obj.getDefinition().toString(); if (getMetadataRepository(vdb, p.getParent().getName()) != null) { getMetadataRepository(vdb, p.getParent().getName()).setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p, sql); } alterProcedureDefinition(vdb, p, sql, false); if (pdm.getEventDistributor() != null) { pdm.getEventDistributor().setProcedureDefinition(workContext.getVdbName(), workContext.getVdbVersion(), p.getParent().getName(), p.getName(), sql); } }
@Override public void visit(AlterView obj) { Table t = (Table)obj.getTarget().getMetadataID(); String sql = obj.getDefinition().toString(); if (getMetadataRepository(vdb, t.getParent().getName()) != null) { getMetadataRepository(vdb, t.getParent().getName()).setViewDefinition(workContext.getVdbName(), workContext.getVdbVersion(), t, sql); } alterView(vdb, t, sql, false); if (pdm.getEventDistributor() != null) { pdm.getEventDistributor().setViewDefinition(workContext.getVdbName(), workContext.getVdbVersion(), t.getParent().getName(), t.getName(), sql); } }
@Test public void testSerialize() throws Exception { DQPWorkContext copy = UnitTestUtil.helpSerialize(example()); assertEquals("5", copy.getSessionId()); //$NON-NLS-1$ assertEquals("userName", copy.getUserName()); //$NON-NLS-1$ assertEquals("vdbName", copy.getVdbName()); //$NON-NLS-1$ assertEquals("1", copy.getVdbVersion()); //$NON-NLS-1$ assertEquals("querybuilder", copy.getAppName()); //$NON-NLS-1$ }
@Test public void testClear() { SessionAwareCache<Cachable> cache = new SessionAwareCache<Cachable>("resultset", DefaultCacheFactory.INSTANCE, SessionAwareCache.Type.RESULTSET, 0); DQPWorkContext context = buildWorkContext(); CacheID id = new CacheID(context, new ParseInfo(), "SELECT * FROM FOO"); Cachable result = Mockito.mock(Cachable.class); Mockito.stub(result.prepare((BufferManager)anyObject())).toReturn(true); Mockito.stub(result.restore((BufferManager)anyObject())).toReturn(true); id = new CacheID(context, new ParseInfo(), "SELECT * FROM FOO"); cache.put(id, Determinism.VDB_DETERMINISTIC, result, null); id = new CacheID(context, new ParseInfo(), "SELECT * FROM FOO1"); cache.put(id, Determinism.VDB_DETERMINISTIC, result, null); assertEquals(2, cache.getTotalCacheEntries()); cache.clearForVDB(context.getVdbName(), context.getVdbVersion()); assertEquals(0, cache.getTotalCacheEntries()); }