@@ -129,19 +129,19 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
129
129
} else {
130
130
tryLinkMatching(callerId, compType) match {
131
131
case Success (instance) =>
132
- log.info (s " Matching finished: First try yielded result $instance. " )
132
+ log.debug (s " Matching finished: First try yielded result $instance. " )
133
133
(OperationResult .Ok , Success (instance))
134
134
case Failure (ex) =>
135
135
log.warning(s " Matching pending: First try failed, message was ${ex.getMessage}" )
136
136
tryLabelMatching(callerId, compType) match {
137
137
case Success (instance) =>
138
- log.info (s " Matching finished: Second try yielded result $instance. " )
138
+ log.debug (s " Matching finished: Second try yielded result $instance. " )
139
139
(OperationResult .Ok , Success (instance))
140
140
case Failure (ex2) =>
141
141
log.warning(s " Matching pending: Second try failed, message was ${ex2.getMessage}" )
142
142
tryDefaultMatching(compType) match {
143
143
case Success (instance) =>
144
- log.info (s " Matching finished: Default matching yielded result $instance. " )
144
+ log.debug (s " Matching finished: Default matching yielded result $instance. " )
145
145
(OperationResult .Ok , Success (instance))
146
146
case Failure (ex3) =>
147
147
log.warning(s " Matching failed: Default matching did not yield result, message was ${ex3.getMessage}. " )
@@ -228,7 +228,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
228
228
instanceDao.setStateFor(matchedInstanceId, InstanceState .NotReachable )
229
229
fireStateChangedEvent(instanceDao.getInstance(matchedInstanceId).get) // Re-retrieve instance bc reference was invalidated by 'setStateFor'
230
230
}
231
- log.info (s " Applied matching result $matchingSuccess to instance with id $matchedInstanceId. " )
231
+ log.debug (s " Applied matching result $matchingSuccess to instance with id $matchedInstanceId. " )
232
232
233
233
// Update link state
234
234
if (! matchingSuccess) {
@@ -269,13 +269,13 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
269
269
270
270
deployResult match {
271
271
case Failure (ex) =>
272
- log.error (s " Failed to deploy container, docker host not reachable. " )
272
+ log.warning (s " Failed to deploy container, docker host not reachable. " )
273
273
instanceDao.removeInstance(id)
274
274
fireDockerOperationErrorEvent(None , s " Deploy failed with message: ${ex.getMessage}" )
275
275
Failure (new RuntimeException (s " Failed to deploy container, docker host not reachable ( ${ex.getMessage}). " ))
276
276
case Success ((dockerId, host, port)) =>
277
277
val normalizedHost = host.substring(1 , host.length - 1 )
278
- log.info(s " Deployed new ' $componentType' container with docker id: $dockerId, host: $normalizedHost and port: $port. " )
278
+ log.info(s " Deployed new $componentType container with docker id: $dockerId, host: $normalizedHost and port: $port. " )
279
279
280
280
val newInstance = Instance (Some (id),
281
281
normalizedHost,
@@ -419,7 +419,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
419
419
} else {
420
420
val instance = instanceDao.getInstance(id).get
421
421
if (instance.instanceState == InstanceState .Running ) {
422
- log.info (s " Handling /pause for instance with id $id... " )
422
+ log.debug (s " Handling /pause for instance with id $id... " )
423
423
implicit val timeout : Timeout = configuration.dockerOperationTimeout
424
424
425
425
(dockerActor ? pause(instance.dockerId.get)).map {
@@ -455,7 +455,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
455
455
} else {
456
456
val instance = instanceDao.getInstance(id).get
457
457
if (instance.instanceState == InstanceState .Paused ) {
458
- log.info (s " Handling /resume for instance with id $id... " )
458
+ log.debug (s " Handling /resume for instance with id $id... " )
459
459
implicit val timeout : Timeout = configuration.dockerOperationTimeout
460
460
461
461
(dockerActor ? unpause(instance.dockerId.get)).map {
@@ -493,7 +493,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
493
493
log.warning(s " Cannot stop instance of type ${instance.componentType}. " )
494
494
OperationResult .InvalidTypeForOperation
495
495
} else {
496
- log.info (s " Calling /stop on non-docker instance $instance.. " )
496
+ log.debug (s " Calling /stop on non-docker instance $instance.. " )
497
497
RestClient .executePost(RestClient .getUri(instance) + " /stop" ).map {
498
498
response =>
499
499
log.info(s " Request to /stop returned $response" )
@@ -751,13 +751,13 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
751
751
* @return Try[Instance], Success if matching was successful, Failure otherwise
752
752
*/
753
753
private def tryLinkMatching (callerId : Long , componentType : ComponentType ): Try [Instance ] = {
754
- log.info (s " Matching first try: Analyzing links for $callerId... " )
754
+ log.debug (s " Matching first try: Analyzing links for $callerId... " )
755
755
756
756
val links = instanceDao.getLinksFrom(callerId).filter(link => link.linkState == LinkState .Assigned )
757
757
758
758
links.size match {
759
759
case 0 =>
760
- log.info (s " Matching first try failed: No links present. " )
760
+ log.debug (s " Matching first try failed: No links present. " )
761
761
Failure (new RuntimeException (" No links for instance." ))
762
762
case 1 =>
763
763
val instanceAssigned = instanceDao.getInstance(links.head.idTo)
@@ -817,13 +817,13 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
817
817
* @return Success(Instance) if successful, Failure otherwise.
818
818
*/
819
819
private def tryLabelMatching (callerId : Long , componentType : ComponentType ): Try [Instance ] = {
820
- log.info (s " Matching second try: Analyzing labels for $callerId... " )
820
+ log.debug (s " Matching second try: Analyzing labels for $callerId... " )
821
821
822
822
val possibleMatches = instanceDao.getInstancesOfType(componentType)
823
823
824
824
possibleMatches.size match {
825
825
case 0 =>
826
- log.warning (s " Matching second try failed: There are no instances of type $componentType present. " )
826
+ log.debug (s " Matching second try failed: There are no instances of type $componentType present. " )
827
827
Failure (new RuntimeException (s " Type $componentType not present. " ))
828
828
case _ =>
829
829
val labels = instanceDao.getInstance(callerId).get.labels
@@ -839,17 +839,17 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
839
839
log.info(s " Finished matching second try: Successfully matched to $result based on $noOfSharedLabels shared labels. " )
840
840
Success (result)
841
841
} else {
842
- log.warning (s " Matching second try failed: There are no instance with shared labels to $labels. " )
842
+ log.debug (s " Matching second try failed: There are no instance with shared labels to $labels. " )
843
843
Failure (new RuntimeException (s " No instance with shared labels. " ))
844
844
}
845
845
}
846
846
}
847
847
848
848
private def tryDefaultMatching (componentType : ComponentType ): Try [Instance ] = {
849
- log.info (s " Matching fallback: Searching for instances of type $componentType ... " )
849
+ log.debug (s " Matching fallback: Searching for instances of type $componentType ... " )
850
850
getNumberOfInstances(componentType) match {
851
851
case 0 =>
852
- log.error (s " Matching failed: Cannot match to any instance of type $componentType, no such instance present. " )
852
+ log.warning (s " Matching failed: Cannot match to any instance of type $componentType, no such instance present. " )
853
853
Failure (new RuntimeException (s " Cannot match to any instance of type $componentType, no instance present. " ))
854
854
case 1 =>
855
855
val instance : Instance = instanceDao.getInstancesOfType(componentType).head
0 commit comments