Fixing a metrics bug
This commit is contained in:
parent
bdec3bd66d
commit
4a323b8f1c
2 changed files with 5 additions and 4 deletions
|
|
@ -163,7 +163,6 @@ public class Lease {
|
||||||
pendingCheckpointState(lease.pendingCheckpointState);
|
pendingCheckpointState(lease.pendingCheckpointState);
|
||||||
parentShardIds(lease.parentShardIds);
|
parentShardIds(lease.parentShardIds);
|
||||||
childShardIds(lease.childShardIds);
|
childShardIds(lease.childShardIds);
|
||||||
hashKeyRange(lease.hashKeyRangeForLease);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -283,7 +282,7 @@ public class Lease {
|
||||||
* Set the hash range key for this shard.
|
* Set the hash range key for this shard.
|
||||||
* @param hashKeyRangeForLease
|
* @param hashKeyRangeForLease
|
||||||
*/
|
*/
|
||||||
public void hashKeyRange(final HashKeyRangeForLease hashKeyRangeForLease) {
|
public void hashKeyRange(HashKeyRangeForLease hashKeyRangeForLease) {
|
||||||
if (this.hashKeyRangeForLease == null) {
|
if (this.hashKeyRangeForLease == null) {
|
||||||
this.hashKeyRangeForLease = hashKeyRangeForLease;
|
this.hashKeyRangeForLease = hashKeyRangeForLease;
|
||||||
} else if (!this.hashKeyRangeForLease.equals(hashKeyRangeForLease)) {
|
} else if (!this.hashKeyRangeForLease.equals(hashKeyRangeForLease)) {
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ public class DynamoDBLeaseRenewer implements LeaseRenewer {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateLease(Lease lease, UUID concurrencyToken, @NonNull String operation, String shardId)
|
public boolean updateLease(Lease lease, UUID concurrencyToken, @NonNull String operation, String shardId)
|
||||||
throws DependencyException, InvalidStateException, ProvisionedThroughputException {
|
throws DependencyException, InvalidStateException, ProvisionedThroughputException {
|
||||||
verifyNotNull(lease, "lease cannot be null");
|
verifyNotNull(lease, "lease cannot be null");
|
||||||
verifyNotNull(lease.leaseKey(), "leaseKey cannot be null");
|
verifyNotNull(lease.leaseKey(), "leaseKey cannot be null");
|
||||||
|
|
@ -302,8 +302,10 @@ public class DynamoDBLeaseRenewer implements LeaseRenewer {
|
||||||
if(lease instanceof MultiStreamLease) {
|
if(lease instanceof MultiStreamLease) {
|
||||||
MetricsUtil.addStreamId(scope,
|
MetricsUtil.addStreamId(scope,
|
||||||
StreamIdentifier.multiStreamInstance(((MultiStreamLease) lease).streamIdentifier()));
|
StreamIdentifier.multiStreamInstance(((MultiStreamLease) lease).streamIdentifier()));
|
||||||
|
MetricsUtil.addShardId(scope, ((MultiStreamLease) lease).shardId());
|
||||||
|
} else {
|
||||||
|
MetricsUtil.addShardId(scope, shardId);
|
||||||
}
|
}
|
||||||
MetricsUtil.addShardId(scope, shardId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue