Exemplo n.º 1
0
  /**
   * Add a partition to a collection of partitions associated with this message
   *
   * @param partitionName the partition name to add
   */
  public void addPartitionName(String partitionName) {
    if (_record.getListField(Attributes.PARTITION_NAME.toString()) == null) {
      _record.setListField(Attributes.PARTITION_NAME.toString(), new ArrayList<String>());
    }

    List<String> partitionNames = _record.getListField(Attributes.PARTITION_NAME.toString());
    if (!partitionNames.contains(partitionName)) {
      partitionNames.add(partitionName);
    }
  }
Exemplo n.º 2
0
 /**
  * Get a list of partitions associated with this message
  *
  * @return list of partition ids
  */
 public List<PartitionId> getPartitionIds() {
   List<String> partitionNames = _record.getListField(Attributes.PARTITION_NAME.toString());
   if (partitionNames == null) {
     return Collections.emptyList();
   }
   List<PartitionId> partitionIds = Lists.newArrayList();
   for (String partitionName : partitionNames) {
     partitionIds.add(PartitionId.from(partitionName));
   }
   return partitionIds;
 }
Exemplo n.º 3
0
 /**
  * Get a list of partitions associated with this message
  *
  * @return list of partition ids
  */
 public List<String> getPartitionNames() {
   return _record.getListField(Attributes.PARTITION_NAME.toString());
 }
Exemplo n.º 4
0
 /**
  * Get the resource partition associated with this message
  *
  * @return partition id
  */
 public String getPartitionName() {
   return _record.getSimpleField(Attributes.PARTITION_NAME.toString());
 }
Exemplo n.º 5
0
 /**
  * Set the id of the partition this message concerns
  *
  * @param partitionId
  */
 public void setPartitionName(String partitionName) {
   _record.setSimpleField(Attributes.PARTITION_NAME.toString(), partitionName);
 }