Examples of NoSuchObjectException


Examples of org.apache.hadoop.hive.metastore.api.NoSuchObjectException

    ColumnStatistics statsObj;
    MPartitionColumnStatistics mStatsObj =
          getMPartitionColumnStatistics(dbName, tableName, partName, partVal, colName);

    if (mStatsObj == null) {
      throw new NoSuchObjectException("Statistics for dbName=" + dbName + " tableName=" + tableName
          + " partName= " + partName + " columnName=" + colName + " doesn't exist.");
    }
    statsObj = convertToPartColumnStatistics(mStatsObj);
    return statsObj;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.NoSuchObjectException

      openTransaction();
      MTable mTable = getMTable(dbName.trim(), tableName.trim());
      boolean foundCol = false;

      if (mTable == null) {
        throw new NoSuchObjectException("Table "  + tableName +
          " for which stats is requested doesn't exist.");
      }

      MPartition mPartition =
                  getMPartition(dbName, tableName, partVal);

      if (mPartition == null) {
        throw new
          NoSuchObjectException("Partition " + partName +
          " for which stats is requested doesn't exist");
      }

      MStorageDescriptor mSDS = mPartition.getSd();
      List<MFieldSchema> colList = mSDS.getCD().getCols();

      for(MFieldSchema mCol:colList) {
        if (mCol.getName().equals(colName.trim())) {
          foundCol = true;
          break;
        }
      }

      if (!foundCol) {
        throw new NoSuchObjectException("Column " + colName +
        " for which stats is requested doesn't exist.");
      }

      Query query = pm.newQuery(MPartitionColumnStatistics.class);
      query.setFilter("partition.partitionName == t1 && " +
View Full Code Here

Examples of org.apache.hadoop.hive.metastore.api.NoSuchObjectException

      MTable mTable = getMTable(dbName, tableName);
      MPartitionColumnStatistics mStatsObj;
      List<MPartitionColumnStatistics> mStatsObjColl;

      if (mTable == null) {
        throw new
          NoSuchObjectException("Table " + tableName +
          "  for which stats deletion is requested doesn't exist");
      }

      MPartition mPartition =
          getMPartition(dbName, tableName, partVals);

      if (mPartition == null) {
        throw new
          NoSuchObjectException("Partition " + partName +
          " for which stats deletion is requested doesn't exist");
      }

      Query query = pm.newQuery(MPartitionColumnStatistics.class);
      String filter;
      String parameters;

      if (colName != null) {
        filter = "partition.partitionName == t1 && dbName == t2 && tableName == t3 && " +
                    "colName == t4";
        parameters = "java.lang.String t1, java.lang.String t2, " +
                        "java.lang.String t3, java.lang.String t4";
      } else {
        filter = "partition.partitionName == t1 && dbName == t2 && tableName == t3";
        parameters = "java.lang.String t1, java.lang.String t2, java.lang.String t3";
      }

      query.setFilter(filter);
      query
        .declareParameters(parameters);

      if (colName != null) {
        query.setUnique(true);
        mStatsObj = (MPartitionColumnStatistics)query.executeWithArray(partName.trim(),
                                                dbName.trim(), tableName.trim(), colName.trim());
        pm.retrieve(mStatsObj);

        if (mStatsObj != null) {
          pm.deletePersistent(mStatsObj);
        } else {
          throw new NoSuchObjectException("Column stats doesn't exist for db=" +dbName + " table="
              + tableName + " partition=" + partName + " col=" + colName);
        }
      } else {
        mStatsObjColl= (List<MPartitionColumnStatistics>)query.execute(partName.trim(),
                                  dbName.trim(), tableName.trim());
        pm.retrieveAll(mStatsObjColl);

        if (mStatsObjColl != null) {
          pm.deletePersistentAll(mStatsObjColl);
        } else {
          throw new NoSuchObjectException("Column stats doesn't exist for db=" + dbName +
            " table=" + tableName + " partition" + partName);
        }
      }
      ret = commitTransaction();
    } catch(NoSuchObjectException e) {
View Full Code Here

Examples of org.apache.openejb.core.NoSuchObjectException

                    * call a business method on that bean within the same transaction.  After a bean is removed any
                    * subsequent invocations on that bean with the same transaction should throw a NoSuchEntityException.
                    * its likely that the application server would have already made the reference invalid, but this bit of
                    * code is an extra precaution.
                    */
                    throw new InvalidateReferenceException(new NoSuchObjectException("Entity not found: " + primaryKey));
                } else if (callContext.getCurrentOperation() == Operation.REMOVE) {
                    /*
                    *  To avoid calling ejbStore( ) on a bean that after its removed, we can not delegate
                    *  the wrapper is marked as disassociated from the transaction to avoid processing the
                    *  beforeCompletion( ) method on the SynchronizationWrapper object.
                    */
                    wrapper.disassociate();
                }

                if (wrapper.isAvailable() || wrapper.primaryKey.equals(primaryKey)) {
                    return wrapper.getEntityBean();
                } else {

                    // If the bean is declared as reentrant then the instance may be accessed
                    // by more then one thread at a time.  This is one of the reasons that reentrancy
                    // is bad. In this case beans must be programmed to be multi threaded. The other reason
                    // reentrancy is bad has to do with transaction isolation. Multiple instances writing to
                    // the same database records will inevitably cancel out previous writes within the same tx.
                    //
                    // In the future we may change this to return a new instance of the bean and to
                    // link it and its wrapper to the original wrapper, but for now we choose this strategy because
                    // its simpler to implement.
                    return wrapper.getEntityBean();
                }
            } else {
                /*
                * If no synchronized wrapper for the key exists
                * Then the bean entity is being access by this transaction for the first time,
                * so it needs to be enrolled in the transaction.
                */
                EntityBean bean = getPooledInstance(callContext);
                wrapper = new SynchronizationWrapper(callContext.getDeploymentInfo(), primaryKey, bean, false, key, txPolicy);

                if (callContext.getCurrentOperation() == Operation.REMOVE) {
                    /*
                    *  To avoid calling ejbStore( ) on a bean that after its removed, we can not delegate
                    *  the wrapper is marked as disassociated from the transaction to avoid processing the
                    *  beforeCompletion( ) method on the SynchronizationWrapper object.
                    *
                    *  We have to still use a wrapper so we can detect when a business method is called after
                    *  a ejbRemove() and act to prevent it from being processed.
                    */
                    wrapper.disassociate();
                }

                txPolicy.registerSynchronization(wrapper);

                loadingBean(bean, callContext);
                Operation orginalOperation = callContext.getCurrentOperation();
                callContext.setCurrentOperation(Operation.LOAD);
                try {
                    bean.ejbLoad();
                } catch (NoSuchEntityException e) {
                    wrapper.disassociate();
                    throw new InvalidateReferenceException(new NoSuchObjectException("Entity not found: " + primaryKey, e));
                } catch (Exception e) {
                    logger.error("Exception encountered during ejbLoad():", e);
                    //djencks not sure about this dissociate call
                    wrapper.disassociate();
                    throw new OpenEJBException(e);
View Full Code Here

Examples of org.apache.xbean.recipe.NoSuchObjectException

        if (referenceName == null) {
            throw new ConstructionException("Reference name has not been set");
        }
        ExecutionContext context = ExecutionContext.getContext();
        if (!context.containsObject(referenceName)) {
            throw new NoSuchObjectException(referenceName);
        }
        return context.getObject(referenceName);
    }
View Full Code Here

Examples of org.qi4j.api.object.NoSuchObjectException

        NullArgumentException.validateNotNull( "mixinType", mixinType );
        ModelModule<ObjectModel> model = findObjectModels( mixinType );

        if( model == null )
        {
            throw new NoSuchObjectException( mixinType.getName(), name() );
        }

        InjectionContext injectionContext = new InjectionContext( model.module(), UsesInstance.EMPTY_USES.use( uses ) );
        return mixinType.cast( model.model().newInstance( injectionContext ) );
    }
View Full Code Here

Examples of plugins.Freetalk.exceptions.NoSuchObjectException

    query.descend("mIdentity").constrain(identity).identity();
    final ObjectSet<IdentityStatistics> result = new Persistent.InitializingObjectSet<IdentityStatistics>(mFreetalk, query);
   
    switch(result.size()) {
      case 1: return result.next();
      case 0: throw new NoSuchObjectException();
      default: throw new DuplicateElementException("Duplicate IdentityStatistics for " + identity);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.