當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。