FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cloudstack/api/src/com/cloud/vm/DiskProfile.java at vmsync · kwanggithub/cloudstack · GitHub
This repository was archived by the owner on Jan 15, 2020. It is now read-only.
kwanggithub
/
cloudstack
Public archive
forked from
apache/cloudstack
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cloudstack
/
api
/
src
/
com
/
cloud
/
vm
/
DiskProfile.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
193 lines (161 loc) · 5.16 KB
Breadcrumbs
cloudstack
/
api
/
src
/
com
/
cloud
/
vm
/
DiskProfile.java
Copy path
File metadata and controls
193 lines (161 loc) · 5.16 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package
com
.
cloud
.
vm
;
import
com
.
cloud
.
hypervisor
.
Hypervisor
.
HypervisorType
;
import
com
.
cloud
.
offering
.
DiskOffering
;
import
com
.
cloud
.
storage
.
Volume
;
/**
* DiskProfile describes a disk and what functionality is required from it.
* and resources to allocate and create disks. There object is immutable once
*/
public
class
DiskProfile
{
private
long
size
;
private
String
[]
tags
;
private
Volume
.
Type
type
;
private
String
name
;
private
boolean
useLocalStorage
;
private
boolean
recreatable
;
private
long
diskOfferingId
;
private
Long
templateId
;
private
long
volumeId
;
private
String
path
;
private
Long
bytesReadRate
;
private
Long
bytesWriteRate
;
private
Long
iopsReadRate
;
private
Long
iopsWriteRate
;
private
HypervisorType
hyperType
;
protected
DiskProfile
() {
}
public
DiskProfile
(
long
volumeId
,
Volume
.
Type
type
,
String
name
,
long
diskOfferingId
,
long
size
,
String
[]
tags
,
boolean
useLocalStorage
,
boolean
recreatable
,
Long
templateId
) {
this
.
type
=
type
;
this
.
name
=
name
;
this
.
size
=
size
;
this
.
tags
=
tags
;
this
.
useLocalStorage
=
useLocalStorage
;
this
.
recreatable
=
recreatable
;
this
.
diskOfferingId
=
diskOfferingId
;
this
.
templateId
=
templateId
;
this
.
volumeId
=
volumeId
;
}
public
DiskProfile
(
Volume
vol
,
DiskOffering
offering
,
HypervisorType
hyperType
) {
this
(
vol
.
getId
(),
vol
.
getVolumeType
(),
vol
.
getName
(),
offering
.
getId
(),
vol
.
getSize
(),
offering
.
getTagsArray
(),
offering
.
getUseLocalStorage
(),
offering
.
isCustomized
(),
null
);
this
.
hyperType
=
hyperType
;
}
public
DiskProfile
(
DiskProfile
dp
) {
}
/**
* @return size of the disk requested in bytes.
*/
public
long
getSize
() {
return
size
;
}
/**
* @return id of the volume backing up this disk characteristics
*/
public
long
getVolumeId
() {
return
volumeId
;
}
/**
* @return Unique name for the disk.
*/
public
String
getName
() {
return
name
;
}
/**
* @return tags for the disk. This can be used to match it to different storage pools.
*/
public
String
[]
getTags
() {
return
tags
;
}
/**
* @return type of volume.
*/
public
Volume
.
Type
getType
() {
return
type
;
}
/**
* @return Does this volume require local storage?
*/
public
boolean
useLocalStorage
() {
return
useLocalStorage
;
}
public
void
setUseLocalStorage
(
boolean
useLocalStorage
) {
this
.
useLocalStorage
=
useLocalStorage
;
}
/**
* @return Is this volume recreatable? A volume is recreatable if the disk's content can be
* reconstructed from the template.
*/
public
boolean
isRecreatable
() {
return
recreatable
;
}
/**
* @return template id the disk is based on. Can be null if it is not based on any templates.
*/
public
Long
getTemplateId
() {
return
templateId
;
}
/**
* @return disk offering id that the disk is based on.
*/
public
long
getDiskOfferingId
() {
return
diskOfferingId
;
}
@
Override
public
String
toString
() {
return
new
StringBuilder
(
"DskChr["
).
append
(
type
).
append
(
"|"
).
append
(
size
).
append
(
"|"
).
append
(
"]"
).
toString
();
}
public
void
setHyperType
(
HypervisorType
hyperType
) {
this
.
hyperType
=
hyperType
;
}
public
HypervisorType
getHypervisorType
() {
return
this
.
hyperType
;
}
public
void
setPath
(
String
path
) {
this
.
path
=
path
;
}
public
String
getPath
() {
return
this
.
path
;
}
public
void
setSize
(
long
size
) {
this
.
size
=
size
;
}
public
void
setBytesReadRate
(
Long
bytesReadRate
) {
this
.
bytesReadRate
=
bytesReadRate
;
}
public
Long
getBytesReadRate
() {
return
bytesReadRate
;
}
public
void
setBytesWriteRate
(
Long
bytesWriteRate
) {
this
.
bytesWriteRate
=
bytesWriteRate
;
}
public
Long
getBytesWriteRate
() {
return
bytesWriteRate
;
}
public
void
setIopsReadRate
(
Long
iopsReadRate
) {
this
.
iopsReadRate
=
iopsReadRate
;
}
public
Long
getIopsReadRate
() {
return
iopsReadRate
;
}
public
void
setIopsWriteRate
(
Long
iopsWriteRate
) {
this
.
iopsWriteRate
=
iopsWriteRate
;
}
public
Long
getIopsWriteRate
() {
return
iopsWriteRate
;
}
}
Back
|
FazBrowse Home
|
New Git URL