当前位置: 首页>>代码示例>>Java>>正文


Java EvaluationTrace.setOutcome方法代码示例

本文整理汇总了Java中org.javarosa.core.model.trace.EvaluationTrace.setOutcome方法的典型用法代码示例。如果您正苦于以下问题:Java EvaluationTrace.setOutcome方法的具体用法?Java EvaluationTrace.setOutcome怎么用?Java EvaluationTrace.setOutcome使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javarosa.core.model.trace.EvaluationTrace的用法示例。


在下文中一共展示了EvaluationTrace.setOutcome方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadProfileMatches

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
@Override
public List<Integer> loadProfileMatches(IndexedValueLookup querySet, QueryContext context) {
    String indexName = querySet.getKey().substring(Case.INDEX_CASE_INDEX_PRE.length());
    String value = (String)querySet.value;

    Cache cache = context.getQueryCache(Cache.class);
    if(!cache.currentlyFetchedIndexKeys.contains(indexName)) {
        if(context.getScope() < BULK_LOAD_THRESHOLD) {
            return null;
        }

        EvaluationTrace trace = new EvaluationTrace("Index Bulk Prefetch [" + indexName + "]");
        int indexFetchSize = mCaseIndexTable.loadIntoIndexTable(cache.indexCache, indexName);
        trace.setOutcome("Loaded: " + indexFetchSize);
        context.reportTrace(trace);
        cache.currentlyFetchedIndexKeys.add(indexName);
    }
    String cacheKey = indexName + "|" + value;
    return cache.indexCache.get(cacheKey);
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:21,代码来源:CaseIndexPrefetchHandler.java

示例2: loadModelQuerySet

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
@Override
protected ModelQuerySet loadModelQuerySet(QueryContext queryContext) {
    EvaluationTrace trace = new EvaluationTrace("Load Query Set Transform[" +
            getRootLookup().getCurrentQuerySetId() + "]=>[" +
            this.getCurrentQuerySetId()+ "]");


    Set<Integer> querySetBody = getRootLookup().getLookupSetBody(queryContext);
    DualTableSingleMatchModelQuerySet ret = table.bulkReadIndexToCaseIdMatch(indexName, querySetBody);
    cacheCaseModelQuerySet(queryContext, ret);

    trace.setOutcome("Loaded: " + ret.getSetBody().size());

    queryContext.reportTrace(trace);
    return ret;
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:17,代码来源:CaseIndexQuerySetTransform.java

示例3: loadProfileMatches

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
@Override
public List<Integer> loadProfileMatches(ModelQueryLookup getLookupKey, QueryContext queryContext) {
    QuerySetLookup lookup = getLookupKey.getSetLookup();

    EvaluationTrace trace = new EvaluationTrace("QuerySetLookup|" + lookup.getCurrentQuerySetId());

    List<Integer> lookupData = lookup.
            performSetLookup(getLookupKey.getRootLookupRef(), queryContext);

    if (lookupData != null) {
        trace.setOutcome("Results: " +lookupData.size());
        queryContext.reportTrace(trace);
    }

    return lookupData;
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:17,代码来源:ModelQueryLookupHandler.java

示例4: populateMetaDataCacheAndReadForRecord

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
private String[] populateMetaDataCacheAndReadForRecord(RecordSetResultCache recordSetCache,
                                                       String recordSetKey,
                                                       RecordObjectCache<String[]> recordObjectCache,
                                                       String recordObjectKey,
                                                       String[] metaFields,
                                                       QueryContext context) {
    Pair<String, LinkedHashSet<Integer>> tranche =
            recordSetCache.getRecordSetForRecordId(recordSetKey, recordId);

    EvaluationTrace loadTrace =
            new EvaluationTrace(String.format("Model [%s]: Limited Scope Partial Bulk Load [%s}",
                    recordObjectKey,tranche.first));

    LinkedHashSet<Integer>  body = tranche.second;
    parent.getStorage().bulkReadMetadata(body, metaFields, recordObjectCache.getLoadedCaseMap(recordObjectKey));
    loadTrace.setOutcome("Loaded: " + body.size());

    context.reportTrace(loadTrace);

    return recordObjectCache.getLoadedRecordObject(recordObjectKey, recordId);
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:22,代码来源:IndexedFixtureChildElement.java

示例5: getElement

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
protected Model getElement(int recordId, QueryContext context) {
    if (context == null || getStorageCacheName() == null) {
        return getElementSingular(recordId, context);
    }
    RecordSetResultCache recordSetCache = context.getQueryCacheOrNull(RecordSetResultCache.class);

    String storageCacheKey = getStorageCacheName();

    RecordObjectCache<Model> recordObjectCache = getRecordObjectCacheIfRelevant(context);

    if(recordObjectCache != null) {
        if (recordObjectCache.isLoaded(storageCacheKey, recordId)) {
            return recordObjectCache.getLoadedRecordObject(storageCacheKey, recordId);
        }

        if (canLoadRecordFromGroup(recordSetCache, getStorageCacheName(), recordId)) {
            Pair<String, LinkedHashSet<Integer>> tranche =
                    recordSetCache.getRecordSetForRecordId(storageCacheKey, recordId);
            EvaluationTrace loadTrace =
                    new EvaluationTrace(String.format("Model [%s]: Bulk Load [%s}",
                            this.getStorageCacheName(),tranche.first));

            LinkedHashSet<Integer>  body = tranche.second;
            storage.bulkRead(body, recordObjectCache.getLoadedCaseMap(storageCacheKey));
            loadTrace.setOutcome("Loaded: " + body.size());
            context.reportTrace(loadTrace);

            return recordObjectCache.getLoadedRecordObject(storageCacheKey, recordId);
        }
    }

    return getElementSingular(recordId, context);
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:34,代码来源:StorageInstanceTreeElement.java

示例6: getElementSingular

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
/**
 * Retrieves a model for the provided record ID using a guaranteed singular lookup from
 * storage. This is the "Safe" fallback behavior for lookups.
 */
protected Model getElementSingular(int recordId, QueryContext context) {
    EvaluationTrace trace = new EvaluationTrace(String.format("Model [%s]: Singular Load", getStorageCacheName()));

    Model m = storage.read(recordId);

    trace.setOutcome(String.valueOf(recordId));
    if(context!= null) {
        context.reportTrace(trace);
    }
    return m;
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:16,代码来源:StorageInstanceTreeElement.java

示例7: reportContextEscalation

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
private void reportContextEscalation(QueryContext newContext, String label) {
    EvaluationTrace trace = new EvaluationTrace(label + " Query Context [" + newContext.contextScope +"]");
    trace.setOutcome("");
    reportTrace(trace);
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:6,代码来源:QueryContext.java

示例8: getNextIndexMatch

import org.javarosa.core.model.trace.EvaluationTrace; //导入方法依赖的package包/类
/**
 * Attempt to process one or more of the elements from the heads of the key/value vector, and return the
 * matching ID's. If an argument is processed, they should be removed from the key/value vector
 *
 * <b>Important:</b> This method and any re-implementations <i>must remove at least one key/value pair
 * from the incoming Vectors</i>, or must throw an IllegalArgumentException to denote that the provided
 * key can't be processed in the current context. The method can optionally remove/process more than one
 * key at a time, but is expected to process at least the first.
 *
 * @param profiles    A vector of pending optimizations to be attempted. The keys should be processed left->right
 * @param storage The storage to be processed
 * @param currentQueryContext
 * @return A Vector of integer ID's for records in the provided storage which match one or more of the keys provided.
 * @throws IllegalArgumentException If there was no index matching possible on the provided key and the key/value vectors
 *                                  won't be shortened.
 */
protected Collection<Integer> getNextIndexMatch(Vector<PredicateProfile> profiles,
                                                IStorageUtilityIndexed<?> storage,
                                                QueryContext currentQueryContext) throws IllegalArgumentException {
    int numKeysToProcess = this.getNumberOfBatchableKeysInProfileSet(profiles);

    if(numKeysToProcess == -1) {
        throw new IllegalArgumentException("No optimization path found for optimization type");
    }


    String[] namesToMatch = new String[numKeysToProcess];
    String[] valuesToMatch = new String[numKeysToProcess];

    String cacheKey = "";
    String keyDescription ="";

    for (int i = numKeysToProcess - 1; i >= 0; i--) {
        namesToMatch[i] = profiles.elementAt(i).getKey();
        valuesToMatch[i] = (String)
                (((IndexedValueLookup)profiles.elementAt(i)).value);

        cacheKey += "|" + namesToMatch[i] + "=" + valuesToMatch[i];
        keyDescription += namesToMatch[i] + "|";
    }
    mMostRecentBatchFetch = new String[2][];
    mMostRecentBatchFetch[0] = namesToMatch;
    mMostRecentBatchFetch[1] = valuesToMatch;

    String storageTreeName = this.getStorageCacheName();

    LinkedHashSet<Integer> ids;
    if(mIndexResultCache.containsKey(cacheKey)) {
        ids = mIndexResultCache.get(cacheKey);
    } else {
        EvaluationTrace trace = new EvaluationTrace(String.format("Storage [%s] Key Lookup [%s]", storageTreeName, keyDescription));
        ids = new LinkedHashSet<>();
        storage.getIDsForValues(namesToMatch, valuesToMatch, ids);
        trace.setOutcome("Results: " + ids.size());
        currentQueryContext.reportTrace(trace);

        mIndexResultCache.put(cacheKey, ids);
    }

    if(ids.size() > 50 && ids.size() < PerformanceTuningUtil.getMaxPrefetchCaseBlock()) {
        RecordSetResultCache cue = currentQueryContext.getQueryCache(RecordSetResultCache.class);
        cue.reportBulkRecordSet(cacheKey, getStorageCacheName(), ids);
    }

    //Ok, we matched! Remove all of the keys that we matched
    for (int i = 0; i < numKeysToProcess; ++i) {
        profiles.removeElementAt(0);
    }
    return ids;
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:71,代码来源:StorageBackedTreeRoot.java


注:本文中的org.javarosa.core.model.trace.EvaluationTrace.setOutcome方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。