diff options
| author | Selvam <selvam@gluster.com> | 2011-04-29 15:19:50 +0530 |
|---|---|---|
| committer | Selvam <selvam@gluster.com> | 2011-04-29 15:19:50 +0530 |
| commit | 1a2533deb10ed4dc0c4d910ce830a7065b845e68 (patch) | |
| tree | e9c83f01d03f0c959cfb65cb0d7a15935b53b543 /src/com.gluster.storage.management.core | |
| parent | 3149b18d24539f5680848c25064f447c15bbbcc4 (diff) | |
| parent | 3cc0768e0baf35ea140262e4f646cbdb9a3b8b84 (diff) | |
Merge branch 'expand-volume'
Conflicts:
src/com.gluster.storage.management.client/src/com/gluster/storage/management/client/VolumesClient.java
src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java
src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtil.java
src/com.gluster.storage.management.gui/plugin.xml
src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/actions/AddDiskAction.java
src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/AddDiskPage.java
src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/dialogs/AddDiskWizard.java
src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/VolumesResource.java
src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/utils/GlusterUtil.java
Diffstat (limited to 'src/com.gluster.storage.management.core')
3 files changed, 44 insertions, 8 deletions
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java index 99b76ed7..41ed5a25 100644 --- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java +++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/Volume.java @@ -51,8 +51,8 @@ public class Volume extends Entity { public static final int DEFAULT_REPLICA_COUNT = 2; - public static final int DEFAULT_STRIPE_COUNT = 2; - + public static final int DEFAULT_STRIPE_COUNT = 4; + public static final String OPTION_AUTH_ALLOW = "auth.allow"; private static final String[] VOLUME_TYPE_STR = new String[] { "Plain Distribute", "Distributed Mirror", diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterCoreUtil.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterCoreUtil.java new file mode 100644 index 00000000..9e3084fb --- /dev/null +++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterCoreUtil.java @@ -0,0 +1,38 @@ +/** + * GlusterCoreUtil.java + * + * Copyright (c) 2011 Gluster, Inc. <http://www.gluster.com> + * This file is part of Gluster Management Console. + * + * Gluster Management Console is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Gluster Management Console is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * <http://www.gnu.org/licenses/>. + */ +package com.gluster.storage.management.core.utils; + +import java.util.ArrayList; +import java.util.List; + +import com.gluster.storage.management.core.model.Disk; + + +public class GlusterCoreUtil { + // Convert from Disk list to Qualified disk name list + public static final List<String> getQualifiedDiskNames(List<Disk> diskList) { + List<String> qualifiedDiskNames = new ArrayList<String>(); + for (Disk disk : diskList) { + qualifiedDiskNames.add(disk.getQualifiedName()); + } + return qualifiedDiskNames; + } +} diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtil.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtil.java index aed9c80c..8dc5837d 100644 --- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtil.java +++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/StringUtil.java @@ -32,12 +32,10 @@ public class StringUtil { public static String ListToString(List<String> list, String delimiter) { StringBuilder output = new StringBuilder(); - for (int i = 0; i < list.size(); i++) { - output.append(list.get(i)); - if (i < (list.size()-1) ) { - output.append(delimiter); - } + for(String element : list) { + output.append(element).append(delimiter); } - return output.toString(); + String outputStr = output.toString(); + return outputStr.substring(0, outputStr.length() - (delimiter.length()+1)); } } |
