Skip to content
Permalink
Browse files
[NO ISSUE][STO] Log index ref registration and removal
- user model changes: no
- storage format changes: no
- interface changes: no

Change-Id: I95f8565780675798393d7d43c0051c04e2b0a98c
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/15225
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
  • Loading branch information
mhubail committed Feb 11, 2022
1 parent 706406d commit f3d8e9c1cd25f9bcc820f49a16645458c50aa21e
Showing 2 changed files with 8 additions and 0 deletions.
@@ -195,12 +195,14 @@ public synchronized Map<Long, IndexInfo> getIndexes() {
public synchronized void addIndex(long resourceID, IndexInfo indexInfo) {
indexes.put(resourceID, indexInfo);
partitionIndexes.computeIfAbsent(indexInfo.getPartition(), partition -> new HashSet<>()).add(indexInfo);
LOGGER.debug("registered reference to index {}", indexInfo);
}

public synchronized void removeIndex(long resourceID) {
IndexInfo info = indexes.remove(resourceID);
if (info != null) {
partitionIndexes.get(info.getPartition()).remove(info);
LOGGER.debug("removed reference to index {}", info);
}
}

@@ -55,4 +55,10 @@ public int getDatasetId() {
public LocalResource getLocalResource() {
return localResource;
}

@Override
public String toString() {
return "IndexInfo{" + "index=" + index + ", datasetId=" + datasetId + ", resourceId=" + resourceId
+ ", partition=" + partition + ", localResource=" + localResource + '}';
}
}

0 comments on commit f3d8e9c

Please sign in to comment.