minor refactoring according to the comments
This commit is contained in:
parent
97c7db0965
commit
16e24db293
@ -153,7 +153,7 @@ public class DefaultTbApiUsageStateService extends AbstractPartitionBasedService
|
||||
List<TransportProtos.UsageStatsServiceMsg> msgs;
|
||||
|
||||
//For backward compatibility, remove after release
|
||||
if (serviceMsg.getTenantIdMSB() != 0) {
|
||||
if (serviceMsg.getMsgsList().isEmpty()) {
|
||||
TransportProtos.UsageStatsServiceMsg oldMsg = TransportProtos.UsageStatsServiceMsg.newBuilder()
|
||||
.setTenantIdMSB(serviceMsg.getTenantIdMSB())
|
||||
.setTenantIdLSB(serviceMsg.getTenantIdLSB())
|
||||
@ -211,7 +211,7 @@ public class DefaultTbApiUsageStateService extends AbstractPartitionBasedService
|
||||
if (StringUtils.isNotEmpty(statsItem.getKey())) {
|
||||
recordKey = ApiUsageRecordKey.valueOf(statsItem.getKey());
|
||||
} else {
|
||||
recordKey = ProtoUtils.fromProto(statsItem.getKeyProto());
|
||||
recordKey = ProtoUtils.fromProto(statsItem.getRecordKey());
|
||||
}
|
||||
|
||||
StatsCalculationResult calculationResult = usageState.calculate(recordKey, statsItem.getValue(), serviceId);
|
||||
|
||||
@ -1737,7 +1737,7 @@ message ToTransportMsg {
|
||||
message UsageStatsKVProto {
|
||||
string key = 1 [deprecated=true];
|
||||
int64 value = 2;
|
||||
ApiUsageRecordKeyProto keyProto = 3;
|
||||
ApiUsageRecordKeyProto recordKey = 3;
|
||||
}
|
||||
|
||||
message ToUsageStatsServiceMsg {
|
||||
|
||||
@ -119,7 +119,7 @@ public class DefaultTbApiUsageReportClient implements TbApiUsageReportClient {
|
||||
});
|
||||
|
||||
UsageStatsKVProto.Builder statsItem = UsageStatsKVProto.newBuilder()
|
||||
.setKeyProto(ProtoUtils.toProto(key))
|
||||
.setRecordKey(ProtoUtils.toProto(key))
|
||||
.setValue(value);
|
||||
statsMsg.addValues(statsItem.build());
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user