Package com.google.cloud.spanner.watcher
Class TimebasedShardProvider.TimebasedShardId
- java.lang.Object
-
- com.google.cloud.spanner.watcher.TimebasedShardProvider.TimebasedShardId
-
- Enclosing class:
- TimebasedShardProvider
public static final class TimebasedShardProvider.TimebasedShardId extends Object
A generated timebased shard id that has been fetched from Cloud Spanner.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.cloud.spanner.ValuegetValue()Returns theValuethat should be used to set on aMutationwhen an insert/update is sent to the database.booleanshouldRefresh()Returns true if thisTimebasedShardProvider.TimebasedShardIdshould be refreshed based on the current system time.
-
-
-
Method Detail
-
shouldRefresh
public boolean shouldRefresh()
Returns true if thisTimebasedShardProvider.TimebasedShardIdshould be refreshed based on the current system time. This method depends on the current system time. If the system time is too much out of sync with the actual time, it can return invalid values. A system time that is less than 10 seconds out of sync is not a problem.
-
getValue
public com.google.cloud.spanner.Value getValue()
Returns theValuethat should be used to set on aMutationwhen an insert/update is sent to the database.
-
-