summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.core
diff options
context:
space:
mode:
authorDhandapani <dhandapani@gluster.com>2011-04-07 10:58:53 +0530
committerDhandapani <dhandapani@gluster.com>2011-04-07 10:58:53 +0530
commit9cc77baa3c96fa74afbb3807dd01525e28638934 (patch)
tree41fa1ccf522fa8a1b103ee0bdefc0014b621d2ab /src/com.gluster.storage.management.core
parent5c39a47fdd3987bb5eee35f7f7397ce127c8919e (diff)
Volume re-export directory creation task in remote servers
Diffstat (limited to 'src/com.gluster.storage.management.core')
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterUtil.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterUtil.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterUtil.java
index ad5b4c2b..d8de2e20 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterUtil.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/utils/GlusterUtil.java
@@ -20,7 +20,6 @@
*/
package com.gluster.storage.management.core.utils;
-import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -36,6 +35,7 @@ import com.gluster.storage.management.core.model.Volume.VOLUME_TYPE;
*
*/
public class GlusterUtil {
+
private static final String HOSTNAME_PFX = "Hostname:";
private static final String UUID_PFX = "Uuid:";
private static final String STATE_PFX = "State:";
@@ -145,7 +145,7 @@ public class GlusterUtil {
return processUtil.executeCommand("gluster", "--mode=script", "volume", "stop", volumeName);
}
- public ProcessResult createVolume(Volume volume) {
+ public ProcessResult createVolume(Volume volume, List<String> bricks) {
int count=1; // replica or stripe count
String volumeType = null;
VOLUME_TYPE volType = volume.getVolumeType();
@@ -172,9 +172,7 @@ public class GlusterUtil {
}
command.add("transport");
command.add(transportTypeStr);
- for(Disk disk : volume.getDisks()) {
- command.add(getBrickNotation(volume, disk));
- }
+ command.addAll(bricks);
return processUtil.executeCommand(command);
}
@@ -193,24 +191,6 @@ public class GlusterUtil {
return setOption(command);
}
- /**
- * @param disk
- * @return
- */
- private String getBrickNotation(Volume vol, Disk disk) {
- // TODO: Figure out an appropriate directory INSIDE the DISK having given NAME (e.g. sda, sdb, etc)
- // String dirName = "/export/" + vol.getName() + "/" + disk.getName();
-
- // if /export directory is not exist then create the directory
- boolean exists = (new File("/export")).exists();
-
- if (!exists) {
- processUtil.executeCommand("mkdir", "/export");
- }
- String dirName = "/export/" + vol.getName() ;
- return disk.getServerName() + ":" + dirName;
- }
-
public static void main(String args[]) {
List<String> names = new GlusterUtil().getGlusterServerNames();
System.out.println(names);