本文整理汇总了Java中org.voltdb.catalog.PlanFragment.fullName方法的典型用法代码示例。如果您正苦于以下问题:Java PlanFragment.fullName方法的具体用法?Java PlanFragment.fullName怎么用?Java PlanFragment.fullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.voltdb.catalog.PlanFragment
的用法示例。
在下文中一共展示了PlanFragment.fullName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTablePartitions
import org.voltdb.catalog.PlanFragment; //导入方法依赖的package包/类
/**
* Return all of the partitions per table for the given Statement object
*
* @param catalog_stmt
* @param params
* @param base_partition
* @return
* @throws Exception
*/
public Map<String, PartitionSet> getTablePartitions(final Statement catalog_stmt,
final Object params[],
final int base_partition) throws Exception {
Map<String, PartitionSet> all_partitions = new HashMap<String, PartitionSet>();
CatalogMap<PlanFragment> fragments = (catalog_stmt.getHas_singlesited() ? catalog_stmt.getFragments() : catalog_stmt.getMs_fragments());
for (PlanFragment catalog_frag : fragments) {
try {
Map<String, PartitionSet> frag_partitions = new HashMap<String, PartitionSet>();
this.calculatePartitionsForFragment(frag_partitions, null, catalog_frag, params, base_partition);
for (String table_key : frag_partitions.keySet()) {
if (!all_partitions.containsKey(table_key)) {
all_partitions.put(table_key, frag_partitions.get(table_key));
} else {
all_partitions.get(table_key).addAll(frag_partitions.get(table_key));
}
} // FOR
} catch (Throwable ex) {
throw new Exception("Failed to calculate table partitions for " + catalog_frag.fullName(), ex);
}
} // FOR
return (all_partitions);
}
示例2: getStatementEstimationParameters
import org.voltdb.catalog.PlanFragment; //导入方法依赖的package包/类
/**
* Return the set of StmtParameter offsets that can be used to figure out
* what partitions the Statement invocation will touch. This is used to
* quickly figure out whether that invocation is single-partition or not. If
* this Statement will always be multi-partition, or if the tables it
* references uses a MultiColumn partitioning attribute, then the return
* set will be null. This is at a coarse-grained level. You still need to
* use the other PartitionEstimator methods to figure out where to send
* PlanFragments.
*
* @param catalog_stmt
* @return
*/
public int[] getStatementEstimationParameters(final Statement catalog_stmt) {
if (debug.val)
LOG.debug("Retrieving estimation parameter offsets for " + catalog_stmt.fullName());
int[] all_param_idxs = this.cache_stmtPartitionParameters.get(catalog_stmt);
if (all_param_idxs == null) {
List<Integer> param_idxs = new ArrayList<Integer>();
// Assume single-partition
if (catalog_stmt.getHas_singlesited() == false) {
if (debug.val)
LOG.warn("There is no single-partition query plan for " + catalog_stmt.fullName());
return (null);
}
for (PlanFragment catalog_frag : catalog_stmt.getFragments().values()) {
PartitionEstimator.CacheEntry cache_entry = null;
try {
cache_entry = this.getFragmentCacheEntry(catalog_frag);
} catch (Exception ex) {
throw new RuntimeException("Failed to retrieve CacheEntry for " + catalog_frag.fullName());
}
// If this PlanFragment has a broadcast, then this statment
// can't be used for fast look-ups
if (cache_entry.hasBroadcast()) {
if (debug.val)
LOG.warn(String.format("%s contains an operation that must be broadcast." +
"Cannot be used for fast look-ups", catalog_frag.fullName()));
return (null);
}
for (Table catalog_tbl : cache_entry.getTables()) {
if (catalog_tbl.getMaterializer() != null) {
catalog_tbl = catalog_tbl.getMaterializer();
}
Column partition_col = catalog_tbl.getPartitioncolumn();
if (partition_col instanceof MultiColumn) {
if (debug.val)
LOG.warn(String.format("%s references %s, which is partitioned on %s. " +
"Cannot be used for fast look-ups",
catalog_frag.fullName(), catalog_tbl.getName(), partition_col.fullName()));
return (null);
}
else if (partition_col != null && cache_entry.predicates.containsKey(partition_col)) {
for (Pair<ExpressionType, CatalogType> pair : cache_entry.predicates.get(partition_col)) {
if (pair.getFirst() == ExpressionType.COMPARE_EQUAL &&
pair.getSecond() instanceof StmtParameter) {
param_idxs.add(((StmtParameter)pair.getSecond()).getIndex());
}
} // FOR
}
} // FOR
if (param_idxs.isEmpty() == false) all_param_idxs = CollectionUtil.toIntArray(param_idxs);
} // FOR
this.cache_stmtPartitionParameters.put(catalog_stmt, all_param_idxs);
}
return (all_param_idxs);
}