/** * 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); } }