You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mb...@apache.org on 2022/02/15 14:25:13 UTC
[asterixdb] 01/05: [NO ISSUE][STO] Log index ref registration and removal
This is an automated email from the ASF dual-hosted git repository.
mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit f3d8e9c1cd25f9bcc820f49a16645458c50aa21e
Author: Murtadha Hubail <mu...@couchbase.com>
AuthorDate: Fri Feb 11 04:04:55 2022 +0300
[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 <al...@gmail.com>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
---
.../main/java/org/apache/asterix/common/context/DatasetInfo.java | 2 ++
.../src/main/java/org/apache/asterix/common/context/IndexInfo.java | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
index 7483a17..d15d9be 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
@@ -195,12 +195,14 @@ public class DatasetInfo extends Info implements Comparable<DatasetInfo> {
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);
}
}
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/IndexInfo.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/IndexInfo.java
index b094b6f..8b631c2 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/IndexInfo.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/IndexInfo.java
@@ -55,4 +55,10 @@ public class IndexInfo extends Info {
public LocalResource getLocalResource() {
return localResource;
}
+
+ @Override
+ public String toString() {
+ return "IndexInfo{" + "index=" + index + ", datasetId=" + datasetId + ", resourceId=" + resourceId
+ + ", partition=" + partition + ", localResource=" + localResource + '}';
+ }
}