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


Java DeletePlanNode类代码示例

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


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

示例1: fragmentReferencesPersistentTable

import org.voltdb.plannodes.DeletePlanNode; //导入依赖的package包/类
/**
 * Check through a plan graph and return true if it ever touches a persistent table.
 */
static boolean fragmentReferencesPersistentTable(AbstractPlanNode node) {
    if (node == null)
        return false;

    // these nodes can read/modify persistent tables
    if (node instanceof AbstractScanPlanNode)
        return true;
    if (node instanceof InsertPlanNode)
        return true;
    if (node instanceof DeletePlanNode)
        return true;
    if (node instanceof UpdatePlanNode)
        return true;

    // recursively check out children
    for (int i = 0; i < node.getChildPlanNodeCount(); i++) {
        AbstractPlanNode child = node.getChild(i);
        if (fragmentReferencesPersistentTable(child))
            return true;
    }

    // if nothing found, return false
    return false;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:28,代码来源:StatementCompiler.java

示例2: fragmentReadOnly

import org.voltdb.plannodes.DeletePlanNode; //导入依赖的package包/类
/**
 * Check through a plan graph and return true if it is read only
 */
static boolean fragmentReadOnly(AbstractPlanNode node) {
    if (node == null)
        return true;

    if (node instanceof InsertPlanNode)
        return false;
    if (node instanceof DeletePlanNode)
        return false;
    if (node instanceof UpdatePlanNode)
        return false;

    // recursively check out children
    for (int i = 0; i < node.getChildPlanNodeCount(); i++) {
        if (fragmentReadOnly(node.getChild(i)) == false) return (false);
    }

    // if nothing found, return true
    return true;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:23,代码来源:StatementCompiler.java

示例3: fragmentReferencesPersistentTable

import org.voltdb.plannodes.DeletePlanNode; //导入依赖的package包/类
/**
 * Check through a plan graph and return true if it ever touches a persistent table.
 */
static boolean fragmentReferencesPersistentTable(AbstractPlanNode node) {
    if (node == null)
        return false;

    // these nodes can read/modify persistent tables
    if (node instanceof AbstractScanPlanNode)
        return true;
    if (node instanceof InsertPlanNode)
        return true;
    if (node instanceof DeletePlanNode)
        return true;
    if (node instanceof UpdatePlanNode)
        return true;

    // recursively check out children
    for (int i = 0; i < node.getChildCount(); i++) {
        AbstractPlanNode child = node.getChild(i);
        if (fragmentReferencesPersistentTable(child))
            return true;
    }

    // if nothing found, return false
    return false;
}
 
开发者ID:anhnv-3991,项目名称:VoltDB,代码行数:28,代码来源:StatementCompiler.java

示例4: checkTruncateFlag

import org.voltdb.plannodes.DeletePlanNode; //导入依赖的package包/类
private void checkTruncateFlag() {
    assertTrue(pns.size() == 2);

    ArrayList<AbstractPlanNode> deletes = pns.get(1).findAllNodesOfType(PlanNodeType.DELETE);

    assertTrue(deletes.size() == 1);
    assertTrue(((DeletePlanNode) deletes.get(0) ).isTruncate());
}
 
开发者ID:anhnv-3991,项目名称:VoltDB,代码行数:9,代码来源:TestPlansDML.java

示例5: testBasicUpdateAndDelete

import org.voltdb.plannodes.DeletePlanNode; //导入依赖的package包/类
public void testBasicUpdateAndDelete() {
    // select * with ON clause should return all columns from all tables
    AbstractPlanNode n;
    AbstractPlanNode pn;

    pns = compileToFragments("UPDATE R1 SET C = 1 WHERE C = 0");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof ReceivePlanNode);
    pn = pns.get(1);
    n = pn.getChild(0);
    assertTrue(n instanceof UpdatePlanNode);

    pns = compileToFragments("DELETE FROM R1 WHERE C = 0");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof ReceivePlanNode);
    pn = pns.get(1);
    n = pn.getChild(0);
    assertTrue(n instanceof DeletePlanNode);

    pns = compileToFragments("INSERT INTO R1 VALUES (1, 2, 3)");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof ReceivePlanNode);
    pn = pns.get(1);
    n = pn.getChild(0);
    assertTrue(n instanceof InsertPlanNode);

    pns = compileToFragments("UPDATE P1 SET C = 1 WHERE C = 0");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof ReceivePlanNode);
    pn = pns.get(1);
    n = pn.getChild(0);
    assertTrue(n instanceof UpdatePlanNode);

    pns = compileToFragments("DELETE FROM P1 WHERE C = 0");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    n = pn.getChild(0).getChild(0);
    assertTrue(n instanceof ReceivePlanNode);
    pn = pns.get(1);
    n = pn.getChild(0);
    assertTrue(n instanceof DeletePlanNode);

    pns = compileToFragments("UPDATE P1 SET C = 1 WHERE A = 0");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    //n = pn.getChild(0);
    assertTrue(pn instanceof UpdatePlanNode);

    pns = compileToFragments("DELETE FROM P1 WHERE A = 0");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    //n = pn.getChild(0);
    assertTrue(pn instanceof DeletePlanNode);

    pns = compileToFragments("INSERT INTO P1 VALUES (1, 2)");
    pn = pns.get(0);
    System.out.println(pn.toExplainPlanString());
    //n = pn.getChild(0).getChild(0);
    assertTrue(pn instanceof InsertPlanNode);

}
 
开发者ID:anhnv-3991,项目名称:VoltDB,代码行数:70,代码来源:TestPlansDML.java

示例6: testDeleteOrderByPlan

import org.voltdb.plannodes.DeletePlanNode; //导入依赖的package包/类
public void testDeleteOrderByPlan() {
    System.out.println("\n\n\nRUNNING testDeleteOrderByPlan\n\n");

    // No ORDER BY node, since we can use index instead
    pns = compileToFragments("DELETE FROM R5 ORDER BY A LIMIT ?");
    assertEquals(2, pns.size());
    AbstractPlanNode collectorRoot = pns.get(1);
    assertClassesMatchNodeChain(Arrays.asList(
            SendPlanNode.class,
            DeletePlanNode.class,
            IndexScanPlanNode.class),
            collectorRoot
            );

    // No ORDER BY node, since index scan is used to evaluate predicate
    pns = compileToFragments("DELETE FROM R5 WHERE A = 1 ORDER BY A LIMIT ?");
    assertEquals(2, pns.size());
    collectorRoot = pns.get(1);
    assertClassesMatchNodeChain(Arrays.asList(
            SendPlanNode.class,
            DeletePlanNode.class,
            IndexScanPlanNode.class),
            collectorRoot
            );

    // Index used to evaluate predicate not suitable for ORDER BY
    pns = compileToFragments("DELETE FROM R5 WHERE A = 1 ORDER BY B, A, C, D LIMIT ?");
    assertEquals(2, pns.size());
    collectorRoot = pns.get(1);
    assertClassesMatchNodeChain(Arrays.asList(
            SendPlanNode.class,
            DeletePlanNode.class,
            OrderByPlanNode.class,
            IndexScanPlanNode.class),
            collectorRoot
            );

    // Index can't be used either for predicate evaluation or ORDER BY
    pns = compileToFragments("DELETE FROM R5 WHERE B = 1 ORDER BY B, A, C, D LIMIT ?");
    assertEquals(2, pns.size());
    collectorRoot = pns.get(1);
    assertClassesMatchNodeChain(Arrays.asList(
            SendPlanNode.class,
            DeletePlanNode.class,
            OrderByPlanNode.class,
            SeqScanPlanNode.class),
            collectorRoot
            );
}
 
开发者ID:anhnv-3991,项目名称:VoltDB,代码行数:50,代码来源:TestPlansDML.java


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