本文整理汇总了Java中org.apache.commons.collections15.set.ListOrderedSet.add方法的典型用法代码示例。如果您正苦于以下问题:Java ListOrderedSet.add方法的具体用法?Java ListOrderedSet.add怎么用?Java ListOrderedSet.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.collections15.set.ListOrderedSet
的用法示例。
在下文中一共展示了ListOrderedSet.add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addZipfianAffinity
import org.apache.commons.collections15.set.ListOrderedSet; //导入方法依赖的package包/类
/**
*
* @param catalogContext
* @throws Exception
*/
public static void addZipfianAffinity(ArgumentsParser args, double sigma) throws Exception {
//
// Figure out how many warehouses we have
//
ListOrderedSet<Integer> warehouses = new ListOrderedSet<Integer>();
for (AbstractTraceElement<?> element : args.workload) {
if (element instanceof TransactionTrace) {
TransactionTrace xact = (TransactionTrace)element;
if (!xact.getCatalogItemName().equals("neworder")) continue;
warehouses.add(((Long)xact.getParam(0)).intValue());
}
} // FOR
//
// Create a synthetic affinity between different warehouses
//
Map<Integer, RandomDistribution.Zipf> distributions = new HashMap<Integer, RandomDistribution.Zipf>();
Random rand = new Random();
int num_warehouses = warehouses.size();
for (Integer w_id : warehouses) {
int other_id = w_id;
while (other_id == w_id) other_id = warehouses.get(rand.nextInt(num_warehouses));
distributions.put(w_id, new RandomDistribution.Zipf(rand, other_id, other_id + num_warehouses, sigma));
//System.out.println(w_id + " => " + other_id);
} // FOR
FixWorkload.updateWorkloadWarehouses(args, distributions);
return;
}
示例2: getForcedTablePartitionCandidates
import org.apache.commons.collections15.set.ListOrderedSet; //导入方法依赖的package包/类
public Collection<Column> getForcedTablePartitionCandidates(Table catalog_tbl) {
final Database catalog_db = CatalogUtil.getDatabase(catalog_tbl);
final String table_key = CatalogKey.createKey(catalog_tbl);
ListOrderedSet<Column> ret = new ListOrderedSet<Column>();
if (this.force_table_partition.containsKey(table_key)) {
for (String column_key : this.force_table_partition.get(table_key)) {
ret.add(CatalogKey.getFromKey(catalog_db, column_key, Column.class));
} // FOR
}
return (ret);
}