Package org.teiid.core

Examples of org.teiid.core.TeiidComponentException


    csr.registerClientService(ILogon.class, new ILogon() {

        public ResultsFuture<?> logoff()
            throws InvalidSessionException {
          ResultsFuture<?> result = new ResultsFuture<Void>();
          result.getResultsReceiver().exceptionOccurred(new TeiidComponentException("some exception")); //$NON-NLS-1$
          return result;
        }

        public LogonResult logon(Properties connectionProperties)
            throws LogonException, TeiidComponentException {
View Full Code Here


          translator.translate(writer);
          writer.close();
          success = true;
          return new SQLXMLImpl(fsisf);
      } catch(IOException e) {
          throw new TeiidComponentException(e);
      } catch(TransformerException e) {
          throw new TeiidProcessingException(e);
      } finally {
        if (!success && lobBuffer != null) {
          lobBuffer.remove();
View Full Code Here

                            } else {
                              pinode.setMode(org.teiid.query.processor.relational.ProjectIntoNode.Mode.SINGLE);
                            }
                        }
                    } catch(QueryMetadataException e) {
                        throw new TeiidComponentException(e);
                    }

                } else {
                    List symbols = (List) node.getProperty(NodeConstants.Info.PROJECT_COLS);
                   
                    ProjectNode pnode = new ProjectNode(getID());
                    pnode.setSelectSymbols(symbols);
                processNode = pnode;
                }
                break;

      case NodeConstants.Types.JOIN:
                JoinType jtype = (JoinType) node.getProperty(NodeConstants.Info.JOIN_TYPE);
                JoinStrategyType stype = (JoinStrategyType) node.getProperty(NodeConstants.Info.JOIN_STRATEGY);

                JoinNode jnode = new JoinNode(getID());
                jnode.setJoinType(jtype);
                jnode.setLeftDistinct(node.hasBooleanProperty(NodeConstants.Info.IS_LEFT_DISTINCT));
                jnode.setRightDistinct(node.hasBooleanProperty(NodeConstants.Info.IS_RIGHT_DISTINCT));
                List joinCrits = (List) node.getProperty(NodeConstants.Info.JOIN_CRITERIA);
                String depValueSource = (String) node.getProperty(NodeConstants.Info.DEPENDENT_VALUE_SOURCE);
                SortOption leftSort = (SortOption)node.getProperty(NodeConstants.Info.SORT_LEFT);
                if(stype == JoinStrategyType.MERGE || stype == JoinStrategyType.ENHANCED_SORT) {
                  MergeJoinStrategy mjStrategy = null;
                  if (stype.equals(JoinStrategyType.ENHANCED_SORT)) {
                    mjStrategy = new EnhancedSortMergeJoinStrategy(leftSort, (SortOption)node.getProperty(NodeConstants.Info.SORT_RIGHT));
                  } else {
                    mjStrategy = new MergeJoinStrategy(leftSort, (SortOption)node.getProperty(NodeConstants.Info.SORT_RIGHT), false);
                  }
                    jnode.setJoinStrategy(mjStrategy);
                    List leftExpressions = (List) node.getProperty(NodeConstants.Info.LEFT_EXPRESSIONS);
                    List rightExpressions = (List) node.getProperty(NodeConstants.Info.RIGHT_EXPRESSIONS);
                    jnode.setJoinExpressions(leftExpressions, rightExpressions);
                    joinCrits = (List) node.getProperty(NodeConstants.Info.NON_EQUI_JOIN_CRITERIA);
                } else if (stype == JoinStrategyType.NESTED_TABLE) {
                  NestedTableJoinStrategy ntjStrategy = new NestedTableJoinStrategy();
                  jnode.setJoinStrategy(ntjStrategy);
                  SymbolMap references = (SymbolMap)FrameUtil.findJoinSourceNode(node.getFirstChild()).getProperty(NodeConstants.Info.CORRELATED_REFERENCES);
                ntjStrategy.setLeftMap(references);
                  references = (SymbolMap)FrameUtil.findJoinSourceNode(node.getLastChild()).getProperty(NodeConstants.Info.CORRELATED_REFERENCES);
                ntjStrategy.setRightMap(references);
                } else {
                    NestedLoopJoinStrategy nljStrategy = new NestedLoopJoinStrategy();
                    jnode.setJoinStrategy(nljStrategy);
                }
                Criteria joinCrit = Criteria.combineCriteria(joinCrits);
                jnode.setJoinCriteria(joinCrit);
                              
                processNode = jnode;
               
                jnode.setDependentValueSource(depValueSource);
               
        break;

      case NodeConstants.Types.ACCESS:
                ProcessorPlan plan = (ProcessorPlan) node.getProperty(NodeConstants.Info.PROCESSOR_PLAN);
                if(plan != null) {
                   
                    PlanExecutionNode peNode = null;
                   
                    Criteria crit = (Criteria)node.getProperty(NodeConstants.Info.PROCEDURE_CRITERIA);
                   
                    if (crit != null) {
                        List references = (List)node.getProperty(NodeConstants.Info.PROCEDURE_INPUTS);
                        List defaults = (List)node.getProperty(NodeConstants.Info.PROCEDURE_DEFAULTS);
                       
                        peNode = new DependentProcedureExecutionNode(getID(), crit, references, defaults);                       
                    } else {
                        peNode = new PlanExecutionNode(getID());
                    }
                   
                    peNode.setProcessorPlan(plan);
                    processNode = peNode;

                } else {
                    AccessNode aNode = null;
                    Command command = (Command) node.getProperty(NodeConstants.Info.ATOMIC_REQUEST);
                    Object modelID = node.getProperty(NodeConstants.Info.MODEL_ID);
                   
                    if(node.hasBooleanProperty(NodeConstants.Info.IS_DEPENDENT_SET)) {
                        if (command instanceof StoredProcedure) {
                            List references = (List)node.getProperty(NodeConstants.Info.PROCEDURE_INPUTS);
                            List defaults = (List)node.getProperty(NodeConstants.Info.PROCEDURE_DEFAULTS);
                            Criteria crit = (Criteria)node.getProperty(NodeConstants.Info.PROCEDURE_CRITERIA);
                           
                            DependentProcedureAccessNode depAccessNode = new DependentProcedureAccessNode(getID(), crit, references, defaults);
                            processNode = depAccessNode;
                            aNode = depAccessNode;
                        } else {
                            //create dependent access node
                            DependentAccessNode depAccessNode = new DependentAccessNode(getID());
                           
                            if(modelID != null){
                                depAccessNode.setMaxSetSize(CapabilitiesUtil.getMaxInCriteriaSize(modelID, metadata, capFinder));
                                depAccessNode.setMaxPredicates(CapabilitiesUtil.getMaxDependentPredicates(modelID, metadata, capFinder));  
                            }
                            processNode = depAccessNode;
                            aNode = depAccessNode;
                        }
                        aNode.setShouldEvaluateExpressions(true);
                    } else {
                       
                        // create access node
                        aNode = new AccessNode(getID());
                        processNode = aNode;
                                               
                        //-- special handling for temp tables. currently they cannot perform projection
                        try {
                            if (command instanceof Query) {
                                processNode = correctProjectionInternalTables(node, aNode);
                            }
                        } catch (QueryMetadataException err) {
                            throw new TeiidComponentException(err);
                        }
                        aNode.setShouldEvaluateExpressions(EvaluatableVisitor.needsProcessingEvaluation(command));
                    }
                   
                    if (command instanceof QueryCommand) {
                      try {
                          command = (Command)command.clone();
                          boolean aliasGroups = modelID != null && CapabilitiesUtil.supportsGroupAliases(modelID, metadata, capFinder);
                          boolean aliasColumns = modelID != null && CapabilitiesUtil.supports(Capability.QUERY_SELECT_EXPRESSION, modelID, metadata, capFinder);
                          command.acceptVisitor(new AliasGenerator(aliasGroups, !aliasColumns));
                      } catch (QueryMetadataException err) {
                          throw new TeiidComponentException(err);
                      }
                    }
                    aNode.setCommand(command);
                    aNode.setModelName(getRoutingName(node));
                }
View Full Code Here

      if (this.parentContext != null) {
        return this.parentContext.getGlobalValue(variable);
      }
      Object value = variableMap.get(variable);
      if (value == null && !variableMap.containsKey(variable)) {
        throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", variable, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      }
      return value;
    }
View Full Code Here

        try {
          RandomAccessFile fileAccess = fileInfo.open();
              fileAccess.seek(fileOffset - entry.getKey());
              return fileAccess.read(b, offSet, length);
        } catch (IOException e) {
          throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
        } finally {
          fileInfo.close();
        }
      }
      }
View Full Code Here

       */
    public void writeDirect(byte[] bytes, int offset, int length) throws TeiidComponentException {
      long used = usedBufferSpace.addAndGet(length);
      if (used > maxBufferSpace) {
        usedBufferSpace.addAndGet(-length);
        throw new TeiidComponentException(QueryPlugin.Util.getString("FileStoreageManager.space_exhausted", maxBufferSpace)); //$NON-NLS-1$
      }
      Map.Entry<Long, FileInfo> entry = this.storageFiles.lastEntry();
      boolean createNew = false;
      FileInfo fileInfo = null;
      long fileOffset = 0;
      if (entry == null) {
        createNew = true;
      } else {
        fileInfo = entry.getValue();
        fileOffset = entry.getKey();
        createNew = entry.getValue().file.length() + length > getMaxFileSize();
      }
      if (createNew) {
        FileInfo newFileInfo = new FileInfo(createFile(name, storageFiles.size()));
              if (fileInfo != null) {
                fileOffset += fileInfo.file.length();
              }
              storageFiles.put(fileOffset, newFileInfo);
              fileInfo = newFileInfo;
          }
      synchronized (fileInfo) {
            try {
              RandomAccessFile fileAccess = fileInfo.open();
                long pointer = fileAccess.length();
                fileAccess.setLength(pointer + length);
                fileAccess.seek(pointer);
                fileAccess.write(bytes, offset, length);
            } catch(IOException e) {
                throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", fileInfo.file.getAbsoluteFile())); //$NON-NLS-1$
            } finally {
              fileInfo.close();
            }
      }
    }
View Full Code Here

          return false;
        }
        try {
          wait();
        } catch (InterruptedException e) {
          throw new TeiidComponentException(e);
        }
        continue;
      case LOADED:
        if (ttl >= 0 && System.currentTimeMillis() - updateTime - ttl > 0) {
          setState(MatState.LOADING);
View Full Code Here

        throws TeiidComponentException {
        try {
            ResolverUtil.resolveGroup(group, metadata);
            return group;
        } catch (QueryResolverException e) {
            throw new TeiidComponentException(e);
        }
    }
View Full Code Here

                this.activeBatch = batch;
                addToCache(true);
              }
          return batch;
            } catch(IOException e) {
              throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", batchManager.id)); //$NON-NLS-1$
            } catch (ClassNotFoundException e) {
              throw new TeiidComponentException(e, QueryPlugin.Util.getString("FileStoreageManager.error_reading", batchManager.id)); //$NON-NLS-1$
            } finally {
              this.batchManager.compactionLock.readLock().unlock();
            }
      }
    }
View Full Code Here

          } else {
            this.batchReference = new WeakReference<TupleBatch>(batch);
          }
        }
      } catch (IOException e) {
        throw new TeiidComponentException(e);
      } catch (Throwable e) {
        throw new TeiidComponentException(e);
      } finally {
        persistent = true;
        activeBatch = null;
        if (lockheld) {
          this.batchManager.compactionLock.writeLock().unlock();
View Full Code Here

TOP

Related Classes of org.teiid.core.TeiidComponentException

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.