Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Cavalcante
cloudsimplus
Commits
08313dee
Commit
08313dee
authored
Jul 03, 2018
by
Eduardo Falcão
Browse files
fixing allocation variable of shared provisioner
parent
887a7ae9
Changes
2
Hide whitespace changes
Inline
Side-by-side
cloudsim-plus/src/main/java/org/cloudbus/cloudsim/provisioners/ResourceProvisionerShared.java
View file @
08313dee
...
...
@@ -118,16 +118,21 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
class
VmRequestedAllocated
implements
Comparable
<
VmRequestedAllocated
>{
private
Vm
vm
;
private
L
ong
prevAllocated
,
requested
,
newCapacity
;
private
l
ong
prevAllocated
,
requested
,
newCapacity
;
public
VmRequestedAllocated
(
Vm
vm
,
L
ong
requested
,
L
ong
newCapacity
)
{
public
VmRequestedAllocated
(
Vm
vm
,
l
ong
requested
,
l
ong
newCapacity
)
{
super
();
this
.
vm
=
vm
;
this
.
requested
=
requested
;
this
.
prevAllocated
=
requested
;
this
.
prevAllocated
=
vm
.
getResource
(
getResourceClass
()).
getAllocatedResource
()
;
this
.
newCapacity
=
newCapacity
;
}
@Override
public
String
toString
()
{
return
"Vm id="
+
vm
.
getId
()+
", requested="
+
requested
+
", prevAllocated="
+
prevAllocated
+
", newCapacity="
+
newCapacity
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
return
vm
.
equals
(
obj
);
...
...
@@ -151,7 +156,7 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
this
.
vm
=
vm
;
}
public
L
ong
getRequested
()
{
public
l
ong
getRequested
()
{
return
requested
;
}
...
...
@@ -163,19 +168,19 @@ public class ResourceProvisionerShared extends ResourceProvisionerAbstract {
this
.
requested
-=
requested
;
}
public
L
ong
getNewCapacity
()
{
public
l
ong
getNewCapacity
()
{
return
newCapacity
;
}
public
void
setNewCapacity
(
L
ong
newCapacity
)
{
public
void
setNewCapacity
(
l
ong
newCapacity
)
{
this
.
newCapacity
=
newCapacity
;
}
public
void
addNewCapacity
(
L
ong
extraCapacity
)
{
public
void
addNewCapacity
(
l
ong
extraCapacity
)
{
this
.
newCapacity
+=
extraCapacity
;
}
public
L
ong
getPrevAllocated
()
{
public
l
ong
getPrevAllocated
()
{
return
prevAllocated
;
}
...
...
cloudsim-plus/src/test/java/org/cloudsimplus/integrationtests/VmCreationFailureIntegrationTest.java
View file @
08313dee
...
...
@@ -203,7 +203,7 @@ public final class VmCreationFailureIntegrationTest {
final
BrokerBuilderDecorator
brokerBuilder
=
scenario
.
getBrokerBuilder
().
createBroker
();
brokerBuilder
.
getVmBuilder
()
.
setRam
(
512
).
setBw
(
1000
).
setIops
(
100
)
.
setRam
(
512
).
setBw
(
1000
).
setIops
(
100
0
)
.
setPes
(
1
).
setMips
(
1000
).
setSize
(
10000
)
.
setCloudletSchedulerSupplier
(()
->
new
CloudletSchedulerSpaceShared
())
.
setOnHostAllocationListener
(
evt
->
onHostAllocation
(
evt
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment