Skip to content

Conversation

@MedvedevBW
Copy link
Collaborator

No description provided.

@MedvedevBW MedvedevBW requested a review from placccebo October 17, 2017 10:12
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 82.622% when pulling db2dc3e on CSVS-57 into fbabd40 on develop.

}
}

protected def getClient(endpoint: String): ApacheCloudStackClient = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createClient()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

val secondElement = "2"
val thirdElement = "3"

"moveElementToEnd" should "move the first element to end of the queue" in {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"moveElementToEnd" should "move the first element to the end of the queue"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

assert(expectedResult == queue.getElements)
}

"moveElementToEnd" should "not change queue if element for move is not first" in {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"moveElementToEnd" should "not change a queue if an element is not first"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 82.737% when pulling 0e3a82e on CSVS-57 into fbabd40 on develop.


val cloudStackTaskCreator = new CloudStackTaskCreator(cloudStackTaskCreatorSettings) {
override val endpointQueue = new CircleQueue[String](cloudStackTaskCreatorSettings.endpoints.toList)
override val endpointQueue = getEndPointQueue(cloudStackTaskCreatorSettings.endpoints.toList)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getEndpointQueue

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


def moveElementToEnd(element: T): Unit = synchronized {
val currentIndex = elements.indexOf(element)
if(currentIndex != -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space between "if" and condition: if (currentIndex != -1) ....

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the code below

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

class WeightedQueue[T](private val elementList: List[T]) {
protected val r = new Random

private val lengthOfArray = elementList.length
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does the name contain "array"? is it a list or array?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List

elements = elements.take(currentIndex) ++ elements.takeRight(lengthOfArray - currentIndex - 1) :+ element
}
} else {
throw new IllegalArgumentException(s"Element: $element is not included in the initialization list: $elementList")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested element doesn't exist: $element

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


private val lengthOfArray = elementList.length
private val sumOfNumbers = getSumOfNumbers(0, lengthOfArray)
private val gradeScaleElements: RangeMap[Integer, Int] = TreeRangeMap.create()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elementIndexByPossibility

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


private var elements = elementList

fillRangeMap(0, lengthOfArray, 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename method

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

}
}

private def getSumOfNumbers(acc: Int, lenght: Int): Int = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSum() = N * (first + last) / 2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 82.656% when pulling 0ed946f on CSVS-57 into fbabd40 on develop.

private val lengthOfArray = elementList.length
private val sumOfNumbers = getSumOfNumbers(0, lengthOfArray)
private val gradeScaleElements: RangeMap[Integer, Int] = TreeRangeMap.create()
private val lengthOfList = elementList.length
Copy link
Collaborator

@placccebo placccebo Oct 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just length or size

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 82.656% when pulling 6aa6710 on CSVS-57 into fbabd40 on develop.

@MedvedevBW MedvedevBW merged commit f87904a into develop Oct 19, 2017
@MedvedevBW MedvedevBW deleted the CSVS-57 branch October 19, 2017 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants