Package org.teiid.core

Examples of org.teiid.core.TeiidComponentException


  public void readFully(long fileOffset, byte[] b, int offSet, int length) throws TeiidComponentException {
        int n = 0;
      do {
          int count = this.read(fileOffset + n, b, offSet + n, length - n);
          if (count < 0) {
            throw new TeiidComponentException("not enough bytes available"); //$NON-NLS-1$
          }
          n += count;
      } while (n < length);
  }
View Full Code Here


    write(bytes, 0, bytes.length);
  }

  public synchronized long write(byte[] bytes, int offset, int length) throws TeiidComponentException {
    if (removed) {
      throw new TeiidComponentException("already removed"); //$NON-NLS-1$
    }
    writeDirect(bytes, offset, length);
    long result = len;
    len += length;   
    return result;
View Full Code Here

  }
 
    public Streamable<?> getLobReference(String id) throws TeiidComponentException {
      Streamable<?> lob = this.lobReferences.get(id);
      if (lob == null) {
        throw new TeiidComponentException(QueryPlugin.Util.getString("ProcessWorker.wrongdata")); //$NON-NLS-1$
      }
      return lob;
    }
View Full Code Here

      };
      InputStream is = isf.getInputStream();
      OutputStream fsos = store.createOutputStream();
      length = ObjectConverterUtil.write(fsos, is, bytes, -1);
    } catch (IOException e) {
      throw new TeiidComponentException(e);
    }
   
    // re-construct the new lobs based on the file store
    final long lobOffset = offset;
    final int lobLength = length;
    InputStreamFactory isf = new InputStreamFactory() {
      @Override
      public InputStream getInputStream() throws IOException {
        return store.createInputStream(lobOffset, lobLength);
      }
     
      @Override
      public boolean isPersistent() {
        return true;
      }
    };     
   
    try {
      if (lob instanceof BlobType) {
        persistedLob = new BlobType(new BlobImpl(isf));
      }
      else if (lob instanceof ClobType) {
        persistedLob = new ClobType(new ClobImpl(isf, ((ClobType)lob).length()));
      }
      else {
        persistedLob = new XMLType(new SQLXMLImpl(isf));
        ((XMLType)persistedLob).setEncoding(((XMLType)lob).getEncoding());
        ((XMLType)persistedLob).setType(((XMLType)lob).getType());
      }
    } catch (SQLException e) {
      throw new TeiidComponentException(e);
    }   
    return persistedLob;   
  }
View Full Code Here

        VDBMetaData vdbMetadata = workContext.getVDB();
        metadata = vdbMetadata.getAttachment(QueryMetadataInterface.class);
        globalTables = vdbMetadata.getAttachment(TempTableStore.class);

        if (metadata == null) {
            throw new TeiidComponentException(QueryPlugin.Util.getString("DQPCore.Unable_to_load_metadata_for_VDB_name__{0},_version__{1}", this.vdbName, this.vdbVersion)); //$NON-NLS-1$
        }
       
        // Check for multi-source models and further wrap the metadata interface
        Set<String> multiSourceModelList = workContext.getVDB().getMultiSourceModelNames();
        if(multiSourceModelList != null && multiSourceModelList.size() > 0) {
View Full Code Here

           
            if (startAutoWrapTxn) {
                try {
                    tc = transactionService.begin(tc);
                } catch (XATransactionException err) {
                    throw new TeiidComponentException(err);
                }
            }
        }
       
        this.transactionContext = tc;
View Full Code Here

          VDBMetaData vdb = workItem.getDqpWorkContext().getVDB();
          ModelMetaData model = vdb.getModel(modelName);
          List<String> bindings = model.getSourceNames();
          if (bindings == null || bindings.size() != 1) {
              // this should not happen, but it did occur when setting up the SystemAdmin models
              throw new TeiidComponentException(QueryPlugin.Util.getString("DataTierManager.could_not_obtain_connector_binding", new Object[]{modelName, workItem.getDqpWorkContext().getVdbName(), workItem.getDqpWorkContext().getVdbVersion() })); //$NON-NLS-1$
          }
          connectorBindingId = bindings.get(0);
          Assertion.isNotNull(connectorBindingId, "could not obtain connector id"); //$NON-NLS-1$
        }
        aqr.setConnectorName(connectorBindingId);
View Full Code Here

                symbol = ((AliasSymbol)symbol).getSymbol();
            }
            try {
                columnMetadata[i] = createColumnMetadata(shortColumnName, symbol);
            } catch(QueryMetadataException e) {
                throw new TeiidComponentException(e);
            }
        }
        return columnMetadata;
    }
View Full Code Here

     } else if (expression instanceof QueryString) {
       return evaluateQueryString(tuple, (QueryString)expression);
     } else if (expression instanceof XMLParse){
       return evaluateXMLParse(tuple, (XMLParse)expression);
     } else {
         throw new TeiidComponentException("ERR.015.006.0016", QueryPlugin.Util.getString("ERR.015.006.0016", expression.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$
     }
  }
View Full Code Here

          values[i+start] = internalEvaluate(args[i], tuple);
      }           
     
      // Check for function we can't evaluate
      if(fd.getPushdown() == PushDown.MUST_PUSHDOWN) {
          throw new TeiidComponentException(QueryPlugin.Util.getString("ExpressionEvaluator.Must_push", fd.getName())); //$NON-NLS-1$
      }
 
      // Check for special lookup function
      if(fd.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP)) {
          if(dataMgr == null) {
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.