public void setPrimary(boolean flag) {
    boolean old = isPrimary;
    isPrimary = flag;
    if (flag) {// fix for #41878
      // since it's primary queue now, we will disable the EntryExpiryTask
      disableEntryExpiryTasks();
    }
    if (old != isPrimary) {
      region.sendProfileUpdate();
    }
  }
Set whether the dispatcher of this node is active or not (i.e. primary or secondary node). If
{@code flag} is set to {@code true}, disables Entry Expiry Tasks.

@param flag the value to set isPrimary to
geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java