Open topic with navigation

TIBCO GridServer® 7.1.0

# Setting Affinity Conditions Programmatically

Create Property Affinity Conditions with the `SchedulingConditionFactory`, using the `createPropertyAffinity` method.

The following example in Java code creates a `SchedulingConditionFactory`, which is then used to create a Property Affinity Condition that would add four to the affinity of any Engine-Service pairing where the Engine has two CPUs:

    SchedulingConditionFactory schedFactory =
         SchedulingConditionFactory.getInstance();
    Condition dualAffinity =
         schedFactory.createPropertyAffinity(EngineProperties.CPU_NO,
         SchedulingConditionFactory.EQUALS, "2", 4.0);

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO GridServer®

Copyright © 2001-2022. TIBCO Software Inc. All Rights Reserved.