org.datanucleus.ExecutionContext.getStatistics()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.datanucleus.ExecutionContext.getStatistics()方法的一些代码示例,展示了ExecutionContext.getStatistics()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.getStatistics()方法的具体详情如下:
包路径:org.datanucleus.ExecutionContext
类名称:ExecutionContext
方法名:getStatistics

ExecutionContext.getStatistics介绍

暂无

代码示例

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

if (ec.getStatistics() != null)
  ec.getStatistics().queryBegin();
  if (ec.getStatistics() != null)
      ec.getStatistics().queryExecutedWithError();
      ec.getStatistics().queryExecuted(System.currentTimeMillis()-start);

代码示例来源:origin: org.datanucleus/datanucleus-json

int code = http.getResponseCode();
if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumReads();

代码示例来源:origin: org.datanucleus/datanucleus-hbase

public static Delete getDeleteForObject(ObjectProvider op, Table schemaTable) throws IOException
{
  byte[] rowKey = (byte[]) op.getAssociatedValue("HBASE_ROW_KEY");
  if (rowKey == null)
  {
    AbstractClassMetaData cmd = op.getClassMetaData();
    final Object[] pkValues = findKeyObjects(op, cmd, schemaTable);
    ExecutionContext ec = op.getExecutionContext();
    if (ec.getStatistics() != null)
    {
      // Add to statistics
      ec.getStatistics().incrementNumReads();
    }
    rowKey = getRowKeyForPkValue(pkValues, ec.getNucleusContext());
  }
  return new Delete(rowKey);
}

代码示例来源:origin: org.datanucleus/datanucleus-hbase

public static Put getPutForObject(ObjectProvider op, Table schemaTable) throws IOException
{
  byte[] rowKey = (byte[]) op.getAssociatedValue("HBASE_ROW_KEY");
  if (rowKey == null)
  {
    AbstractClassMetaData cmd = op.getClassMetaData();
    final Object[] pkValues = findKeyObjects(op, cmd, schemaTable);
    ExecutionContext ec = op.getExecutionContext();
    if (ec.getStatistics() != null)
    {
      // Add to statistics
      ec.getStatistics().incrementNumReads();
    }
    rowKey = getRowKeyForPkValue(pkValues, ec.getNucleusContext());
  }
  return new Put(rowKey);
}

代码示例来源:origin: org.datanucleus/datanucleus-hbase

public static Get getGetForObject(ObjectProvider op, Table schemaTable) throws IOException
{
  byte[] rowKey = (byte[]) op.getAssociatedValue("HBASE_ROW_KEY");
  if (rowKey == null)
  {
    AbstractClassMetaData cmd = op.getClassMetaData();
    final Object[] pkValues = findKeyObjects(op, cmd, schemaTable);
    ExecutionContext ec = op.getExecutionContext();
    if (ec.getStatistics() != null)
    {
      // Add to statistics
      ec.getStatistics().incrementNumReads();
    }
    rowKey = getRowKeyForPkValue(pkValues, ec.getNucleusContext());
  }
  return new Get(rowKey);
}

代码示例来源:origin: org.datanucleus/datanucleus-mongodb

public static List<Long> performMongoCount(DB db, BasicDBObject filterObject, Class candidateClass, boolean subclasses, ExecutionContext ec)
throws MongoException 
{
  StoreManager storeMgr = ec.getStoreManager();
  long count = 0;
  for (AbstractClassMetaData cmd : MetaDataUtils.getMetaDataForCandidates(candidateClass, subclasses, ec)) 
  {
    Table table = storeMgr.getStoreDataForClass(cmd.getFullClassName()).getTable();
    String collectionName = table.getName();
    count += db.getCollection(collectionName).count(filterObject);
  }
  List<Long> results = new LinkedList<>();
  results.add(count);
  if (ec.getStatistics() != null)
  {
    // Add to statistics
    ec.getStatistics().incrementNumReads();
  }
  return results;
}

代码示例来源:origin: org.datanucleus/datanucleus-json

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumWrites();
  ec.getStatistics().incrementDeleteCount();

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

/**
 * Deletes a persistent object from the database.
 * The delete can take place in several steps, one delete per table that it is stored in.
 * e.g When deleting an object that uses "new-table" inheritance for each level of the inheritance tree
 * then will get an DELETE for each table. When deleting an object that uses "complete-table"
 * inheritance then will get a single DELETE for its table.
 * @param op The ObjectProvider of the object to be deleted.
 * @throws NucleusDataStoreException when an error occurs in the datastore communication
 */
public void deleteObject(ObjectProvider op)
{
  // Check if read-only so update not permitted
  assertReadOnlyForUpdateOfObject(op);
  ExecutionContext ec = op.getExecutionContext();
  if (ec.getStatistics() != null)
  {
    ec.getStatistics().incrementDeleteCount();
  }
  ClassLoaderResolver clr = op.getExecutionContext().getClassLoaderResolver();
  DatastoreClass dc = getDatastoreClass(op.getClassMetaData().getFullClassName(), clr);
  deleteObjectFromTable(dc, op, clr);
}

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

if (ec.getStatistics() != null)
  ec.getStatistics().incrementUpdateCount();

代码示例来源:origin: org.datanucleus/datanucleus-xml

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumWrites();
  ec.getStatistics().incrementDeleteCount();

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

if (ec != null && ec.getStatistics() != null)
  ec.getStatistics().incrementNumWrites();

代码示例来源:origin: org.datanucleus/datanucleus-xml

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumReads();
  ec.getStatistics().incrementFetchCount();

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

if (ec != null && ec.getStatistics() != null)
  ec.getStatistics().incrementNumWrites();

代码示例来源:origin: org.datanucleus/datanucleus-neodatis

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumReads();

代码示例来源:origin: org.datanucleus/datanucleus-ldap

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumReads();

代码示例来源:origin: org.datanucleus/datanucleus-odf

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumReads();

代码示例来源:origin: org.datanucleus/datanucleus-neo4j

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumWrites();
  ec.getStatistics().incrementInsertCount();

代码示例来源:origin: org.datanucleus/datanucleus-neo4j

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumWrites();
  ec.getStatistics().incrementInsertCount();

代码示例来源:origin: org.datanucleus/datanucleus-excel

if (ec.getStatistics() != null)
  ec.getStatistics().incrementNumReads();

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

if (ec.getStatistics() != null)
  ec.getStatistics().incrementInsertCount();

相关文章