Examples of Qualifier


Examples of org.apache.derby.iapi.store.access.Qualifier

            // process each AND clause

            row_qualifies = false;

            // Apply one qualifier to the row.
            Qualifier q      = qual_list[0][i];
            int       col_id = q.getColumnId();

            if (SanityManager.DEBUG)
            {
                SanityManager.ASSERT(
                    (col_id < row.length),
                    "Qualifier is referencing a column not in the row.");
            }

            // materialize the column object if we haven't done it yet.
            if (materializedCols[col_id] == 0)
            {
                // materialize just this column from the row, no qualifiers
                readOneColumnFromPage(
                    row,
                    col_id,
                    offset_to_row_data,
                    recordHeader,
                    recordToLock);

                // mark offset, indicating the row has been read in.
                //
                // RESOLVE (mikem) - right now value of entry is useless, it
                // is an int so that in the future we could cache the offset
                // to fields to improve performance of getting to a column
                // after qualifying.
                materializedCols[col_id] = offset_to_row_data;
            }

            // Get the column from the possibly partial row, of the
            // q.getColumnId()'th column in the full row.

            if (SanityManager.DEBUG)
            {
                if (row[col_id] == null)
                    SanityManager.THROWASSERT(
                        "1:row = " + RowUtil.toString(row) +
                        "row.length = " + row.length +
                        ";q.getColumnId() = " + q.getColumnId());
            }

            // do the compare between the column value and value in the
            // qualifier.
            row_qualifies =
                ((DataValueDescriptor) row[col_id]).compare(
                        q.getOperator(),
                        q.getOrderable(),
                        q.getOrderedNulls(),
                        q.getUnknownRV());

            if (q.negateCompareResult())
                row_qualifies = !row_qualifies;

            // Once an AND fails the whole Qualification fails - do a return!
            if (!row_qualifies)
                return(false);
        }

        // Now process the Subsequent OR clause's, beginning with qual_list[1]

        for (int and_idx = 1; and_idx < qual_list.length; and_idx++)
        {
            // loop through each of the "and" clause.

            row_qualifies = false;

            for (int or_idx = 0; or_idx < qual_list[and_idx].length; or_idx++)
            {
                // Apply one qualifier to the row.
                Qualifier q      = qual_list[and_idx][or_idx];
                int       col_id = q.getColumnId();

                if (SanityManager.DEBUG)
                {
                    SanityManager.ASSERT(
                        (col_id < row.length),
                        "Qualifier is referencing a column not in the row.");
                }

                // materialize the column object if we haven't done it yet.
                if (materializedCols[col_id] == 0)
                {
                    // materialize just this column from the row, no qualifiers
                    readOneColumnFromPage(
                        row,
                        col_id,
                        offset_to_row_data,
                        recordHeader,
                        recordToLock);

                    // mark offset, indicating the row has been read in.
                    //
                    // RESOLVE (mikem) - right now value of entry is useless, it
                    // is an int so that in the future we could cache the offset
                    // to fields to improve performance of getting to a column
                    // after qualifying.
                    materializedCols[col_id] = offset_to_row_data;
                }

                // Get the column from the possibly partial row, of the
                // q.getColumnId()'th column in the full row.

                if (SanityManager.DEBUG)
                {
                    if (row[col_id] == null)
                        SanityManager.THROWASSERT(
                            "1:row = " + RowUtil.toString(row) +
                            "row.length = " + row.length +
                            ";q.getColumnId() = " + q.getColumnId());
                }

                // do the compare between the column value and value in the
                // qualifier.
                row_qualifies =
                    ((DataValueDescriptor) row[col_id]).compare(
                            q.getOperator(),
                            q.getOrderable(),
                            q.getOrderedNulls(),
                            q.getUnknownRV());


                if (q.negateCompareResult())
                    row_qualifies = !row_qualifies;

                // SanityManager.DEBUG_PRINT("StoredPage.qual", "processing qual[" + and_idx + "][" + or_idx + "] = " + qual_list[and_idx][or_idx] );

                // SanityManager.DEBUG_PRINT("StoredPage.qual", "value = " + row_qualifies);
View Full Code Here

Examples of org.apache.derby.iapi.store.access.Qualifier

    protected boolean process_qualifier(
    DataValueDescriptor[]     row)
        throws StandardException
    {
        boolean     row_qualifies = true;
        Qualifier   q;

        // Process the 2-d qualifier which is structured as follows:
        //
        // A two dimensional array is to be used to pass around a AND's and OR's
        // in conjunctive normal form (CNF).  The top slot of the 2 dimensional
        // array is optimized for the more frequent where no OR's are present. 
        // The first array slot is always a list of AND's to be treated as
        // described above for single dimensional AND qualifier arrays.  The
        // subsequent slots are to be treated as AND'd arrays or OR's.  Thus
        // the 2 dimensional array qual[][] argument is to be treated as the
        // following, note if qual.length = 1 then only the first array is
        // valid and // it is and an array of and clauses:
        //
        // (qual[0][0] and qual[0][0] ... and qual[0][qual[0].length - 1])
        // and
        // (qual[1][0] or  qual[1][1] ... or  qual[1][qual[1].length - 1])
        // and
        // (qual[2][0] or  qual[2][1] ... or  qual[2][qual[2].length - 1])
        // ...
        // and
        // (qual[qual.length - 1][0] or  qual[1][1] ... or  qual[1][2])

        // First do the qual[0] which is an array of qualifer terms.

        if (SanityManager.DEBUG)
        {
            // routine should not be called if there is no qualifier
            SanityManager.ASSERT(this.init_qualifier != null);
            SanityManager.ASSERT(this.init_qualifier.length > 0);
        }

        for (int i = 0; i < this.init_qualifier[0].length; i++)
        {
            // process each AND clause

            row_qualifies = false;

            // process each OR clause.

            q = this.init_qualifier[0][i];

            // Get the column from the possibly partial row, of the
            // q.getColumnId()'th column in the full row.
            DataValueDescriptor columnValue = row[q.getColumnId()];

            row_qualifies =
                columnValue.compare(
                    q.getOperator(),
                    q.getOrderable(),
                    q.getOrderedNulls(),
                    q.getUnknownRV());

            if (q.negateCompareResult())
                row_qualifies = !row_qualifies;

            // Once an AND fails the whole Qualification fails - do a return!
            if (!row_qualifies)
                return(false);
        }

        // all the qual[0] and terms passed, now process the OR clauses

        for (int and_idx = 1; and_idx < this.init_qualifier.length; and_idx++)
        {
            // process each AND clause

            row_qualifies = false;

            if (SanityManager.DEBUG)
            {
                // Each OR clause must be non-empty.
                SanityManager.ASSERT(this.init_qualifier[and_idx].length > 0);
            }

            for (int or_idx = 0;
                 or_idx < this.init_qualifier[and_idx].length; or_idx++)
            {
                // process each OR clause.

                q = this.init_qualifier[and_idx][or_idx];

                // Get the column from the possibly partial row, of the
                // q.getColumnId()'th column in the full row.
                DataValueDescriptor columnValue = row[q.getColumnId()];

                row_qualifies =
                    columnValue.compare(
                        q.getOperator(),
                        q.getOrderable(),
                        q.getOrderedNulls(),
                        q.getUnknownRV());

                if (q.negateCompareResult())
                    row_qualifies = !row_qualifies;

                // once one OR qualifies the entire clause is TRUE
                if (row_qualifies)
                    break;
View Full Code Here

Examples of org.apache.derby.iapi.store.access.Qualifier

            row_qualifies = false;

            // process each OR clause.

            Qualifier q = qual_list[0][i];

            // Get the column from the possibly partial row, of the
            // q.getColumnId()'th column in the full row.
            DataValueDescriptor columnValue =
                    (DataValueDescriptor) row[q.getColumnId()];

            row_qualifies =
                columnValue.compare(
                    q.getOperator(),
                    q.getOrderable(),
                    q.getOrderedNulls(),
                    q.getUnknownRV());

            if (q.negateCompareResult())
                row_qualifies = !row_qualifies;

            // Once an AND fails the whole Qualification fails - do a return!
            if (!row_qualifies)
                return(false);
        }

        // all the qual[0] and terms passed, now process the OR clauses

        for (int and_idx = 1; and_idx < qual_list.length; and_idx++)
        {
            // loop through each of the "and" clause.

            row_qualifies = false;

            if (SanityManager.DEBUG)
            {
                // Each OR clause must be non-empty.
                SanityManager.ASSERT(qual_list[and_idx].length > 0);
            }

            for (int or_idx = 0; or_idx < qual_list[and_idx].length; or_idx++)
            {
                // Apply one qualifier to the row.
                Qualifier q      = qual_list[and_idx][or_idx];
                int       col_id = q.getColumnId();

                if (SanityManager.DEBUG)
                {
                    SanityManager.ASSERT(
                        (col_id < row.length),
                        "Qualifier is referencing a column not in the row.");
                }

                // Get the column from the possibly partial row, of the
                // q.getColumnId()'th column in the full row.
                DataValueDescriptor columnValue =
                    (DataValueDescriptor) row[q.getColumnId()];

                if (SanityManager.DEBUG)
                {
                    if (columnValue == null)
                        SanityManager.THROWASSERT(
                            "1:row = " + RowUtil.toString(row) +
                            "row.length = " + row.length +
                            ";q.getColumnId() = " + q.getColumnId());
                }

                // do the compare between the column value and value in the
                // qualifier.
                row_qualifies =
                    columnValue.compare(
                            q.getOperator(),
                            q.getOrderable(),
                            q.getOrderedNulls(),
                            q.getUnknownRV());

                if (q.negateCompareResult())
                    row_qualifies = !row_qualifies;

                // SanityManager.DEBUG_PRINT("StoredPage.qual", "processing qual[" + and_idx + "][" + or_idx + "] = " + qual_list[and_idx][or_idx] );

                // SanityManager.DEBUG_PRINT("StoredPage.qual", "value = " + row_qualifies);
View Full Code Here

Examples of org.apache.derby.iapi.store.access.Qualifier

            // process each AND clause

            row_qualifies = false;

            // Apply one qualifier to the row.
            Qualifier q      = qual_list[0][i];
            int       col_id = q.getColumnId();

            if (SanityManager.DEBUG)
            {
                SanityManager.ASSERT(
                    (col_id < row.length),
                    "Qualifier is referencing a column not in the row.");
            }

            // materialize the column object if we haven't done it yet.
            if (materializedCols[col_id] == 0)
            {
                // materialize just this column from the row, no qualifiers
                readOneColumnFromPage(
                    row,
                    col_id,
                    offset_to_row_data,
                    recordHeader,
                    recordToLock);

                // mark offset, indicating the row has been read in.
                //
                // RESOLVE (mikem) - right now value of entry is useless, it
                // is an int so that in the future we could cache the offset
                // to fields to improve performance of getting to a column
                // after qualifying.
                materializedCols[col_id] = offset_to_row_data;
            }

            // Get the column from the possibly partial row, of the
            // q.getColumnId()'th column in the full row.

            if (SanityManager.DEBUG)
            {
                if (row[col_id] == null)
                    SanityManager.THROWASSERT(
                        "1:row = " + RowUtil.toString(row) +
                        "row.length = " + row.length +
                        ";q.getColumnId() = " + q.getColumnId());
            }

            // do the compare between the column value and value in the
            // qualifier.
            row_qualifies =
                ((DataValueDescriptor) row[col_id]).compare(
                        q.getOperator(),
                        q.getOrderable(),
                        q.getOrderedNulls(),
                        q.getUnknownRV());

            if (q.negateCompareResult())
                row_qualifies = !row_qualifies;

            // Once an AND fails the whole Qualification fails - do a return!
            if (!row_qualifies)
                return(false);
        }

        // Now process the Subsequent OR clause's, beginning with qual_list[1]

        for (int and_idx = 1; and_idx < qual_list.length; and_idx++)
        {
            // loop through each of the "and" clause.

            row_qualifies = false;

            for (int or_idx = 0; or_idx < qual_list[and_idx].length; or_idx++)
            {
                // Apply one qualifier to the row.
                Qualifier q      = qual_list[and_idx][or_idx];
                int       col_id = q.getColumnId();

                if (SanityManager.DEBUG)
                {
                    SanityManager.ASSERT(
                        (col_id < row.length),
                        "Qualifier is referencing a column not in the row.");
                }

                // materialize the column object if we haven't done it yet.
                if (materializedCols[col_id] == 0)
                {
                    // materialize just this column from the row, no qualifiers
                    readOneColumnFromPage(
                        row,
                        col_id,
                        offset_to_row_data,
                        recordHeader,
                        recordToLock);

                    // mark offset, indicating the row has been read in.
                    //
                    // RESOLVE (mikem) - right now value of entry is useless, it
                    // is an int so that in the future we could cache the offset
                    // to fields to improve performance of getting to a column
                    // after qualifying.
                    materializedCols[col_id] = offset_to_row_data;
                }

                // Get the column from the possibly partial row, of the
                // q.getColumnId()'th column in the full row.

                if (SanityManager.DEBUG)
                {
                    if (row[col_id] == null)
                        SanityManager.THROWASSERT(
                            "1:row = " + RowUtil.toString(row) +
                            "row.length = " + row.length +
                            ";q.getColumnId() = " + q.getColumnId());
                }

                // do the compare between the column value and value in the
                // qualifier.
                row_qualifies =
                    ((DataValueDescriptor) row[col_id]).compare(
                            q.getOperator(),
                            q.getOrderable(),
                            q.getOrderedNulls(),
                            q.getUnknownRV());


                if (q.negateCompareResult())
                    row_qualifies = !row_qualifies;

                // SanityManager.DEBUG_PRINT("StoredPage.qual", "processing qual[" + and_idx + "][" + or_idx + "] = " + qual_list[and_idx][or_idx] );

                // SanityManager.DEBUG_PRINT("StoredPage.qual", "value = " + row_qualifies);
View Full Code Here

Examples of org.apache.derby.iapi.store.access.Qualifier

  protected void clearOrderableCache(Qualifier[][] qualifiers) throws StandardException
  {
    // Clear the Qualifiers's Orderable cache
    if (qualifiers != null)
    {
      Qualifier qual;
      for (int term = 0; term < qualifiers.length; term++)
      {
        for (int index = 0; index < qualifiers[term].length; index++)
        {
          qual = qualifiers[term][index];
          qual.clearOrderableCache();
          /* beetle 4880 performance enhancement and avoid deadlock while pushing
           * down method call to store: pre-evaluate.
           */
          if (((GenericQualifier) qual).variantType != Qualifier.VARIANT)
            qual.getOrderable();    // ignore return value
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Qualifier

            String qualifierName = null;
            String qualfiedIntentName = null;
            Intent qualifiedIntent = null;

            Qualifier qualifier = null;

            int event = reader.getEventType();
            try {
                reader.next();
                while (reader.hasNext()) {
                    event = reader.getEventType();
                    switch (event) {
                        case START_ELEMENT: {
                            name = reader.getName();
                            if (POLICY_INTENT_MAP_QUALIFIER_QNAME.equals(name)) {
                                qualifierName = getString(reader, NAME);
                                if (qualifierName != null) {
                                    qualfiedIntentName =
                                        mappedIntent.getName().getLocalPart() + QUALIFIER + qualifierName;
                                    qualifiedIntent = policyFactory.createIntent();
                                    qualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
                                                                      qualfiedIntentName));
                                    qualifier = policyFactory.createQualifier();
                                    qualifier.setIntent(qualifiedIntent);
                                    intentMap.getQualifiers().add(qualifier);

                                } else {
                                    error(monitor, "QualifierNameMissing", reader, policySet.getName());
                                }
                            } else if (POLICY_INTENT_MAP_QNAME.equals(name)) {
                                QName providedIntent = getQName(reader, PROVIDES);
                                if (qualifierName.equals(providedIntent.getLocalPart())) {
                                    readIntentMap(reader, policySet, qualifiedIntent, context);
                                } else {
                                    error(monitor,
                                          "IntentMapDoesNotMatch",
                                          providedIntent,
                                          providedIntent,
                                          qualifierName,
                                          policySet);
                                    //throw new ContributionReadException("Intent provided by IntentMap " +
                                    //providedIntent + " does not match parent qualifier " + qualifierName +
                                    //" in policyset - " + policySet);
                                }
                            } else {
                                Object extension = extensionProcessor.read(reader, context);
                                if (extension != null && qualifier != null) {
                                    PolicyExpression exp = policyFactory.createPolicyExpression();
                                    exp.setName(name);
                                    exp.setPolicy(extension);
                                    qualifier.getPolicies().add(exp);
                                }
                            }
                            break;
                        }
                    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Qualifier

            String qualifierName = null;
            String qualfiedIntentName = null;
            Intent qualifiedIntent = null;

            Qualifier qualifier = null;

            int event = reader.getEventType();
            try {
                reader.next();
                while (reader.hasNext()) {
                    event = reader.getEventType();
                    switch (event) {
                        case START_ELEMENT: {
                            name = reader.getName();
                            if (POLICY_INTENT_MAP_QUALIFIER_QNAME.equals(name)) {
                                qualifierName = getString(reader, NAME);
                                if (qualifierName != null) {
                                    qualfiedIntentName =
                                        mappedIntent.getName().getLocalPart() + QUALIFIER + qualifierName;
                                    qualifiedIntent = policyFactory.createIntent();
                                    qualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
                                                                      qualfiedIntentName));
                                    qualifier = policyFactory.createQualifier();
                                    qualifier.setIntent(qualifiedIntent);
                                    intentMap.getQualifiers().add(qualifier);

                                } else {
                                    error(monitor, "QualifierNameMissing", reader, policySet.getName());
                                }
                            } else if (POLICY_INTENT_MAP_QNAME.equals(name)) {
                                QName providedIntent = getQName(reader, PROVIDES);
                                if (qualifierName.equals(providedIntent.getLocalPart())) {
                                    readIntentMap(reader, policySet, qualifiedIntent, context);
                                } else {
                                    error(monitor,
                                          "IntentMapDoesNotMatch",
                                          providedIntent,
                                          providedIntent,
                                          qualifierName,
                                          policySet);
                                    //throw new ContributionReadException("Intent provided by IntentMap " +
                                    //providedIntent + " does not match parent qualifier " + qualifierName +
                                    //" in policyset - " + policySet);
                                }
                            } else {
                                Object extension = extensionProcessor.read(reader, context);
                                if (extension != null && qualifier != null) {
                                    PolicyExpression exp = policyFactory.createPolicyExpression();
                                    exp.setName(name);
                                    exp.setPolicy(extension);
                                    qualifier.getPolicies().add(exp);
                                }
                            }
                            break;
                        }
                    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.Qualifier

            String qualifierName = null;
            String qualfiedIntentName = null;
            Intent qualifiedIntent = null;

            Qualifier qualifier = null;

            int event = reader.getEventType();
            try {
                reader.next();
                while (reader.hasNext()) {
                    event = reader.getEventType();
                    switch (event) {
                        case START_ELEMENT: {
                            name = reader.getName();
                            if (POLICY_INTENT_MAP_QUALIFIER_QNAME.equals(name)) {
                                qualifierName = getString(reader, NAME);
                                if (qualifierName != null) {
                                    qualfiedIntentName =
                                        mappedIntent.getName().getLocalPart() + QUALIFIER + qualifierName;
                                    qualifiedIntent = policyFactory.createIntent();
                                    qualifiedIntent.setName(new QName(mappedIntent.getName().getNamespaceURI(),
                                                                      qualfiedIntentName));
                                    qualifier = policyFactory.createQualifier();
                                    qualifier.setIntent(qualifiedIntent);
                                    intentMap.getQualifiers().add(qualifier);

                                } else {
                                    error(monitor, "QualifierNameMissing", reader, policySet.getName());
                                }
                            } else if (POLICY_INTENT_MAP_QNAME.equals(name)) {
                                QName providedIntent = getQName(reader, PROVIDES);
                                if (qualifierName.equals(providedIntent.getLocalPart())) {
                                    readIntentMap(reader, policySet, qualifiedIntent, context);
                                } else {
                                    error(monitor,
                                          "IntentMapDoesNotMatch",
                                          providedIntent,
                                          providedIntent,
                                          qualifierName,
                                          policySet);
                                    //throw new ContributionReadException("Intent provided by IntentMap " +
                                    //providedIntent + " does not match parent qualifier " + qualifierName +
                                    //" in policyset - " + policySet);
                                }
                            } else {
                                Object extension = extensionProcessor.read(reader, context);
                                if (extension != null && qualifier != null) {
                                    PolicyExpression exp = policyFactory.createPolicyExpression();
                                    exp.setName(name);
                                    exp.setPolicy(extension);
                                    qualifier.getPolicies().add(exp);
                                }
                            }
                            break;
                        }
                    }
View Full Code Here

Examples of org.oasisopen.sca.annotation.Qualifier

            } else {
                qname = new QName(intentAnnotation.targetNamespace(), intentAnnotation.localPart());
            }
            Set<String> qualifiers = new HashSet<String>();
            for(Method m: a.annotationType().getMethods()) {
                Qualifier qualifier = m.getAnnotation(Qualifier.class);
                if (qualifier != null && m.getReturnType() == String[].class) {
                    try {
                        qualifiers.addAll(Arrays.asList((String[]) m.invoke(a)));
                    } catch (Throwable e) {
                        e.printStackTrace();
View Full Code Here

Examples of org.oasisopen.sca.annotation.Qualifier

            } else {
                qname = new QName(intentAnnotation.targetNamespace(), intentAnnotation.localPart());
            }
            Set<String> qualifiers = new HashSet<String>();
            for (Method m : a.annotationType().getMethods()) {
                Qualifier qualifier = m.getAnnotation(Qualifier.class);
                if (qualifier != null && m.getReturnType() == String[].class) {
                    try {
                        qualifiers.addAll(Arrays.asList((String[])m.invoke(a)));
                    } catch (Throwable e) {
                        e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.