summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShireesh Anjal <anjalshireesh@gmail.com>2011-08-08 02:22:10 -0700
committerShireesh Anjal <anjalshireesh@gmail.com>2011-08-08 02:22:10 -0700
commit071db987c5c7efee3c184282aaab79b21433f150 (patch)
tree042dbddee73e2103ea19412033bfa08d79718199 /src
parent6beba13685449373636496332a29204d245f5870 (diff)
parent9ebe3450c359a0e8c8f9939d06a2fbfc410b398f (diff)
Merge pull request #201 from Selvasundaram/master
Bug 3239 - Not able to export the keys properly - fix
Diffstat (limited to 'src')
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java13
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/GlusterDataModelManager.java14
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java26
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterServersSummaryView.java31
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java41
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java1
-rw-r--r--src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/VolumeOptionInfo.java2
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java63
-rw-r--r--src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/KeysResource.java2
9 files changed, 139 insertions, 54 deletions
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java
index 26419446..40a64498 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/AlertsManager.java
@@ -37,7 +37,7 @@ import com.gluster.storage.management.core.model.Partition;
import com.gluster.storage.management.core.model.Server.SERVER_STATUS;
import com.gluster.storage.management.core.model.Volume;
import com.gluster.storage.management.core.model.Volume.VOLUME_STATUS;
-import com.gluster.storage.management.core.utils.StringUtil;
+import com.gluster.storage.management.core.utils.NumberUtil;
public class AlertsManager {
private List<Alert> alerts = new ArrayList<Alert>();
@@ -118,8 +118,9 @@ public class AlertsManager {
// To check High CPU usage
if (server.getCpuUsage() >= CPU_USAGE_THRESHOLD) {
serverAlerts.add(new Alert(ALERT_TYPES.CPU_USAGE_ALERT, server.getName(),
- Alert.ALERT_TYPE_STR[ALERT_TYPES.CPU_USAGE_ALERT.ordinal()] + " [" + server.getCpuUsage()
- + "] in server [" + server.getName() + "]"));
+ Alert.ALERT_TYPE_STR[ALERT_TYPES.CPU_USAGE_ALERT.ordinal()] + " ["
+ + NumberUtil.formatNumber(server.getCpuUsage()) + "] in server [" + server.getName()
+ + "]"));
}
// To check High Memory usage
@@ -127,7 +128,7 @@ public class AlertsManager {
if (memoryUtilized >= MEMORY_USAGE_THRESHOLD) {
serverAlerts.add(new Alert(ALERT_TYPES.MEMORY_USAGE_ALERT, server.getName(),
Alert.ALERT_TYPE_STR[ALERT_TYPES.MEMORY_USAGE_ALERT.ordinal()] + " ["
- + StringUtil.formatNumber(memoryUtilized, 2) + "%] in server [" + server.getName()
+ + NumberUtil.formatNumber(memoryUtilized) + "%] in server [" + server.getName()
+ "]"));
}
@@ -164,7 +165,7 @@ public class AlertsManager {
if (deviceSpaceUsed >= DISK_SPACE_USAGE_THRESHOLD) {
diskAlerts.add(new Alert(ALERT_TYPES.DISK_USAGE_ALERT, partition.getQualifiedName(),
Alert.ALERT_TYPE_STR[ALERT_TYPES.DISK_USAGE_ALERT.ordinal()] + " ["
- + StringUtil.formatNumber(deviceSpaceUsed, 2) + "% used] in disk ["
+ + NumberUtil.formatNumber(deviceSpaceUsed) + "% used] in disk ["
+ partition.getQualifiedName() + "]"));
}
}
@@ -177,7 +178,7 @@ public class AlertsManager {
if (deviceSpaceUsed >= DISK_SPACE_USAGE_THRESHOLD) {
diskAlerts.add(new Alert(ALERT_TYPES.DISK_USAGE_ALERT, disk.getQualifiedName(),
Alert.ALERT_TYPE_STR[ALERT_TYPES.DISK_USAGE_ALERT.ordinal()] + " ["
- + StringUtil.formatNumber(deviceSpaceUsed, 2) + "% used] in ["
+ + NumberUtil.formatNumber(deviceSpaceUsed) + "% used] in ["
+ disk.getQualifiedName() + "]"));
}
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/GlusterDataModelManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/GlusterDataModelManager.java
index 61895c54..5e8e5325 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/GlusterDataModelManager.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/GlusterDataModelManager.java
@@ -810,12 +810,26 @@ public class GlusterDataModelManager {
public void addTask(TaskInfo taskInfo) {
Cluster cluster = model.getCluster();
+ // To avoid duplicate task, Remove if already exist
+ TaskInfo existingTaskInfo = getTask(taskInfo.getName());
+ if (getTask(taskInfo.getName()) != null) {
+ removeTask(existingTaskInfo);
+ }
cluster.addTaskInfo(taskInfo);
for (ClusterListener listener : listeners) {
listener.taskAdded(taskInfo);
}
}
+ public TaskInfo getTask(String taskId) {
+ for (TaskInfo taskInfo: model.getCluster().getTaskInfoList()) {
+ if (taskInfo.getName().equals(taskId)) {
+ return taskInfo;
+ }
+ }
+ return null;
+ }
+
// Updating the Task
public void updateTask(TaskInfo taskInfo) {
for (ClusterListener listener : listeners) {
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java
index 436b7134..c48bfb83 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/ClusterSummaryView.java
@@ -62,6 +62,7 @@ import com.gluster.storage.management.core.model.GlusterServer;
import com.gluster.storage.management.core.model.Server;
import com.gluster.storage.management.core.model.Server.SERVER_STATUS;
import com.gluster.storage.management.core.model.ServerStats;
+import com.gluster.storage.management.core.model.Status;
import com.gluster.storage.management.core.model.TaskInfo;
import com.gluster.storage.management.core.utils.NumberUtil;
@@ -326,7 +327,7 @@ public class ClusterSummaryView extends ViewPart {
createNetworkUsageSection();
createActionsSection();
createAlertsSection();
- createRunningTasksSection();
+ createTasksSection();
parent.layout(); // IMP: lays out the form properly
}
@@ -373,14 +374,16 @@ public class ClusterSummaryView extends ViewPart {
chartUtil.new NetworkChartPeriodLinkListener(null, networkStatsPeriod, toolkit), -1, 4);
}
- private void createRunningTasksSection() {
- tasksSection = guiHelper.createSection(form, toolkit, "Running Tasks", null, 1, false);
+ private void createTasksSection() {
+ tasksSection = guiHelper.createSection(form, toolkit, CoreConstants.RUNNING_TASKS, null, 1, false);
populateTasksSection();
}
private void populateTasksSection() {
for (TaskInfo taskInfo : cluster.getTaskInfoList()) {
- addTaskLabel(tasksSection, taskInfo);
+ if (taskInfo.getStatus().getCode() != Status.STATUS_CODE_SUCCESS) {
+ addTaskLabel(tasksSection, taskInfo);
+ }
}
tasksSection.layout();
form.reflow(true);
@@ -389,7 +392,6 @@ public class ClusterSummaryView extends ViewPart {
private void addTaskLabel(Composite section, TaskInfo taskInfo) {
//TODO: create link and open the task progress view
CLabel lblAlert = new CLabel(section, SWT.NONE);
- lblAlert.setText(taskInfo.getDescription());
Image taskImage = null;
switch(taskInfo.getType()) {
@@ -403,6 +405,20 @@ public class ClusterSummaryView extends ViewPart {
taskImage = guiHelper.getImage(IImageKeys.VOLUME_REBALANCE_22x22);
break;
}
+
+ String description = taskInfo.getDescription();
+ switch (taskInfo.getStatus().getCode()) {
+ case Status.STATUS_CODE_PAUSE:
+ description += " (paused)";
+ break;
+ case Status.STATUS_CODE_COMMIT_PENDING:
+ description += " (commit pending)";
+ break;
+ case Status.STATUS_CODE_FAILURE:
+ description += " (failed)";
+ break;
+ }
+ lblAlert.setText(description);
lblAlert.setImage(taskImage);
lblAlert.redraw();
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterServersSummaryView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterServersSummaryView.java
index 3d33a1eb..b3879e4f 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterServersSummaryView.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterServersSummaryView.java
@@ -45,6 +45,7 @@ import com.gluster.storage.management.core.model.EntityGroup;
import com.gluster.storage.management.core.model.Event;
import com.gluster.storage.management.core.model.GlusterServer;
import com.gluster.storage.management.core.model.Server.SERVER_STATUS;
+import com.gluster.storage.management.core.model.Status;
import com.gluster.storage.management.core.model.TaskInfo;
import com.gluster.storage.management.core.model.TaskInfo.TASK_TYPE;
@@ -230,15 +231,16 @@ public class GlusterServersSummaryView extends ViewPart {
}
private void createRunningTasksSection() {
- tasksSection = guiHelper.createSection(form, toolkit, "Running Tasks", null, 1, false);
+ tasksSection = guiHelper.createSection(form, toolkit, CoreConstants.RUNNING_TASKS, null, 1, false);
populateTasksSection();
-
}
private void populateTasksSection() {
for (TaskInfo taskInfo : GlusterDataModelManager.getInstance().getModel().getCluster().getTaskInfoList()) {
// Exclude volume related tasks
- if (taskInfo.getType() != TASK_TYPE.VOLUME_REBALANCE && taskInfo.getType() != TASK_TYPE.BRICK_MIGRATE) {
+ if (taskInfo.getStatus().getCode() != Status.STATUS_CODE_SUCCESS
+ && taskInfo.getType() != TASK_TYPE.VOLUME_REBALANCE
+ && taskInfo.getType() != TASK_TYPE.BRICK_MIGRATE) {
addTaskLabel(tasksSection, taskInfo);
}
}
@@ -247,9 +249,7 @@ public class GlusterServersSummaryView extends ViewPart {
}
private void addTaskLabel(Composite section, TaskInfo taskInfo) {
- CLabel lblAlert = new CLabel(section, SWT.NONE);
- lblAlert.setText(taskInfo.getDescription());
-
+ CLabel lblTask = new CLabel(section, SWT.NONE);
Image taskImage = null;
switch(taskInfo.getType()) {
case DISK_FORMAT:
@@ -262,8 +262,23 @@ public class GlusterServersSummaryView extends ViewPart {
taskImage = guiHelper.getImage(IImageKeys.VOLUME_REBALANCE_22x22);
break;
}
- lblAlert.setImage(taskImage);
- lblAlert.redraw();
+
+ String description = taskInfo.getDescription();
+ switch (taskInfo.getStatus().getCode()) {
+ case Status.STATUS_CODE_PAUSE:
+ description += " (paused)";
+ break;
+ case Status.STATUS_CODE_COMMIT_PENDING:
+ description += " (commit pending)";
+ break;
+ case Status.STATUS_CODE_FAILURE:
+ description += " (failed)";
+ break;
+ }
+
+ lblTask.setText(description);
+ lblTask.setImage(taskImage);
+ lblTask.redraw();
}
/* (non-Javadoc)
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java
index 51ca834c..79ebd84c 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/VolumesSummaryView.java
@@ -42,6 +42,7 @@ import com.gluster.storage.management.core.model.ClusterListener;
import com.gluster.storage.management.core.model.DefaultClusterListener;
import com.gluster.storage.management.core.model.EntityGroup;
import com.gluster.storage.management.core.model.Event;
+import com.gluster.storage.management.core.model.Status;
import com.gluster.storage.management.core.model.TaskInfo;
import com.gluster.storage.management.core.model.TaskInfo.TASK_TYPE;
import com.gluster.storage.management.core.model.Volume;
@@ -60,7 +61,6 @@ public class VolumesSummaryView extends ViewPart {
private ClusterListener clusterListener;
private static final String ALERTS = "Alerts";
- private static final String RUNNING_TASKS = "Running Tasks";
private static final String VOLUMES_SUMMARY = "Volumes - Summary";
private static final String AVAILABILITY = "Availability";
private Composite alertsSection;
@@ -155,7 +155,7 @@ public class VolumesSummaryView extends ViewPart {
private void createSections(Composite parent) {
form = guiHelper.setupForm(parent, toolkit, VOLUMES_SUMMARY);
createSummarySection();
- createRunningTasksSection();
+ createTasksSection();
createAlertsSection();
parent.layout(); // IMP: lays out the form properly
@@ -184,14 +184,15 @@ public class VolumesSummaryView extends ViewPart {
lblAlert.redraw();
}
- private void createRunningTasksSection() {
- tasksSection = guiHelper.createSection(form, toolkit, RUNNING_TASKS, null, 1, false);
+ private void createTasksSection() {
+ tasksSection = guiHelper.createSection(form, toolkit, CoreConstants.RUNNING_TASKS, null, 1, false);
populateTasks();
}
private void populateTasks() {
for (TaskInfo taskInfo : cluster.getTaskInfoList()) {
- if (taskInfo.getType() == TASK_TYPE.BRICK_MIGRATE || taskInfo.getType() == TASK_TYPE.VOLUME_REBALANCE)
+ if ((taskInfo.getType() == TASK_TYPE.BRICK_MIGRATE || taskInfo.getType() == TASK_TYPE.VOLUME_REBALANCE)
+ && taskInfo.getStatus().getCode() != Status.STATUS_CODE_SUCCESS)
addTaskLabel(tasksSection, taskInfo);
}
tasksSection.pack(true);
@@ -200,17 +201,27 @@ public class VolumesSummaryView extends ViewPart {
private void addTaskLabel(Composite section, TaskInfo taskInfo) {
// Task related to Volumes context
- if (taskInfo.getType() == TASK_TYPE.BRICK_MIGRATE
- || taskInfo.getType() == TASK_TYPE.VOLUME_REBALANCE) {
- if (taskInfo.getStatus().isPercentageSupported()) {
- // TODO Progress bar or link to progress view
- }
- CLabel lblAlert = new CLabel(section, SWT.NONE);
- lblAlert.setText(taskInfo.getDescription());
- lblAlert.setImage((taskInfo.getType() == TASK_TYPE.BRICK_MIGRATE) ? guiHelper
- .getImage(IImageKeys.BRICK_MIGRATE_32x32) : guiHelper.getImage(IImageKeys.VOLUME_REBALANCE_32x32));
- lblAlert.redraw();
+ if (taskInfo.getStatus().isPercentageSupported()) {
+ // TODO Progress bar or link to progress view
+ }
+
+ CLabel lblTask = new CLabel(section, SWT.NONE);
+ String description = taskInfo.getDescription();
+ switch (taskInfo.getStatus().getCode()) {
+ case Status.STATUS_CODE_PAUSE:
+ description += " (paused)";
+ break;
+ case Status.STATUS_CODE_COMMIT_PENDING:
+ description += " (commit pending)";
+ break;
+ case Status.STATUS_CODE_FAILURE:
+ description += " (failed)";
+ break;
}
+ lblTask.setText(description);
+ lblTask.setImage((taskInfo.getType() == TASK_TYPE.BRICK_MIGRATE) ? guiHelper
+ .getImage(IImageKeys.BRICK_MIGRATE_32x32) : guiHelper.getImage(IImageKeys.VOLUME_REBALANCE_32x32));
+ lblTask.redraw();
}
private void createSummarySection() {
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java
index a9309c85..42f0e7a9 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/constants/CoreConstants.java
@@ -36,4 +36,5 @@ public class CoreConstants {
public static final String OFFLINE = "OFFLINE";
public static final String ONLINE = "ONLINE";
public static final String UNKNOWN = "UNKNOWN";
+ public static final String RUNNING_TASKS = "Tasks";
}
diff --git a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/VolumeOptionInfo.java b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/VolumeOptionInfo.java
index 44e45df5..2cafc4b5 100644
--- a/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/VolumeOptionInfo.java
+++ b/src/com.gluster.storage.management.core/src/com/gluster/storage/management/core/model/VolumeOptionInfo.java
@@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlRootElement;
/**
* Class to hold information about a volume option
*/
-@XmlRootElement(name = "volumeOption")
+@XmlRootElement(name = "option")
public class VolumeOptionInfo {
private String name;
private String description;
diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java
index bdc9ce58..967b670d 100644
--- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java
+++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/constants/VolumeOptionsDefaults.java
@@ -30,6 +30,7 @@ import com.gluster.storage.management.core.constants.CoreConstants;
import com.gluster.storage.management.core.exceptions.ConnectionException;
import com.gluster.storage.management.core.exceptions.GlusterRuntimeException;
import com.gluster.storage.management.core.model.GlusterServer;
+import com.gluster.storage.management.core.model.Status;
import com.gluster.storage.management.core.model.VolumeOptionInfo;
import com.gluster.storage.management.core.response.VolumeOptionInfoListResponse;
import com.gluster.storage.management.gateway.services.ClusterService;
@@ -54,8 +55,8 @@ public class VolumeOptionsDefaults {
* @return list of volume option information objects
*/
public List<VolumeOptionInfo> getDefaults(String clusterName) {
- // return getVolumeOptionsInfo(clusterName);
- return getVolumeOptionsInfo();
+ return getVolumeOptionsInfo(clusterName);
+ // return getVolumeOptionsInfo();
}
@@ -136,44 +137,70 @@ public class VolumeOptionsDefaults {
public List<VolumeOptionInfo> getVolumeOptionsInfo(String clusterName) {
String command = "gluster volume set help-xml";
+ String output = "";
VolumeOptionInfoListResponse options = new VolumeOptionInfoListResponse();
GlusterServer onlineServer = clusterService.getOnlineServer(clusterName);
try {
- options = getVolumeOptionsInfo(onlineServer.getName(), command);
+ output = getVolumeOptionsInfo(onlineServer.getName(), command);
+ options = parseXML(output);
return options.getOptions();
} catch (ConnectionException e) {
onlineServer = clusterService.getNewOnlineServer(clusterName);
- options = getVolumeOptionsInfo(onlineServer.getName(), command);
+ output = getVolumeOptionsInfo(onlineServer.getName(), command);
+ options = parseXML(output);
return options.getOptions();
} catch (Exception e) {
throw new GlusterRuntimeException("Fetching volume options default failed! [" + e.getMessage() + "]");
}
}
- private VolumeOptionInfoListResponse getVolumeOptionsInfo(String serverName, String command) {
- return (VolumeOptionInfoListResponse) serverUtil.executeOnServer(true, serverName, command,
- VolumeOptionInfoListResponse.class);
+ private String getVolumeOptionsInfo(String serverName, String command) {
+ return serverUtil.executeOnServer(true, serverName, command,
+ String.class);
+ }
+
+ public VolumeOptionInfoListResponse parseXML(String xml) {
+ xml = xml.replaceAll("<volumeOptionsDefaults>", "<options>")
+ .replaceAll("</volumeOptionsDefaults>", "</options>").replaceAll("<volumeOption>", "<option>")
+ .replaceAll("</volumeOption>", "</option>");
+ Object response = serverUtil.unmarshal(VolumeOptionInfoListResponse.class, xml);
+ if (response instanceof Status) {
+ throw new GlusterRuntimeException(((Status) response).getMessage());
+ }
+ return (VolumeOptionInfoListResponse) response;
}
- public static void main(String[] args) {
+// public String getHelpxml() {
+// return "<volumeOptionsDefaults><volumeOption><defaultValue>16</defaultValue><Description>Maximum number blocks per file for which self-heal process would be applied simultaneously.</Description><name>cluster.self-heal-window-size</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>Select between &quot;full&quot;, &quot;diff&quot;. The &quot;full&quot; algorithm copies the entire file from source to sink. The &quot;diff&quot; algorithm copies to sink only those blocks whose checksums don't match with those of source.</Description><name>cluster.data-self-heal-algorithm</name></volumeOption><volumeOption><defaultValue>128KB</defaultValue><Description>Size of the stripe unit that would be read from or written to the striped servers.</Description><name>cluster.stripe-block-size</name></volumeOption><volumeOption><defaultValue>0</defaultValue><Description>Maximum file size which would be cached by the io-cache translator.</Description><name>performance.cache-max-file-size</name></volumeOption><volumeOption><defaultValue>0</defaultValue><Description>Minimum file size which would be cached by the io-cache translator.</Description><name>performance.cache-min-file-size</name></volumeOption><volumeOption><defaultValue>1</defaultValue><Description>The cached data for a file will be retained till 'cache-refresh-timeout' seconds, after which data re-validation is performed.</Description><name>performance.cache-refresh-timeout</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>Assigns priority to filenames with specific patterns so that when a page needs to be ejected out of the cache, the page of a file whose priority is the lowest will be ejected earlier</Description><name>performance.cache-priority</name></volumeOption><volumeOption><defaultValue>on</defaultValue><Description>If this option is set ON, instructs write-behind translator to perform flush in background, by returning success (or any errors, if any of previous writes were failed) to application even before flush is sent to backend filesystem. </Description><name>performance.flush-behind</name></volumeOption><volumeOption><defaultValue>16</defaultValue><Description>Number of threads in IO threads translator which perform concurrent IO operations</Description><name>performance.io-thread-count</name></volumeOption><volumeOption><defaultValue>1MB</defaultValue><Description>Size of the per-file write-behind buffer. </Description><name>performance.write-behind-window-size</name></volumeOption><volumeOption><defaultValue>off</defaultValue><Description>For nfs clients or apps that do not support 64-bit inode numbers, use this option to make NFS return 32-bit inode numbers instead. Disabled by default so NFS returns 64-bit inode numbers by default.</Description><name>nfs.enable-ino32</name></volumeOption><volumeOption><defaultValue>15</defaultValue><Description>Use this option to make NFS be faster on systems by using more memory. This option specifies a multiple that determines the total amount of memory used. Default value is 15. Increase to use more memory in order to improve performance for certain use cases.Please consult gluster-users list before using this option.</Description><name>nfs.mem-factor</name></volumeOption><volumeOption><defaultValue>on</defaultValue><Description>By default, all subvolumes of nfs are exported as individual exports. There are cases where a subdirectory or subdirectories in the volume need to be exported separately. Enabling this option allows any directory on a volumes to be exported separately. Directory exports are enabled by default.</Description><name>nfs.export-dirs</name></volumeOption><volumeOption><defaultValue>on</defaultValue><Description>Enable or disable exporting whole volumes, instead if used in conjunction with nfs3.export-dir, can allow setting up only subdirectories as exports. On by default.</Description><name>nfs.export-volumes</name></volumeOption><volumeOption><defaultValue>on</defaultValue><Description>Users have the option of turning off name lookup for incoming client connections using this option. In some setups, the name server can take too long to reply to DNS queries resulting in timeouts of mount requests. Use this option to turn off name lookups during address authentication. Note, turning this off will prevent you from using hostnames in rpc-auth.addr.* filters. By default, name lookup is on.</Description><name>nfs.addr-namelookup</name></volumeOption><volumeOption><defaultValue>on</defaultValue><Description>For systems that need to run multiple nfs servers, weneed to prevent more than one from registering with portmap service. Use this option to turn off portmap registration for Gluster NFS. On by default</Description><name>nfs.register-with-portmap</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>Use this option on systems that need Gluster NFS to be associated with a non-default port number.</Description><name>nfs.port</name></volumeOption><volumeOption><defaultValue>on</defaultValue><Description>Disable or enable the AUTH_UNIX authentication type for a particular exported volume over-riding defaults and general setting for AUTH_UNIX scheme. Must always be enabled for better interoperability.However, can be disabled if needed. Enabled bydefault.</Description><name>nfs.rpc-auth-unix</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>Allow a comma separated list of addresses and/or hostnames to connect to the server. By default, all connections are disallowed. This allows users to define a rule for a specific exported volume.</Description><name>nfs.rpc-auth-allow</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>Reject a comma separated list of addresses and/or hostnames from connecting to the server. By default, all connections are disallowed. This allows users todefine a rule for a specific exported volume.</Description><name>nfs.rpc-auth-reject</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>Allow client connections from unprivileged ports. By default only privileged ports are allowed. Use this option to set enable or disable insecure ports for a specific subvolume and to over-ride global setting set by the previous option.</Description><name>nfs.ports-insecure</name></volumeOption><volumeOption><defaultValue>off</defaultValue><Description>All writes and COMMIT requests are treated as async. This implies that no write requests are guaranteed to be on server disks when the write reply is received at the NFS client. Trusted sync includes trusted-write behaviour. Off by default.</Description><name>nfs.trusted-sync</name></volumeOption><volumeOption><defaultValue>off</defaultValue><Description>On an UNSTABLE write from client, return STABLE flag to force client to not send a COMMIT request. In some environments, combined with a replicated GlusterFS setup, this option can improve write performance. This flag allows user to trust Gluster replication logic to sync data to the disks and recover when required. COMMIT requests if received will be handled in a default manner by fsyncing. STABLE writes are still handled in a sync manner. Off by default.</Description><name>nfs.trusted-write</name></volumeOption><volumeOption><defaultValue>read-write</defaultValue><Description>Type of access desired for this subvolume: read-only, read-write(default)</Description><name>nfs.volume-access</name></volumeOption><volumeOption><defaultValue></defaultValue><Description>By default, all subvolumes of nfs are exported as individual exports. There are cases where a subdirectory or subdirectories in the volume need to be exported separately. This option can also be used in conjunction with nfs3.export-volumes option to restrict exports only to the subdirectories specified through this option. Must be an absolute path.</Description><name>nfs.export-dir</name></volumeOption><volumeOption><defaultValue>off</defaultValue><Description>This option is used to enable/disable NFS serverfor individual volume.</Description><name>nfs.disable</name></volumeOption></volumeOptionsDefaults>";
+// }
+//
+//
+//
+// public static void main(String[] args) {
+// VolumeOptionsDefaults vod = new VolumeOptionsDefaults();
// String command = "gluster volume set help-xml";
// String output = "";
// ServerUtil serverUtil = new ServerUtil();
// try {
-// Process p = Runtime.getRuntime().exec(command);
-// p.waitFor();
-// BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
-// String line = reader.readLine();
-// while (line != null) {
-// output += line;
-// line = reader.readLine();
-// }
+//// Process p = Runtime.getRuntime().exec(command);
+//// p.waitFor();
+//// BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
+//// String line = reader.readLine();
+//// while (line != null) {
+//// output += line;
+//// line = reader.readLine();
+//// }
+// output = vod.getHelpxml();
+// output = output.replaceAll("<volumeOptionsDefaults>", "<options>")
+// .replaceAll("</volumeOptionsDefaults>", "</options>").replaceAll("<volumeOption>", "<option>")
+// .replaceAll("</volumeOption>", "</option>");
// } catch (Exception e) {
// System.out.println("Error in executing command ...." + e.getMessage());
+// return;
// }
-// Object response = serverUtil.unmarshal(VolumeOptionInfoListResponse.class, output, false);
+// Object response = serverUtil.unmarshal(VolumeOptionInfoListResponse.class, output);
// if (response instanceof Status) {
// System.out.println("Error: " + response.toString());
// return;
@@ -181,5 +208,5 @@ public class VolumeOptionsDefaults {
// for (VolumeOptionInfo option : ((VolumeOptionInfoListResponse) response).getOptions()) {
// System.out.println(option.getName() + " : " + option.getDefaultValue() );
// }
- }
+// }
} \ No newline at end of file
diff --git a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/KeysResource.java b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/KeysResource.java
index 594344c5..186fa59f 100644
--- a/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/KeysResource.java
+++ b/src/com.gluster.storage.management.gateway/src/com/gluster/storage/management/gateway/resources/v1_0/KeysResource.java
@@ -125,7 +125,7 @@ public class KeysResource extends AbstractResource {
}
}
// Extract SSH private and public key files.
- ProcessResult output = processUtil.executeCommand("tar", "xvf", uploadedFile.getName(), "-C",
+ ProcessResult output = processUtil.executeCommand("tar", "xvf", uploadedFile.getAbsolutePath(), "-C",
SshUtil.SSH_AUTHORIZED_KEYS_DIR_LOCAL);
uploadedFile.delete();
if (!output.isSuccess()) {