コード例 #1
0
 /**
  * Construct a ShardedSubcriteriaImpl
  *
  * @param shards the shards that we're aware of
  * @param parent our parent
  */
 public ShardedSubcriteriaImpl(List<Shard> shards, ShardedCriteria parent) {
   Preconditions.checkNotNull(shards);
   Preconditions.checkNotNull(parent);
   Preconditions.checkArgument(!shards.isEmpty());
   this.shards = shards;
   this.parent = parent;
   // let's set up our maps
   for (Shard shard : shards) {
     shardToCriteriaMap.put(shard, null);
     shardToEventListMap.put(shard, Lists.<CriteriaEvent>newArrayList());
   }
 }
コード例 #2
0
  /**
   * Construct a BaseHasShardIdList. {@link List} cannot be empty
   *
   * @param shardIds the {@link ShardId}s
   */
  protected BaseHasShardIdList(final List<ShardId> shardIds) {
    Preconditions.checkNotNull(shardIds);
    Preconditions.checkArgument(!shardIds.isEmpty());

    // make our own copy to be safe
    this.shardIds = new ArrayList<ShardId>(shardIds);
  }