Skip to content

Commit c8cafb9

Browse files
committed
CLOUDSTACK-3818: NFS Cache Improperly Named.
1 parent f5e5b39 commit c8cafb9

13 files changed

Lines changed: 75 additions & 75 deletions

File tree

api/src/com/cloud/storage/StorageService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd;
2222
import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd;
23-
import org.apache.cloudstack.api.command.admin.storage.CreateCacheStoreCmd;
23+
import org.apache.cloudstack.api.command.admin.storage.CreateSecondaryStagingStoreCmd;
2424
import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
25-
import org.apache.cloudstack.api.command.admin.storage.DeleteCacheStoreCmd;
25+
import org.apache.cloudstack.api.command.admin.storage.DeleteSecondaryStagingStoreCmd;
2626
import org.apache.cloudstack.api.command.admin.storage.DeleteImageStoreCmd;
2727
import org.apache.cloudstack.api.command.admin.storage.DeletePoolCmd;
2828
import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
@@ -50,7 +50,7 @@ public interface StorageService{
5050
StoragePool createPool(CreateStoragePoolCmd cmd) throws ResourceInUseException, IllegalArgumentException,
5151
UnknownHostException, ResourceUnavailableException;
5252

53-
ImageStore createCacheStore(CreateCacheStoreCmd cmd);
53+
ImageStore createSecondaryStagingStore(CreateSecondaryStagingStoreCmd cmd);
5454

5555
/**
5656
* Delete the storage pool
@@ -93,7 +93,7 @@ public StoragePool cancelPrimaryStorageForMaintenance(CancelPrimaryStorageMainte
9393

9494
boolean deleteImageStore(DeleteImageStoreCmd cmd);
9595

96-
boolean deleteCacheStore(DeleteCacheStoreCmd cmd);
96+
boolean deleteSecondaryStagingStore(DeleteSecondaryStagingStoreCmd cmd);
9797

9898
ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
9999

api/src/org/apache/cloudstack/api/command/admin/storage/CreateCacheStoreCmd.java renamed to api/src/org/apache/cloudstack/api/command/admin/storage/CreateSecondaryStagingStoreCmd.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,32 @@
3535
import java.util.Iterator;
3636
import java.util.Map;
3737

38-
@APICommand(name = "createCacheStore", description="create cache store.", responseObject=ImageStoreResponse.class)
39-
public class CreateCacheStoreCmd extends BaseCmd {
38+
@APICommand(name = "createSecondaryStagingStore", description = "create secondary staging store.", responseObject = ImageStoreResponse.class)
39+
public class CreateSecondaryStagingStoreCmd extends BaseCmd {
4040
public static final Logger s_logger = Logger.getLogger(AddImageStoreCmd.class.getName());
41-
private static final String s_name = "createcachestoreresponse";
41+
private static final String s_name = "createsecondarystagingstoreresponse";
4242

4343
/////////////////////////////////////////////////////
4444
//////////////// API parameters /////////////////////
4545
/////////////////////////////////////////////////////
4646

47-
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the cache store")
47+
@Parameter(name = ApiConstants.URL, type = CommandType.STRING, required = true, description = "the URL for the staging store")
4848
private String url;
4949

5050
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
51-
description="the Zone ID for the image store")
51+
description = "the Zone ID for the staging store")
5252
private Long zoneId;
5353

5454

55-
@Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the image store")
55+
@Parameter(name = ApiConstants.DETAILS, type = CommandType.MAP, description = "the details for the staging store")
5656
private Map<String, String> details;
5757

5858
@Parameter(name=ApiConstants.SCOPE, type=CommandType.STRING,
59-
required=false, description="the scope of the image store: zone only for now")
59+
required = false, description = "the scope of the staging store: zone only for now")
6060
private String scope;
6161

6262
@Parameter(name=ApiConstants.PROVIDER, type=CommandType.STRING,
63-
required=false, description="the cache store provider name")
63+
required = false, description = "the staging store provider name")
6464
private String providerName;
6565

6666
/////////////////////////////////////////////////////
@@ -75,25 +75,25 @@ public Long getZoneId() {
7575
return zoneId;
7676
}
7777

78-
public Map<String, String> getDetails() {
79-
Map<String, String> detailsMap = null;
80-
if (details != null && !details.isEmpty()) {
81-
detailsMap = new HashMap<String, String>();
82-
Collection<?> props = details.values();
83-
Iterator<?> iter = props.iterator();
84-
while (iter.hasNext()) {
85-
HashMap<String, String> detail = (HashMap<String, String>) iter.next();
86-
String key = detail.get("key");
87-
String value = detail.get("value");
88-
detailsMap.put(key, value);
89-
}
90-
}
91-
return detailsMap;
78+
public Map<String, String> getDetails() {
79+
Map<String, String> detailsMap = null;
80+
if (details != null && !details.isEmpty()) {
81+
detailsMap = new HashMap<String, String>();
82+
Collection<?> props = details.values();
83+
Iterator<?> iter = props.iterator();
84+
while (iter.hasNext()) {
85+
HashMap<String, String> detail = (HashMap<String, String>) iter.next();
86+
String key = detail.get("key");
87+
String value = detail.get("value");
88+
detailsMap.put(key, value);
89+
}
90+
}
91+
return detailsMap;
9292
}
9393

9494
public String getScope() {
9595
return this.scope;
96-
}
96+
}
9797

9898
public String getProviderName() {
9999
return this.providerName;
@@ -117,13 +117,13 @@ public long getEntityOwnerId() {
117117
@Override
118118
public void execute(){
119119
try{
120-
ImageStore result = _storageService.createCacheStore(this);
120+
ImageStore result = _storageService.createSecondaryStagingStore(this);
121121
ImageStoreResponse storeResponse = null;
122122
if (result != null ) {
123-
storeResponse = _responseGenerator.createImageStoreResponse(result);
124-
storeResponse.setResponseName(getCommandName());
125-
storeResponse.setObjectName("secondarystorage");
126-
this.setResponseObject(storeResponse);
123+
storeResponse = _responseGenerator.createImageStoreResponse(result);
124+
storeResponse.setResponseName(getCommandName());
125+
storeResponse.setObjectName("secondarystorage");
126+
this.setResponseObject(storeResponse);
127127
} else {
128128
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add secondary storage");
129129
}

api/src/org/apache/cloudstack/api/command/admin/storage/DeleteCacheStoreCmd.java renamed to api/src/org/apache/cloudstack/api/command/admin/storage/DeleteSecondaryStagingStoreCmd.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828

2929
import com.cloud.user.Account;
3030

31-
@APICommand(name = "deleteCacheStore", description = "Deletes a cache store .", responseObject = SuccessResponse.class, since = "4.2.0")
32-
public class DeleteCacheStoreCmd extends BaseCmd {
33-
public static final Logger s_logger = Logger.getLogger(DeleteCacheStoreCmd.class.getName());
31+
@APICommand(name = "deleteSecondaryStagingStore", description = "Deletes a secondary staging store .", responseObject = SuccessResponse.class, since = "4.2.0")
32+
public class DeleteSecondaryStagingStoreCmd extends BaseCmd {
33+
public static final Logger s_logger = Logger.getLogger(DeleteSecondaryStagingStoreCmd.class.getName());
3434

35-
private static final String s_name = "deletecachestoreresponse";
35+
private static final String s_name = "deletesecondarystagingstoreresponse";
3636

3737
// ///////////////////////////////////////////////////
3838
// ////////////// API parameters /////////////////////
3939
// ///////////////////////////////////////////////////
4040

4141
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = ImageStoreResponse.class,
42-
required = true, description = "the cache store ID")
42+
required = true, description = "the staging store ID")
4343
private Long id;
4444

4545

@@ -68,12 +68,12 @@ public long getEntityOwnerId() {
6868

6969
@Override
7070
public void execute() {
71-
boolean result = _storageService.deleteCacheStore(this);
71+
boolean result = _storageService.deleteSecondaryStagingStore(this);
7272
if (result) {
7373
SuccessResponse response = new SuccessResponse(getCommandName());
7474
this.setResponseObject(response);
7575
} else {
76-
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete image store");
76+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete secondary staging store");
7777
}
7878
}
7979
}

api/src/org/apache/cloudstack/api/command/admin/storage/ListCacheStoresCmd.java renamed to api/src/org/apache/cloudstack/api/command/admin/storage/ListSecondaryStagingStoresCmd.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@
2525
import org.apache.cloudstack.api.response.ZoneResponse;
2626
import org.apache.log4j.Logger;
2727

28-
@APICommand(name = "listCacheStores", description="Lists cache stores.", responseObject=ImageStoreResponse.class, since = "4.2.0")
29-
public class ListCacheStoresCmd extends BaseListCmd {
30-
public static final Logger s_logger = Logger.getLogger(ListCacheStoresCmd.class.getName());
28+
@APICommand(name = "listSecondaryStagingStores", description = "Lists secondary staging stores.", responseObject = ImageStoreResponse.class, since = "4.2.0")
29+
public class ListSecondaryStagingStoresCmd extends BaseListCmd {
30+
public static final Logger s_logger = Logger.getLogger(ListSecondaryStagingStoresCmd.class.getName());
3131

32-
private static final String s_name = "listcachestoreresponse";
32+
private static final String s_name = "listsecondarystagingstoreresponse";
3333

3434
/////////////////////////////////////////////////////
3535
//////////////// API parameters /////////////////////
3636
/////////////////////////////////////////////////////
3737

38-
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the cache store")
38+
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the staging store")
3939
private String storeName;
4040

41-
@Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, description="the cache store protocol")
41+
@Parameter(name = ApiConstants.PROTOCOL, type = CommandType.STRING, description = "the staging store protocol")
4242
private String protocol;
4343

44-
@Parameter(name=ApiConstants.PROVIDER, type=CommandType.STRING, description="the cache store provider")
44+
@Parameter(name = ApiConstants.PROVIDER, type = CommandType.STRING, description = "the staging store provider")
4545
private String provider;
4646

4747
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
48-
description="the Zone ID for the cache store")
48+
description = "the Zone ID for the staging store")
4949
private Long zoneId;
5050

5151
@Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = ImageStoreResponse.class,
52-
description="the ID of the cache store")
52+
description = "the ID of the staging store")
5353
private Long id;
5454

5555
/////////////////////////////////////////////////////
@@ -97,7 +97,7 @@ public String getCommandName() {
9797

9898
@Override
9999
public void execute(){
100-
ListResponse<ImageStoreResponse> response = _queryService.searchForCacheStores(this);
100+
ListResponse<ImageStoreResponse> response = _queryService.searchForSecondaryStagingStores(this);
101101
response.setResponseName(getCommandName());
102102
this.setResponseObject(response);
103103
}

api/src/org/apache/cloudstack/query/QueryService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.apache.cloudstack.api.command.admin.host.ListHostsCmd;
2121
import org.apache.cloudstack.api.command.admin.internallb.ListInternalLBVMsCmd;
2222
import org.apache.cloudstack.api.command.admin.router.ListRoutersCmd;
23-
import org.apache.cloudstack.api.command.admin.storage.ListCacheStoresCmd;
23+
import org.apache.cloudstack.api.command.admin.storage.ListSecondaryStagingStoresCmd;
2424
import org.apache.cloudstack.api.command.admin.storage.ListImageStoresCmd;
2525
import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd;
2626
import org.apache.cloudstack.api.command.admin.user.ListUsersCmd;
@@ -81,7 +81,7 @@ public interface QueryService {
8181

8282
public ListResponse<ImageStoreResponse> searchForImageStores(ListImageStoresCmd cmd);
8383

84-
public ListResponse<ImageStoreResponse> searchForCacheStores(ListCacheStoresCmd cmd);
84+
public ListResponse<ImageStoreResponse> searchForSecondaryStagingStores(ListSecondaryStagingStoresCmd cmd);
8585

8686
public ListResponse<AccountResponse> searchForAccounts(ListAccountsCmd cmd);
8787

client/tomcatconf/commands.properties.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ listS3s=1
250250
addImageStore=1
251251
listImageStores=1
252252
deleteImageStore=1
253-
createCacheStore=1
254-
listCacheStores=1
255-
#deleteCacheStore=1
253+
createSecondaryStagingStore=1
254+
listSecondaryStagingStores=1
255+
deleteSecondaryStagingStore=1
256256

257257
#### host commands
258258
addHost=3

engine/storage/cache/src/org/apache/cloudstack/storage/cache/allocator/StorageCacheRandomAllocator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public DataStore getCacheStore(Scope scope) {
4646

4747
List<DataStore> cacheStores = dataStoreMgr.getImageCacheStores(scope);
4848
if (cacheStores.size() <= 0) {
49-
s_logger.debug("Can't find cache storage in zone: " + scope.getScopeId());
49+
s_logger.debug("Can't find staging storage in zone: " + scope.getScopeId());
5050
return null;
5151
}
5252

plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,12 @@ public String getSecondaryStorageStoreUrl(long dcId) {
472472

473473
if (secUrl == null) {
474474
// we are using non-NFS image store, then use cache storage instead
475-
s_logger.info("Secondary storage is not NFS, we need to use cache storage");
475+
s_logger.info("Secondary storage is not NFS, we need to use staging storage");
476476
DataStore cacheStore = _dataStoreMgr.getImageCacheStore(dcId);
477477
if (cacheStore != null) {
478478
secUrl = cacheStore.getUri();
479479
} else {
480-
s_logger.warn("No cache storage is found when non-NFS secondary storage is used");
480+
s_logger.warn("No staging storage is found when non-NFS secondary storage is used");
481481
}
482482
}
483483

server/src/com/cloud/api/query/QueryManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.apache.cloudstack.api.command.admin.host.ListHostsCmd;
3535
import org.apache.cloudstack.api.command.admin.internallb.ListInternalLBVMsCmd;
3636
import org.apache.cloudstack.api.command.admin.router.ListRoutersCmd;
37-
import org.apache.cloudstack.api.command.admin.storage.ListCacheStoresCmd;
37+
import org.apache.cloudstack.api.command.admin.storage.ListSecondaryStagingStoresCmd;
3838
import org.apache.cloudstack.api.command.admin.storage.ListImageStoresCmd;
3939
import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd;
4040
import org.apache.cloudstack.api.command.admin.user.ListUsersCmd;
@@ -2107,7 +2107,7 @@ private Pair<List<ImageStoreJoinVO>, Integer> searchForImageStoresInternal(ListI
21072107
}
21082108

21092109
@Override
2110-
public ListResponse<ImageStoreResponse> searchForCacheStores(ListCacheStoresCmd cmd) {
2110+
public ListResponse<ImageStoreResponse> searchForSecondaryStagingStores(ListSecondaryStagingStoresCmd cmd) {
21112111
Pair<List<ImageStoreJoinVO>, Integer> result = searchForCacheStoresInternal(cmd);
21122112
ListResponse<ImageStoreResponse> response = new ListResponse<ImageStoreResponse>();
21132113

@@ -2117,7 +2117,7 @@ public ListResponse<ImageStoreResponse> searchForCacheStores(ListCacheStoresCmd
21172117
return response;
21182118
}
21192119

2120-
private Pair<List<ImageStoreJoinVO>, Integer> searchForCacheStoresInternal(ListCacheStoresCmd cmd) {
2120+
private Pair<List<ImageStoreJoinVO>, Integer> searchForCacheStoresInternal(ListSecondaryStagingStoresCmd cmd) {
21212121

21222122
Long zoneId = _accountMgr.checkAccessAndSpecifyAuthority(CallContext.current().getCallingAccount(), cmd.getZoneId());
21232123
Object id = cmd.getId();

server/src/com/cloud/server/ManagementServerImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@
146146
import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd;
147147
import org.apache.cloudstack.api.command.admin.storage.AddS3Cmd;
148148
import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd;
149-
import org.apache.cloudstack.api.command.admin.storage.CreateCacheStoreCmd;
149+
import org.apache.cloudstack.api.command.admin.storage.CreateSecondaryStagingStoreCmd;
150150
import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
151-
import org.apache.cloudstack.api.command.admin.storage.DeleteCacheStoreCmd;
151+
import org.apache.cloudstack.api.command.admin.storage.DeleteSecondaryStagingStoreCmd;
152152
import org.apache.cloudstack.api.command.admin.storage.DeleteImageStoreCmd;
153153
import org.apache.cloudstack.api.command.admin.storage.DeletePoolCmd;
154154
import org.apache.cloudstack.api.command.admin.storage.FindStoragePoolsForMigrationCmd;
155-
import org.apache.cloudstack.api.command.admin.storage.ListCacheStoresCmd;
155+
import org.apache.cloudstack.api.command.admin.storage.ListSecondaryStagingStoresCmd;
156156
import org.apache.cloudstack.api.command.admin.storage.ListImageStoresCmd;
157157
import org.apache.cloudstack.api.command.admin.storage.ListS3sCmd;
158158
import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd;
@@ -2798,9 +2798,9 @@ public List<Class<?>> getCommands() {
27982798
cmdList.add(AddImageStoreCmd.class);
27992799
cmdList.add(ListImageStoresCmd.class);
28002800
cmdList.add(DeleteImageStoreCmd.class);
2801-
cmdList.add(CreateCacheStoreCmd.class);
2802-
cmdList.add(ListCacheStoresCmd.class);
2803-
cmdList.add(DeleteCacheStoreCmd.class);
2801+
cmdList.add(CreateSecondaryStagingStoreCmd.class);
2802+
cmdList.add(ListSecondaryStagingStoresCmd.class);
2803+
cmdList.add(DeleteSecondaryStagingStoreCmd.class);
28042804
cmdList.add(CreateApplicationLoadBalancerCmd.class);
28052805
cmdList.add(ListApplicationLoadBalancersCmd.class);
28062806
cmdList.add(DeleteApplicationLoadBalancerCmd.class);

0 commit comments

Comments
 (0)