• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ListOrderedSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.commons.collections15.set.ListOrderedSet的典型用法代码示例。如果您正苦于以下问题:Java ListOrderedSet类的具体用法?Java ListOrderedSet怎么用?Java ListOrderedSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListOrderedSet类属于org.apache.commons.collections15.set包,在下文中一共展示了ListOrderedSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getOutputColumnsForPlanNode

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Get the set of columns
 * 
 * @param catalog_db
 * @param node
 * @return
 */
public static Collection<Column> getOutputColumnsForPlanNode(final Database catalog_db, AbstractPlanNode node) {
    final PlannerContext pcontext = PlannerContext.singleton();
    final Collection<Integer> planColumnIds = getOutputColumnIdsForPlanNode(node);

    final Set<Column> columns = new ListOrderedSet<Column>();
    for (Integer column_guid : planColumnIds) {
        PlanColumn planColumn = pcontext.get(column_guid);
        assert (planColumn != null);
        AbstractExpression exp = planColumn.getExpression();
        assert (exp != null);
        Collection<Column> exp_cols = ExpressionUtil.getReferencedColumns(catalog_db, exp);
        if (debug.val)
            LOG.debug(planColumn.toString() + " => " + exp_cols);
        columns.addAll(exp_cols);
    } // FOR

    return (columns);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:26,代码来源:PlanNodeUtil.java


示例2: getOutputExpressionsForPlanNode

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Get the set of columns
 * 
 * @param catalogContext
 * @param node
 * @return
 */
public static Collection<AbstractExpression> getOutputExpressionsForPlanNode(AbstractPlanNode node) {
    final PlannerContext pcontext = PlannerContext.singleton();
    final Collection<Integer> planColumnIds = getOutputColumnIdsForPlanNode(node);

    final Collection<AbstractExpression> exps = new ListOrderedSet<AbstractExpression>();
    for (Integer column_guid : planColumnIds) {
        PlanColumn planColumn = pcontext.get(column_guid);
        assert (planColumn != null);
        AbstractExpression exp = planColumn.getExpression();
        assert (exp != null);
        exps.add(exp);
    } // FOR

    return (exps);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:23,代码来源:PlanNodeUtil.java


示例3: getLocalPartitions

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * For a given base partition id, return the list of partitions that are on
 * same node as the base partition
 * 
 * @param catalog_db
 * @param base_partition
 * @return
 */
public static Collection<Partition> getLocalPartitions(Database catalog_db, int base_partition) {
    Set<Partition> partitions = new ListOrderedSet<Partition>();

    // First figure out what partition we are in the catalog
    Cluster catalog_clus = CatalogUtil.getCluster(catalog_db);
    assert (catalog_clus != null);
    Partition catalog_part = CatalogUtil.getPartitionById(catalog_clus, base_partition);
    assert (catalog_part != null);
    Site catalog_site = catalog_part.getParent();
    assert (catalog_site != null);
    Host catalog_host = catalog_site.getHost();
    assert (catalog_host != null);

    // Now look at what other partitions are on the same host that we are
    for (Site other_site : catalog_clus.getSites()) {
        if (other_site.getHost().equals(catalog_host) == false)
            continue;
        LOG.trace(catalog_host + " => " + CatalogUtil.debug(other_site.getPartitions()));
        CollectionUtil.addAll(partitions, other_site.getPartitions());
    } // FOR
    return (partitions);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:31,代码来源:CatalogUtil.java


示例4: findAll

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * @param <T>
 * @param <U>
 * @param items
 * @param field
 * @param value
 * @return
 */
public static <T extends CatalogType, U> Set<T> findAll(Iterable<T> items, String field, U value) {
    Set<T> found = new ListOrderedSet<T>();
    for (T catalog_item : items) {
        assert (catalog_item != null);
        try {
            Object field_value = catalog_item.getField(field);
            if (field_value.equals(value))
                found.add(catalog_item);
        } catch (NullPointerException ex) {
            LOG.fatal(catalog_item + ": " + catalog_item.getFields());
            LOG.fatal(catalog_item + " does not have a field '" + field + "'");
            throw ex;
        }
    } // FOR
    return (found);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:25,代码来源:CatalogUtil.java


示例5: get

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Return the ith element of a set. Super lame
 * 
 * @param <T>
 * @param items
 * @param idx
 * @return
 */
public static <T> T get(Iterable<T> items, int idx) {
    if (items == null) {
        return (null);
    }
    else if (items instanceof List<?>) {
        return ((List<T>) items).get(idx);
    }
    else if (items instanceof ListOrderedSet<?>) {
        return ((ListOrderedSet<T>) items).get(idx);
    }
    else if (items instanceof SortedSet<?> && idx == 0) {
        SortedSet<T> set = (SortedSet<T>)items;
        return (set.isEmpty() ? null : set.first());
    }
    int ctr = 0;
    for (T t : items) {
        if (ctr++ == idx) return (t);
    }
    return (null);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:29,代码来源:CollectionUtil.java


示例6: getRoots

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Get the lists of roots for this graph. 
 * This probably won't work if the graph is undirected
 * @return
 */
public synchronized Set<V> getRoots() {
    boolean recompute = false;
    
    // First time
    if (this.roots == null) {
        this.roots = new ListOrderedSet<V>();
        recompute = true;
    // Check whether it's been marked as dirty. If it hasn't, then
    // we know that our cache is still valid
    } else if (this.isDirty(DirtyIndex.ROOTS)) {
        recompute = true;
    }

    if (recompute) {
        this.roots.clear();
        for (V v : this.graph.getVertices()) {
            if (this.graph.getPredecessorCount(v) == 0) {
                this.roots.add(v);
            }
        } // FOR
        // Probably a race condition
        this.resetDirty(DirtyIndex.ROOTS);
    }
    return (Collections.unmodifiableSet(this.roots));
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:31,代码来源:InnerGraphInformation.java


示例7: testExtractInsertColumnSet

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * testExtractInsertColumnSet
 */
public void testExtractInsertColumnSet() throws Exception {
    Table catalog_tbl = this.getTable("HISTORY");
    Procedure catalog_proc = this.getProcedure(paymentByCustomerId.class);
    Statement catalog_stmt = this.getStatement(catalog_proc, "insertHistory");

    assertNotNull(catalog_stmt);
    PredicatePairs cset = CatalogUtil.extractStatementPredicates(catalog_stmt, false, catalog_tbl);
    // System.out.println(cset.debug());

    // Column -> StmtParameter Index
    Set<Pair<Column, Integer>> expected_columns = new ListOrderedSet<Pair<Column, Integer>>();
    for (Column catalog_col : CatalogUtil.getSortedCatalogItems(catalog_tbl.getColumns(), "index")) {
        assertNotNull(catalog_col);
        expected_columns.add(Pair.of(catalog_col, catalog_col.getIndex()));
    } // FOR
    System.err.println(StringUtil.columns("EXPECTED:\n" + StringUtil.join("\n", expected_columns), "ACTUAL:\n" + StringUtil.join("\n", cset)));

    this.checkColumnSet(cset, expected_columns);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:23,代码来源:TestCatalogUtil.java


示例8: getOutputColumnIdsForPlanNode

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * @param node
 * @return
 */
public static Collection<Integer> getOutputColumnIdsForPlanNode(AbstractPlanNode node) {
    final Collection<Integer> planColumnIds = new ListOrderedSet<Integer>();

    // 2011-07-20: Using the AbstractExpressions is the more accurate way of
    // getting the
    // Columns referenced in the output
    // If this is Scan that has an inline Projection, grab those too
    if ((node instanceof AbstractScanPlanNode) && node.getInlinePlanNode(PlanNodeType.PROJECTION) != null) {
        ProjectionPlanNode prj_node = node.getInlinePlanNode(PlanNodeType.PROJECTION);
        planColumnIds.addAll(prj_node.getOutputColumnGUIDs());
        if (debug.val)
            LOG.debug(prj_node.getPlanNodeType() + ": " + planColumnIds);
    } else {
        planColumnIds.addAll(node.getOutputColumnGUIDs());
        if (debug.val)
            LOG.debug(node.getPlanNodeType() + ": " + planColumnIds);
    }

    // If this is an AggregatePlanNode, then we also need to include columns
    // computed in the aggregates
    if (node instanceof AggregatePlanNode) {
        AggregatePlanNode agg_node = (AggregatePlanNode) node;
        planColumnIds.addAll(agg_node.getAggregateColumnGuids());
        if (debug.val)
            LOG.debug(node.getPlanNodeType() + ": " + agg_node.getAggregateColumnGuids());
    }

    return (planColumnIds);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:34,代码来源:PlanNodeUtil.java


示例9: getPartitionIds

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
public Collection<Integer> getPartitionIds(String host, int site) {
    Set<Integer> ids = new ListOrderedSet<Integer>();
    for (PartitionConfiguration pc : this.getPartitions(host, site)) {
        ids.add(pc.partition);
    } // FOR
    return (ids);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:8,代码来源:ClusterConfiguration.java


示例10: getForeignKeyDependents

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Returns all the columns for this table that have a foreign key dependency
 * on another table
 * 
 * @param catalog_tbl
 * @return
 */
public static Collection<Column> getForeignKeyDependents(Table catalog_tbl) {
    Set<Column> found = new ListOrderedSet<Column>();
    for (Column catalog_col : catalog_tbl.getColumns()) {
        assert (catalog_col != null);
        if (!catalog_col.getConstraints().isEmpty()) {
            // System.out.println(catalog_col + ": " +
            // CatalogUtil.getConstraints(catalog_col.getConstraints()));
            if (!CatalogUtil.findAll(CatalogUtil.getConstraints(catalog_col.getConstraints()), "type", ConstraintType.FOREIGN_KEY.getValue()).isEmpty()) {
                found.add(catalog_col);
            }
        }
    } // FOR
    return (found);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:22,代码来源:CatalogUtil.java


示例11: getReferencedTables

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Returns all the tables access/modified in all the Statements for this
 * Procedure
 * 
 * @param catalog_proc
 * @return
 * @throws Exception
 */
public static Collection<Table> getReferencedTables(Procedure catalog_proc) throws Exception {
    final CatalogUtil.Cache cache = CatalogUtil.getCatalogCache(catalog_proc);
    Set<Table> ret = cache.PROCEDURE_TABLES.get(catalog_proc);
    if (ret == null) {
        Set<Table> tables = new ListOrderedSet<Table>();
        for (Statement catalog_stmt : catalog_proc.getStatements()) {
            tables.addAll(CatalogUtil.getReferencedTables(catalog_stmt));
        } // FOR
        ret = Collections.unmodifiableSet(tables);
        cache.PROCEDURE_TABLES.put(catalog_proc, ret);
    }
    return (ret);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:22,代码来源:CatalogUtil.java


示例12: getReferencedColumns

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Returns all the columns access/modified in all the Statements for this
 * Procedure
 * 
 * @param catalog_proc
 * @return
 * @throws Exception
 */
public static Collection<Column> getReferencedColumns(Procedure catalog_proc) throws Exception {
    final CatalogUtil.Cache cache = CatalogUtil.getCatalogCache(catalog_proc);
    Set<Column> ret = cache.PROCEDURE_COLUMNS.get(catalog_proc);
    if (ret == null) {
        Set<Column> columns = new ListOrderedSet<Column>();
        for (Statement catalog_stmt : catalog_proc.getStatements()) {
            columns.addAll(CatalogUtil.getReferencedColumns(catalog_stmt));
        } // FOR
        ret = Collections.unmodifiableSet(columns);
        cache.PROCEDURE_COLUMNS.put(catalog_proc, ret);
    }
    return (ret);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:22,代码来源:CatalogUtil.java


示例13: getReferencingProcedures

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Returns all of the procedures that access/modify the given table
 * 
 * @param catalog_tbl
 * @return
 * @throws Exception
 */
public static Collection<Procedure> getReferencingProcedures(Table catalog_tbl) throws Exception {
    Set<Procedure> ret = new ListOrderedSet<Procedure>();
    Database catalog_db = CatalogUtil.getDatabase(catalog_tbl);
    for (Procedure catalog_proc : catalog_db.getProcedures()) {
        if (catalog_proc.getSystemproc())
            continue;
        if (CatalogUtil.getReferencedTables(catalog_proc).contains(catalog_tbl)) {
            ret.add(catalog_proc);
        }
    } // FOR
    return (ret);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:CatalogUtil.java


示例14: getOrderByColumns

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Return all the Columns used in ORDER BY clauses for the given Statement
 * 
 * @param catalog_stmt
 * @return
 */
public static Collection<Column> getOrderByColumns(Statement catalog_stmt) {
    if (debug.val)
        LOG.debug("Extracting order-by columns from statement " + CatalogUtil.getDisplayName(catalog_stmt));

    final CatalogUtil.Cache cache = CatalogUtil.getCatalogCache(catalog_stmt);
    Set<Column> ret = cache.STATEMENT_ORDERBY_COLUMNS.get(catalog_stmt);
    if (ret == null) {
        Database catalog_db = CatalogUtil.getDatabase(catalog_stmt);
        ret = new ListOrderedSet<Column>();
        try {
            AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
            assert (root != null);
            PlannerContext context = PlannerContext.singleton();
            for (OrderByPlanNode node : PlanNodeUtil.getPlanNodes(root, OrderByPlanNode.class)) {
                for (Integer guid : node.getSortColumnGuids()) {
                    PlanColumn pcol = context.get(guid);
                    assert (pcol != null);
                    ret.addAll(ExpressionUtil.getReferencedColumns(catalog_db, pcol.getExpression()));
                } // FOR
            } // FOR
        } catch (Throwable ex) {
            throw new RuntimeException("Failed to retrieve ORDER BY columns for " + catalog_stmt.fullName());
        }
        cache.STATEMENT_ORDERBY_COLUMNS.put(catalog_stmt, ret);
    }
    return (ret);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:34,代码来源:CatalogUtil.java


示例15: getReferencedTablesForPlanNode

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Return all of the tables referenced in the given AbstractPlanNode
 * Non-recursive.
 * 
 * @param catalog_db
 * @param node
 * @return
 * @throws Exception
 */
public static Collection<Table> getReferencedTablesForPlanNode(final Database catalog_db,
                                                               final AbstractPlanNode node) {
    final Set<Table> ret = new ListOrderedSet<Table>();
    try {
        CatalogUtil.getReferencedTablesForPlanNode(catalog_db, node, ret);
    } catch (Exception ex) {
        throw new RuntimeException("Failed to get referenced tables for " + node, ex);
    }
    return (ret);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:CatalogUtil.java


示例16: getReferencedTablesForTree

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Return all of tables referenced in the PlanNode tree, regardless if they
 * are modified or not
 * 
 * @param catalog_db
 * @param root
 * @return
 */
public static Collection<Table> getReferencedTablesForTree(final Database catalog_db,
                                                           final AbstractPlanNode root) {
    final Set<Table> found = new ListOrderedSet<Table>();
    new PlanNodeTreeWalker(true) {
        @Override
        protected void callback(AbstractPlanNode element) {
            CatalogUtil.getReferencedTablesForPlanNode(catalog_db, element, found);
            return;
        }
    }.traverse(root);
    return (found);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:CatalogUtil.java


示例17: getNext

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Find the next unique combination
 */
private void getNext() {
    assert (this.next == null);
    final boolean trace = LOG.isTraceEnabled();
    final boolean debug = LOG.isDebugEnabled();

    if (debug)
        LOG.debug("Finding next combination [call=" + (this.attempt_ctr++) + "]");

    boolean valid = false;
    Vector<Integer> buffer = null;
    for (int i = this.last.get(0); i < this.num_elements; i++) {
        if (trace)
            LOG.trace("\n" + this);

        buffer = new Vector<Integer>();
        buffer.setSize(this.combo_size);
        buffer.set(0, i);

        // We have a new combination!
        if (this.calculateCombinations(buffer, 1)) {
            if (trace)
                LOG.trace("Found new combination: " + buffer);
            valid = true;
            break;
        }
        if (trace)
            LOG.trace("No combination found that starts with index #" + i);
        buffer = null;
        this.initializeLast(i + 1);
    } // FOR

    if (trace)
        LOG.trace("VALID = " + valid);
    if (valid) {
        assert (this.combo_size == buffer.size());
        this.next = new ListOrderedSet<E>();
        for (int i = 0; i < this.combo_size; i++) {
            this.next.add(this.data.get(buffer.get(i)));
        } // FOR
        if (trace)
            LOG.trace("NEXT = " + this.next);

        // Increase the last position's counter so that it is different next
        // time
        this.last.set(this.combo_size - 1, this.last.lastElement() + 1);
        if (trace)
            LOG.trace("NEW LAST = " + this.last);

        this.finished = false;
    } else {
        this.finished = true;
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:57,代码来源:UniqueCombinationIterator.java


示例18: getDescendants

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
/**
 * Return the set of vertices that are descedants of the given vertices
 * @param vertex
 * @return
 */
public synchronized Set<V> getDescendants(V vertex) {
    boolean recompute = false;
    
    // First time
    if (this.descendants == null) {
        this.descendants = new ListOrderedSet<V>();
        recompute = true;
    // Check whether it's been marked as dirty. If it hasn't, then
    // we know that our cache is still valid
    } else if (this.isDirty(DirtyIndex.DESCENDANTS)) {
        recompute = true;
    }
    
    if (recompute) {
        this.descendants.clear();
        new VertexTreeWalker<V, E>(this.graph) {
            @Override
            protected void callback(V element) {
                descendants.add(element);
            }
        }.traverse(vertex);
        // Probably a race condition...
        this.resetDirty(DirtyIndex.DESCENDANTS);
    }
    return (Collections.unmodifiableSet(this.descendants));
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:32,代码来源:InnerGraphInformation.java


示例19: add

import org.apache.commons.collections15.set.ListOrderedSet; //导入依赖的package包/类
synchronized void add(CT catalog_item, String hash_str, T trace) {
    Map<String, Set<T>> m = this.get(catalog_item);
    if (m == null) {
        m = new ConcurrentHashMap<String, Set<T>>();
        this.put(catalog_item, m);
    }
    Set<T> s = m.get(hash_str);
    if (s == null) {
        s = new ListOrderedSet<T>();
        m.put(hash_str, s);
    }
    s.add(trace);
    this.has_duplicates = this.has_duplicates || s.size() > 1;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:15,代码来源:WorkloadSummarizer.java


示例20: 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;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:35,代码来源:FixWorkload.java



注:本文中的org.apache.commons.collections15.set.ListOrderedSet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MassAirFlowCommand类代码示例发布时间:2022-05-22
下一篇:
Java Graphic类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap