JoaoJandre commented on code in PR #8929:
URL: https://github.com/apache/cloudstack/pull/8929#discussion_r1572398700
##########
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDaoImpl.java:
##########
@@ -110,4 +167,72 @@ public ConfigKey<?>[] getConfigKeys() {
public String getConfigComponentName() {
return HostTagsDaoImpl.class.getSimpleName();
}
+
+ @Override
+ public HostTagResponse newHostTagResponse(HostTagVO tag) {
+ HostTagResponse tagResponse = new HostTagResponse();
+
+ tagResponse.setName(tag.getTag());
+ tagResponse.setHostId(tag.getHostId());
+ tagResponse.setImplicit(tag.getIsImplicit());
+
+ tagResponse.setObjectName("hosttag");
+
+ return tagResponse;
+ }
+
+ @Override
+ public List<HostTagVO> searchByIds(Long... stIds) {
+ String batchCfg = _configDao.getValue("detail.batch.query.size");
+
+ final int detailsBatchSize = batchCfg != null ?
Integer.parseInt(batchCfg) : 2000;
+
+ // query details by batches
+ List<HostTagVO> uvList = new ArrayList<HostTagVO>();
+ int curr_index = 0;
+
+ if (stIds.length > detailsBatchSize) {
+ while ((curr_index + detailsBatchSize) <= stIds.length) {
+ Long[] ids = new Long[detailsBatchSize];
+
+ for (int k = 0, j = curr_index; j < curr_index +
detailsBatchSize; j++, k++) {
+ ids[k] = stIds[j];
+ }
+
+ SearchCriteria<HostTagVO> sc = stSearch.create();
+
+ sc.setParameters("idIN", (Object[])ids);
+
+ List<HostTagVO> vms = searchIncludingRemoved(sc, null, null,
false);
Review Comment:
```suggestion
List<HostTagVO> hostTags = searchIncludingRemoved(sc, null,
null, false);
```
##########
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDaoImpl.java:
##########
@@ -110,4 +167,72 @@ public ConfigKey<?>[] getConfigKeys() {
public String getConfigComponentName() {
return HostTagsDaoImpl.class.getSimpleName();
}
+
+ @Override
+ public HostTagResponse newHostTagResponse(HostTagVO tag) {
+ HostTagResponse tagResponse = new HostTagResponse();
+
+ tagResponse.setName(tag.getTag());
+ tagResponse.setHostId(tag.getHostId());
+ tagResponse.setImplicit(tag.getIsImplicit());
+
+ tagResponse.setObjectName("hosttag");
+
+ return tagResponse;
+ }
+
+ @Override
+ public List<HostTagVO> searchByIds(Long... stIds) {
Review Comment:
what does the "st" in "stIds" mean?
##########
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDaoImpl.java:
##########
@@ -110,4 +167,72 @@ public ConfigKey<?>[] getConfigKeys() {
public String getConfigComponentName() {
return HostTagsDaoImpl.class.getSimpleName();
}
+
+ @Override
+ public HostTagResponse newHostTagResponse(HostTagVO tag) {
+ HostTagResponse tagResponse = new HostTagResponse();
+
+ tagResponse.setName(tag.getTag());
+ tagResponse.setHostId(tag.getHostId());
+ tagResponse.setImplicit(tag.getIsImplicit());
+
+ tagResponse.setObjectName("hosttag");
+
+ return tagResponse;
+ }
+
+ @Override
+ public List<HostTagVO> searchByIds(Long... stIds) {
+ String batchCfg = _configDao.getValue("detail.batch.query.size");
+
+ final int detailsBatchSize = batchCfg != null ?
Integer.parseInt(batchCfg) : 2000;
+
+ // query details by batches
+ List<HostTagVO> uvList = new ArrayList<HostTagVO>();
Review Comment:
hostTagList?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]