deleteManagedObject : Report space usage reduce for a managed object (archive batch vector party).
(table string, shard, batchID, columnID int)
| 340 | |
| 341 | // deleteManagedObject : Report space usage reduce for a managed object (archive batch vector party). |
| 342 | func (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. |
| 371 | func (h *hostMemoryManager) handleColumnPreloadingDaysChange(j preloadJob) { |
no test coverage detected