MCPcopy
hub / github.com/uber/aresdb / AdditionUpdate

Function AdditionUpdate

memstore/common/upsert_batch_builder.go:451–470  ·  view source on GitHub ↗
(oldValue, newValue unsafe.Pointer, dataType DataType)

Source from the content-addressed store, hash-verified

449}
450
451func AdditionUpdate(oldValue, newValue unsafe.Pointer, dataType DataType) {
452 switch dataType {
453 case Int8:
454 *(*int8)(oldValue) = *(*int8)(oldValue) + *(*int8)(newValue)
455 case Uint8:
456 *(*uint8)(oldValue) = *(*uint8)(oldValue) + *(*uint8)(newValue)
457 case Int16:
458 *(*int16)(oldValue) = *(*int16)(oldValue) + *(*int16)(newValue)
459 case Uint16:
460 *(*uint16)(oldValue) = *(*uint16)(oldValue) + *(*uint16)(newValue)
461 case Int32:
462 *(*int32)(oldValue) = *(*int32)(oldValue) + *(*int32)(newValue)
463 case Uint32:
464 *(*uint32)(oldValue) = *(*uint32)(oldValue) + *(*uint32)(newValue)
465 case Int64:
466 *(*int64)(oldValue) = *(*int64)(oldValue) + *(*int64)(newValue)
467 case Float32:
468 *(*float32)(oldValue) = *(*float32)(oldValue) + *(*float32)(newValue)
469 }
470}
471
472// MinMaxUpdate update the old value if compareRes == expectedRes
473func MinMaxUpdate(oldValue, newValue unsafe.Pointer, dataType DataType, cmpFunc CompareFunc, expectedRes int) {

Callers 2

writeBatchRecordsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected