[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16459745#comment-16459745
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

rhtyd commented on issue #2599: CLOUDSTACK-10363: Change method names.
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-385696223
 
 
   This is a pure name refactoring with no effective overall logic/code 
changed. Merging this based on Travis pass and reviews by others.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-05-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16459746#comment-16459746
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

rhtyd closed pull request #2599: CLOUDSTACK-10363: Change method names.
URL: https://github.com/apache/cloudstack/pull/2599
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
 
b/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index 3ce96a677fb..174f1f300cf 100644
--- 
a/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ 
b/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -482,7 +482,7 @@ private AsyncJobDispatcher getDispatcher(String 
dispatcherName) {
 throw new CloudRuntimeException("Unable to find dispatcher name: " + 
dispatcherName);
 }
 
-private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
+private AsyncJobDispatcher findWakeupDispatcher(AsyncJob job) {
 if (_jobDispatchers != null) {
 List joinRecords = 
_joinMapDao.listJoinRecords(job.getId());
 if (joinRecords.size() > 0) {
@@ -567,7 +567,7 @@ protected void runInContext() {
 }
 
 if ((getAndResetPendingSignals(job) & 
AsyncJob.Constants.SIGNAL_MASK_WAKEUP) != 0) {
-AsyncJobDispatcher jobDispatcher = 
getWakeupDispatcher(job);
+AsyncJobDispatcher jobDispatcher = 
findWakeupDispatcher(job);
 if (jobDispatcher != null) {
 jobDispatcher.runJob(job);
 } else {
diff --git 
a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java
 
b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java
index cde4ee8a797..aa7c0f6d1b2 100644
--- 
a/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java
+++ 
b/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/OvsTunnelManagerImpl.java
@@ -212,7 +212,7 @@ private void handleCreateTunnelAnswer(Answer[] answers) {
 Long from = r.getFrom();
 Long to = r.getTo();
 long networkId = r.getNetworkId();
-OvsTunnelNetworkVO tunnel = _tunnelNetworkDao.getByFromToNetwork(from, 
to, networkId);
+OvsTunnelNetworkVO tunnel = 
_tunnelNetworkDao.findByFromToNetwork(from, to, networkId);
 if (tunnel == null) {
 throw new CloudRuntimeException(
 String.format("Unable find tunnelNetwork record" +
@@ -321,7 +321,7 @@ protected void checkAndCreateTunnel(Network nw, Host host) {
 if (rh == hostId) {
 continue;
 }
-OvsTunnelNetworkVO ta = 
_tunnelNetworkDao.getByFromToNetwork(hostId, rh.longValue(), nw.getId());
+OvsTunnelNetworkVO ta = 
_tunnelNetworkDao.findByFromToNetwork(hostId, rh.longValue(), nw.getId());
 // Try and create the tunnel even if a previous attempt failed
 if (ta == null || 
ta.getState().equals(OvsTunnel.State.Failed.name())) {
 s_logger.debug("Attempting to create tunnel from:" + hostId + 
" to:" + rh.longValue());
@@ -333,7 +333,7 @@ protected void checkAndCreateTunnel(Network nw, Host host) {
 }
 }
 
-ta = _tunnelNetworkDao.getByFromToNetwork(rh.longValue(),
+ta = _tunnelNetworkDao.findByFromToNetwork(rh.longValue(),
 hostId, nw.getId());
 // Try and create the tunnel even if a previous attempt failed
 if (ta == null || 
ta.getState().equals(OvsTunnel.State.Failed.name())) {
@@ -605,7 +605,7 @@ protected void checkAndCreateVpcTunnelNetworks(Host host, 
long vpcId) {
 if (rh == hostId) {
 continue;
 }
-tunnelRecord = _tunnelNetworkDao.getByFromToNetwork(hostId, 
rh.longValue(), vpcNetwork.getId());
+tunnelRecord = _tunnelNetworkDao.findByFromToNetwork(hostId, 
rh.longValue(), vpcNetwork.getId());
 // Try and create the tunnel if does not exit or previous 
attempt failed
 if (tunnelRecord == null || 
tunnelRecord.getState().equals(OvsTunnel.State.Failed.name())) {
 s_logger.debug("Attempting to create tunnel from:" + 
hostId + " to:" + rh.longValue());
@@ -616,7 +616,7 @@ protected void checkAndCreateVpcTunnelNetworks(Host host, 
long vpcId) {
  

[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-05-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16459747#comment-16459747
 ] 

ASF subversion and git services commented on CLOUDSTACK-10363:
--

Commit 2c681b8c5f253ae6e78314ac6f5bc3b1863bec4c in cloudstack's branch 
refs/heads/master from [~BruceKuiLIU]
[ https://gitbox.apache.org/repos/asf?p=cloudstack.git;h=2c681b8 ]

CLOUDSTACK-10363: refactor the "getXXX" and "listXXX" method names to "findXXX" 
(#2599)

These three methods are not direct getter or list.
They try to find the target objects with the related arguments.
So that, renaming them as "findXXX" should be more intuitive.

> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-04-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16454197#comment-16454197
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

BruceKuiLiu commented on issue #2599: CLOUDSTACK-10363: Change method names.
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-384642781
 
 
   @rafaelweingartner Thanks.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449715#comment-16449715
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

nitin-maharana commented on issue #2599: CLOUDSTACK-10363: Change the "getXXX" 
and "listXXX" method names to "…
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-383906750
 
 
   I think it would be good to merge them into one. Let's wait for others view.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449706#comment-16449706
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

nitin-maharana commented on issue #2599: CLOUDSTACK-10363: Change the "getXXX" 
and "listXXX" method names to "…
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-383903358
 
 
   Hi @BruceKuiLiu, Thanks for the change, now the method names are more 
meaningful. Would be nice if you club all the similar PRs to one. (#2599, 
#2600, #2601, #2602)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449704#comment-16449704
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

BruceKuiLiu commented on issue #2599: CLOUDSTACK-10363: Change the "getXXX" and 
"listXXX" method names to "…
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-383904258
 
 
   Hi @nitin-maharana ,
   I think that #2600, #2061, #2602 can be classified into three different 
changes.
   If it is necessary, I will merge them into one commit.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449699#comment-16449699
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

nitin-maharana commented on issue #2599: CLOUDSTACK-10363: Change the "getXXX" 
and "listXXX" method names to "…
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-383903358
 
 
   Hi @BruceKuiLiu, Thanks for the change, now the method names are more 
meaningful. Would be nice if you club all the similar PRs to one. (#2600, 
#2601, #2602)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CLOUDSTACK-10363) Inconsistent "getXXX" and "listXXX" method names.

2018-04-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16449533#comment-16449533
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10363:
-

BruceKuiLiu opened a new pull request #2599: CLOUDSTACK-10363: Change the 
"getXXX" and "listXXX" method names to "…
URL: https://github.com/apache/cloudstack/pull/2599
 
 
   …findXXX".
   
   These three methods are not direct getter or list.
   They try to find the target objects with the related arguments.
   So that, renaming them as "findXXX" should be more intuitive.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Inconsistent "getXXX" and "listXXX" method names.
> -
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>Reporter: KuiLIU
>Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List listActiveCommands(long dcId, Date 
> cutTime) {
> SearchCriteria sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List joinRecords = 
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if 
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for 
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)