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

Method deleteManagedObject

memstore/host_memory_manager.go:342–368  ·  view source on GitHub ↗

deleteManagedObject : Report space usage reduce for a managed object (archive batch vector party).

(table string, shard, batchID, columnID int)

Source from the content-addressed store, hash-verified

340
341// deleteManagedObject : Report space usage reduce for a managed object (archive batch vector party).
342func (h *hostMemoryManager) deleteManagedObject(table string, shard, batchID, columnID int) {
343 h.Lock()
344 utils.GetLogger().Debugf("Trying to deleteManagedObject for table: %s, Shard: %d, batchID: %d, in %+v", table, shard, batchID, h.batchInfosByColumn)
345 tableInMemoryBatches, found := h.batchInfosByColumn[table]
346 if !found {
347 utils.GetLogger().Debugf("Not found tableInMemoryBatches for table: %s", table)
348 h.Unlock()
349 return
350 }
351 columnBatchInfos, found := tableInMemoryBatches[columnID]
352 h.Unlock()
353
354 if !found {
355 utils.GetLogger().Debugf("Not found columnBatchInfos for columnID: %s in table: %s.", columnID, table)
356 return
357 }
358 bytesChange := columnBatchInfos.DeleteManagedObject(shard, batchID)
359 utils.GetLogger().Debugf("Before deleteManagedObject managedMemorySize : %d, bytesChange : %d", h.getManagedSpaceUsage(), bytesChange)
360 atomic.AddInt64(&h.managedMemorySize, bytesChange)
361 utils.GetLogger().Debugf("After deleteManagedObject managedMemorySize : %d", h.getManagedSpaceUsage())
362 h.Lock()
363 if columnBatchInfos.batchInfoByID.Size() == 0 {
364 delete(tableInMemoryBatches, columnID)
365 }
366 h.Unlock()
367 utils.GetLogger().Debugf("deleteManagedObject(%s,%d,%d,%d), bytesChange = %d, managedMemorySize=%d\n ", table, shard, batchID, columnID, bytesChange, h.getManagedSpaceUsage())
368}
369
370// handleColumnPreloadingDaysChange handles the preloading config change for a column.
371func (h *hostMemoryManager) handleColumnPreloadingDaysChange(j preloadJob) {

Callers 1

ReportManagedObjectMethod · 0.95

Calls 7

getManagedSpaceUsageMethod · 0.95
GetLoggerFunction · 0.92
DeleteManagedObjectMethod · 0.80
DebugfMethod · 0.65
SizeMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected