public List<FixedPartitionAttributesImpl> getSecondaryFixedPartitionAttributes_TestsOnly() { List<FixedPartitionAttributesImpl> secondaryFixedPAttrs = new LinkedList<FixedPartitionAttributesImpl>(); if (this.fixedPAttrs != null) { for (FixedPartitionAttributesImpl fpa : this.fixedPAttrs) { if (!fpa.isPrimary()) { secondaryFixedPAttrs.add(fpa); } } } return secondaryFixedPAttrs; }
public List<FixedPartitionAttributesImpl> getPrimaryFixedPartitionAttributes_TestsOnly() { List<FixedPartitionAttributesImpl> primaryFixedPAttrs = new LinkedList<FixedPartitionAttributesImpl>(); if (this.fixedPAttrs != null) { for (FixedPartitionAttributesImpl fpa : this.fixedPAttrs) { if (fpa.isPrimary()) { primaryFixedPAttrs.add(fpa); } } } return primaryFixedPAttrs; }
@Override public boolean include(final Profile profile) { if (profile instanceof PartitionProfile) { final PartitionProfile pp = (PartitionProfile) profile; List<FixedPartitionAttributesImpl> fpaList = pp.fixedPAttrs; if (fpaList != null) { for (FixedPartitionAttributesImpl fpa : fpaList) { if (fpa.isPrimary()) { remotePrimaryFPAs.add(fpa); return true; } } } } return false; } });
private boolean isLocalPrimary(String partitionName) { List<FixedPartitionAttributesImpl> FPAs = this.prRegion.getFixedPartitionAttributesImpl(); if (FPAs != null) { for (FixedPartitionAttributesImpl fpa : FPAs) { if (fpa.getPartitionName().equals(partitionName) && fpa.isPrimary()) { return true; } } } return false; }
@Override public boolean include(Profile profile) { if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile) profile; if (p.fixedPAttrs != null) { for (FixedPartitionAttributesImpl fpa : p.fixedPAttrs) { if (fpa.isPrimary() && fpa.hasBucket(bucketId)) { fixedPartitionDataStore.add(0, p.getDistributedMember()); return true; } } } } return false; } });
/** * Creates an instance of <code>FixedPartitionAttributes</code>. * * @param name Name of the fixed partition. * @param isPrimary True if this member is the primary for the partition. */ public static FixedPartitionAttributes createFixedPartition(String name, boolean isPrimary) { return new FixedPartitionAttributesImpl().setPartitionName(name).isPrimary(isPrimary) .setNumBuckets(DEFAULT_NUM_BUCKETS); }
/** * Creates an instance of <code>FixedPartitionAttributes</code>. * * @param name Name of the fixed partition. */ public static FixedPartitionAttributes createFixedPartition(String name) { return new FixedPartitionAttributesImpl().setPartitionName(name) .isPrimary(DEFAULT_PRIMARY_STATUS).setNumBuckets(DEFAULT_NUM_BUCKETS); }
/** * Creates an instance of <code>FixedPartitionAttributes</code>. * * @param name Name of the fixed partition. * @param isPrimary True if this member is the primary for the partition. * @param numBuckets Number of buckets allowed for the partition. */ public static FixedPartitionAttributes createFixedPartition(String name, boolean isPrimary, int numBuckets) { return new FixedPartitionAttributesImpl().setPartitionName(name).isPrimary(isPrimary) .setNumBuckets(numBuckets); }
/** * Creates an instance of <code>FixedPartitionAttributes</code>. * * @param name Name of the fixed partition. * @param numBuckets Number of buckets allowed for the partition. */ public static FixedPartitionAttributes createFixedPartition(String name, int numBuckets) { return new FixedPartitionAttributesImpl().setPartitionName(name) .isPrimary(DEFAULT_PRIMARY_STATUS).setNumBuckets(numBuckets); }
/** * When a <code>fixed-partition-attributes</code> element is encountered, we create an instance of * FixedPartitionAttributesImpl and add it to the PartitionAttributesImpl stack. */ private void startFixedPartitionAttributes(Attributes atts) { FixedPartitionAttributesImpl fpai = new FixedPartitionAttributesImpl(); String partitionName = atts.getValue(PARTITION_NAME); if (partitionName != null) { fpai.setPartitionName(partitionName); } String isPrimary = atts.getValue(IS_PRIMARY); if (isPrimary != null) { fpai.isPrimary(parseBoolean(isPrimary)); } String numBuckets = atts.getValue(NUM_BUCKETS); if (numBuckets != null) { fpai.setNumBuckets(parseInt(numBuckets)); } Object a = stack.peek(); if (a instanceof PartitionAttributesImpl) { ((PartitionAttributesImpl) a).addFixedPartitionAttributes(fpai); } }
if (bucket != null) { for (FixedPartitionAttributesImpl fpa : FPAs) { if (fpa.hasBucket(bucket.getId()) && fpa.isPrimary()) { Member source = bucket.getPrimary(); if (source != target) {