Copyright (C) 2014 UpSwell LLC (email@example.com)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
Represents a discrete shard belonging to a named counter.
An individual shard is written to infrequently to allow the counter in aggregate to be incremented rapidly.
Default Constructor for Objectify
- Use the param-based constructors instead.
- The last dateTime that an increment occurred.
Set the amount of this shard with a new
Helper method to set the internal identifier for this entity.
shardNumber A unique identifier to distinguish shards for the same
counterName from each other.
"CounterData Names may not be null, blank, or empty!");
Preconditions.checkArgument(shardNumber >= 0, "shardNumber must be greater than or equal to 0!");
. Keys for this entity are not "parented" so that they can be added
under high volume load in a given application. Note that CounterData will be in a namespace specific.