Class UpdatePlan


  • public final class UpdatePlan
    extends Object
    Update plan - where to take data to update cache from and how to construct new keys and values, if needed.
    • Constructor Detail

      • UpdatePlan

        public UpdatePlan​(UpdateMode mode,
                          GridH2Table tbl,
                          String[] colNames,
                          int[] colTypes,
                          KeyValueSupplier keySupplier,
                          KeyValueSupplier valSupplier,
                          int keyColIdx,
                          int valColIdx,
                          String selectQry,
                          boolean isLocSubqry,
                          List<List<DmlArgument>> rows,
                          int rowsNum,
                          @Nullable
                          @Nullable FastUpdate fastUpdate,
                          @Nullable
                          @Nullable DmlDistributedPlanInfo distributed,
                          boolean canSelectBeLazy,
                          boolean fillAbsentPKsWithDefaults)
        Constructor.
        Parameters:
        mode - Mode.
        tbl - Table.
        colNames - Column names.
        colTypes - Column types.
        keySupplier - Key supplier.
        valSupplier - Value supplier.
        keyColIdx - Key column index.
        valColIdx - value column index.
        selectQry - Select query.
        isLocSubqry - Local subquery flag.
        rows - Rows for query-less INSERT or MERGE.
        rowsNum - Rows number.
        fastUpdate - Fast update (if any).
        distributed - Distributed plan (if any)
        fillAbsentPKsWithDefaults - Fills absent PKs with nulls or defaults setting.
      • UpdatePlan

        public UpdatePlan​(UpdateMode mode,
                          GridH2Table tbl,
                          String selectQry,
                          @Nullable
                          @Nullable FastUpdate fastUpdate,
                          @Nullable
                          @Nullable DmlDistributedPlanInfo distributed)
        Constructor for delete operation or fast update.
        Parameters:
        mode - Mode.
        tbl - Table.
        selectQry - Select query.
        fastUpdate - Fast update arguments (if any).
        distributed - Distributed plan (if any)
    • Method Detail

      • hasRows

        public boolean hasRows()
        Returns:
        True if predefined rows exist.
      • createRows

        public List<List<?>> createRows​(Object[] args)
                                 throws IgniteCheckedException
        Extract rows from plan without performing any query.
        Parameters:
        args - Original query arguments.
        Returns:
        List of rows from the plan for a single query. For example, if we have multiple args in a query:
        INSERT INTO person VALUES (k1, v1), (k2, v2), (k3, v3);
        we will get a List of List with items {[k1, v1], [k2, v2], [k3, v3]}.
        Throws:
        IgniteCheckedException - if failed.
      • createRows

        public List<List<List<?>>> createRows​(List<Object[]> argss)
                                       throws IgniteCheckedException
        Extract rows from plan without performing any query.
        Parameters:
        argss - Batch of arguments.
        Returns:
        List of rows from the plan for each query. For example, if we have a batch of queries with multiple args:
        INSERT INTO person VALUES (k1, v1), (k2, v2), (k3, v3);
        INSERT INTO person VALUES (k4, v4), (k5, v5), (k6, v6);
        we will get a List of List of List with items:
        {[k1, v1], [k2, v2], [k3, v3]},
        {[k4, v4], [k5, v5], [k6, v6]}
        Throws:
        IgniteCheckedException - If failed.
      • mode

        public UpdateMode mode()
        Returns:
        Update mode.
      • distributedPlan

        @Nullable
        public @Nullable DmlDistributedPlanInfo distributedPlan()
        Returns:
        Distributed plan info (for skip-reducer mode).
      • rowCount

        public int rowCount()
        Returns:
        Row count.
      • selectQuery

        public String selectQuery()
        Returns:
        Select query.
      • isLocalSubquery

        public boolean isLocalSubquery()
        Returns:
        Local subquery flag.
      • canSelectBeLazy

        public boolean canSelectBeLazy()
        Returns:
        true is the SELECT query may be executed in lazy mode.