modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java | 16 - modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraUtil.java | 41 +- modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/ColumnFamilyComponent.java | 133 ++++++++ modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java | 51 +++ modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/MetricsDiscoveryComponent.java | 61 ++++ modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml | 150 ++++++++-- 6 files changed, 392 insertions(+), 60 deletions(-)
New commits: commit 74fd4a6b7ee924619c363193a78a3610af6ce440 Author: Stefan Negrea snegrea@redhat.com Date: Wed Oct 24 10:45:56 2012 -0500
Add server and internal metrics to the list of metrics.
Add the possibility to restore column families from snapshot.
diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java index dd06f39..1d3e08b 100644 --- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java +++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java @@ -84,18 +84,18 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent public OperationResult invokeOperation(String name, Configuration parameters) throws Exception {
if (name.equals("shutdown")) { - return shutdown(parameters); + return shutdownNode(); } else if (name.equals("start")) { - return start(parameters); + return startNode(); } else if (name.equals("restart")) { - return restart(parameters); + return restartNode(); }
return null; }
@SuppressWarnings("rawtypes") - private OperationResult shutdown(Configuration params) { + protected OperationResult shutdownNode() { ResourceContext<?> context = getResourceContext();
if (log.isInfoEnabled()) { @@ -137,7 +137,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent } }
- private OperationResult start(Configuration params) { + protected OperationResult startNode() { ResourceContext<?> context = getResourceContext(); Configuration pluginConfig = context.getPluginConfiguration(); String baseDir = pluginConfig.getSimpleValue("baseDir"); @@ -157,11 +157,11 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent } }
- private OperationResult restart(Configuration params) { - OperationResult result = shutdown(params); + protected OperationResult restartNode() { + OperationResult result = shutdownNode();
if (result.getErrorMessage() == null) { - result = start(params); + result = startNode(); }
return result; diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraUtil.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraUtil.java index a0990d8..5915eed 100644 --- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraUtil.java +++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraUtil.java @@ -1,28 +1,27 @@ /* * - * * RHQ Management Platform - * * Copyright (C) 2005-2012 Red Hat, Inc. - * * All rights reserved. - * * - * * This program is free software; you can redistribute it and/or modify - * * it under the terms of the GNU General Public License, version 2, as - * * published by the Free Software Foundation, and/or the GNU Lesser - * * General Public License, version 2.1, also as published by the Free - * * Software Foundation. - * * - * * This program 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 General Public License and the GNU Lesser General Public License - * * for more details. - * * - * * You should have received a copy of the GNU General Public License - * * and the GNU Lesser General Public License along with this program; - * * if not, write to the Free Software Foundation, Inc., - * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * RHQ Management Platform + * Copyright (C) 2005-2012 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program 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 General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ - package org.rhq.plugins.cassandra;
import java.util.List; diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/ColumnFamilyComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/ColumnFamilyComponent.java index 6371549..845b2fb 100644 --- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/ColumnFamilyComponent.java +++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/ColumnFamilyComponent.java @@ -28,6 +28,9 @@ package org.rhq.plugins.cassandra; import static org.rhq.core.domain.configuration.ConfigurationUpdateStatus.FAILURE; import static org.rhq.core.domain.configuration.ConfigurationUpdateStatus.SUCCESS; import static org.rhq.plugins.cassandra.CassandraUtil.getCluster; + +import java.io.File; + import me.prettyprint.hector.api.Cluster; import me.prettyprint.hector.api.ddl.ColumnFamilyDefinition; import me.prettyprint.hector.api.exceptions.HectorException; @@ -36,10 +39,14 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.Property; +import org.rhq.core.domain.configuration.PropertyList; +import org.rhq.core.domain.configuration.PropertyMap; import org.rhq.core.domain.configuration.PropertySimple; import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport; import org.rhq.core.pluginapi.inventory.ResourceContext; import org.rhq.core.pluginapi.operation.OperationResult; +import org.rhq.core.util.file.FileUtil; import org.rhq.plugins.jmx.JMXComponent; import org.rhq.plugins.jmx.MBeanResourceComponent;
@@ -59,8 +66,8 @@ public class ColumnFamilyComponent extends MBeanResourceComponent<JMXComponent<? log.debug("Loading resource context for column family " + context.getResourceKey()); }
- ColumnFamilyDefinition cfDef = getColumnFamilyDefinition(); - config.put(new PropertySimple("gc_grace_seconds", cfDef.getGcGraceSeconds())); + config.put(new PropertySimple("gc_grace_seconds", this.getColumnFamilyDefinition().getGcGraceSeconds())); + config.put(this.getSnapshotsWithDetails());
return config; } @@ -76,6 +83,8 @@ public class ColumnFamilyComponent extends MBeanResourceComponent<JMXComponent<? } else if (name.equals("takeSnapshot")) { String columnFamilyName = this.getResourceContext().getPluginConfiguration().getSimpleValue("name"); return this.getParentKeyspace().takeSnapshot(parameters, columnFamilyName); + } else if (name.equals("restoreSnapshot")){ + return this.restoreSnapshot(parameters); }
return super.invokeOperation(name, parameters); @@ -111,13 +120,127 @@ public class ColumnFamilyComponent extends MBeanResourceComponent<JMXComponent<? }
report.getConfiguration().remove("gc_grace_seconds"); + report.getConfiguration().remove("snapshots"); + super.updateResourceConfiguration(report); }
+ private PropertyList getSnapshotsWithDetails() { + PropertyList listOfSnapshots = new PropertyList("snapshots"); + + KeyspaceComponent parentKeyspace = this.getParentKeyspace(); + PropertyList parentDataFileLocations = parentKeyspace.getKeySpaceDataFileLocations(); + + for (Property directory : parentDataFileLocations.getList()) { + String directoryName = ((PropertySimple) directory).getStringValue(); + directoryName += "/" + this.getResourceContext().getPluginConfiguration().getSimpleValue("name"); + directoryName += "/snapshots"; + + File snapshotDirectory = new File(directoryName); + + if (snapshotDirectory.exists()) { + File[] files = snapshotDirectory.listFiles(); + + for (File individualSnapshot : files) { + if (individualSnapshot.isDirectory()) { + PropertyMap snapshotDetails = new PropertyMap("snapshot"); + snapshotDetails.put(new PropertySimple("name", individualSnapshot.getName())); + snapshotDetails.put(new PropertySimple("folder", individualSnapshot.getAbsolutePath())); + listOfSnapshots.add(snapshotDetails); + } + } + } + } + + return listOfSnapshots; + } + + private OperationResult restoreSnapshot(Configuration parameters) { + OperationResult result = new OperationResult(); + + //1. Find the list of snapshots discovered + String requestedSnapshotName = parameters.getSimpleValue("snapshotName"); + PropertyList listOfSnapShots = this.getSnapshotsWithDetails(); + + String snapshotDirectoryName = null; + for (Property property : listOfSnapShots.getList()) { + String snapshotName = ((PropertyMap) property).getSimpleValue("name", null); + if (requestedSnapshotName.equals(snapshotName)) { + snapshotDirectoryName = ((PropertyMap) property).getSimpleValue("folder", null); + break; + } + } + + //2. Find out if the discovered snapshot still exists on disk + if (snapshotDirectoryName == null) { + result.setErrorMessage("Restore failed! The snapshot does not exist!"); + return result; + } + + File snapshotDirectory = new File(snapshotDirectoryName); + if (!snapshotDirectory.exists() || !snapshotDirectory.isDirectory()) { + result.setErrorMessage("Restore failed! The snapshot does not exist on disk!"); + return result; + } + + //3. Shutdown Cassandra + CassandraNodeComponent node = this.getParentKeyspace().getCassandraNodeComponent(); + node.shutdownNode(); + + //4. Remove the entire commit log + KeyspaceComponent parentKeyspace = this.getParentKeyspace(); + + parentKeyspace.clearCommitLog(); + + //5. Copy the snapshot files to the column family folders + PropertyList parentDataFileLocations = parentKeyspace.getKeySpaceDataFileLocations(); + + for (Property dataFileDirectoryProperty : parentDataFileLocations.getList()) { + String columnFamilyDirectoryName = ((PropertySimple) dataFileDirectoryProperty).getStringValue(); + columnFamilyDirectoryName += "/" + this.getResourceContext().getPluginConfiguration().getSimpleValue("name"); + + File columnFamilyDirectory = new File(columnFamilyDirectoryName); + if(columnFamilyDirectory.exists()){ + //5.1 Remove existing data files + File[] originalColumnFamilyDataFiles = columnFamilyDirectory.listFiles(); + if (originalColumnFamilyDataFiles != null) { + for (File file : originalColumnFamilyDataFiles) { + if (file.isFile()) { + file.delete(); + } + } + } + + //5.2 Copy snapshots files to column family folder + File[] filesToBeRestored = snapshotDirectory.listFiles(); + if (filesToBeRestored != null) { + for (File fileToBeRestored : filesToBeRestored) { + if (fileToBeRestored.isFile()) { + File destinationFile = new File(columnFamilyDirectory, fileToBeRestored.getName()); + try { + FileUtil.copyFile(fileToBeRestored, destinationFile); + } catch (Exception e) { + result.setErrorMessage("Restore failed! The file copying process failed!"); + return result; + } + } + } + } + } + } + + //6. Restart Cassandra + node.startNode(); + + result.setSimpleResult("Snapshot restored succesfully..."); + + return result; + } + private ColumnFamilyDefinition getColumnFamilyDefinition() { Configuration pluginConfig = this.getResourceContext().getPluginConfiguration(); String cfName = pluginConfig.getSimpleValue("name"); - KeyspaceComponent<?> keyspaceComponent = this.getParentKeyspace(); + KeyspaceComponent keyspaceComponent = this.getParentKeyspace();
for (ColumnFamilyDefinition cfDef : keyspaceComponent.getKeyspaceDefinition().getCfDefs()) { if (cfName.equals(cfDef.getName())) { @@ -128,7 +251,7 @@ public class ColumnFamilyComponent extends MBeanResourceComponent<JMXComponent<? return null; }
- private KeyspaceComponent<?> getParentKeyspace() { - return (KeyspaceComponent<?>) this.getResourceContext().getParentResourceComponent(); + private KeyspaceComponent getParentKeyspace() { + return (KeyspaceComponent) this.getResourceContext().getParentResourceComponent(); } } diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java index d2d6126..5b15ee4 100644 --- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java +++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java @@ -25,12 +25,14 @@
package org.rhq.plugins.cassandra;
+import java.io.File; import java.util.Map;
import me.prettyprint.hector.api.ddl.KeyspaceDefinition;
import org.mc4j.ems.connection.EmsConnection; import org.mc4j.ems.connection.bean.EmsBean; +import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.mc4j.ems.connection.bean.operation.EmsOperation;
import org.rhq.core.domain.configuration.Configuration; @@ -49,18 +51,18 @@ import org.rhq.plugins.jmx.JMXComponent; /** * @author John Sanda */ -public class KeyspaceComponent<T extends ResourceComponent<?>> implements ResourceComponent<T>, ConfigurationFacet, - JMXComponent<T>, OperationFacet { +public class KeyspaceComponent implements ResourceComponent<ResourceComponent<?>>, ConfigurationFacet, + JMXComponent<ResourceComponent<?>>, OperationFacet {
private static final String STORAGE_SERVICE_BEAN = "org.apache.cassandra.db:type=StorageService";
private static final String COMPACT_OPERATION = "forceTableCompaction"; private static final String REPAIR_OPERATION = "forceTableRepair";
- private ResourceContext<T> context; + private ResourceContext<ResourceComponent<?>> context;
@Override - public void start(ResourceContext<T> context) throws Exception { + public void start(ResourceContext<ResourceComponent<?>> context) throws Exception { this.context = context; }
@@ -98,6 +100,7 @@ public class KeyspaceComponent<T extends ResourceComponent<?>> implements Resour list.add(map); } config.put(list); + config.put(this.getKeySpaceDataFileLocations());
return config; } @@ -175,6 +178,46 @@ public class KeyspaceComponent<T extends ResourceComponent<?>> implements Resour return new OperationResult(); }
+ public PropertyList getKeySpaceDataFileLocations() { + EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN); + EmsAttribute attribute = emsBean.getAttribute("AllDataFileLocations"); + + PropertyList list = new PropertyList("keyspaceFileLocations"); + String[] dirs = (String[]) attribute.getValue(); + for (String dir : dirs) { + if (!dir.endsWith("/")) { + dir = dir + "/"; + } + + list.add(new PropertySimple("directory", dir + context.getResourceKey())); + } + + return list; + } + + public PropertySimple getCommitLogProperty() { + EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN); + EmsAttribute attribute = emsBean.getAttribute("CommitLogLocation"); + return new PropertySimple("CommitLogLocation", attribute.refresh()); + } + + public boolean clearCommitLog() { + PropertySimple commitLogProperty = this.getCommitLogProperty(); + + File commitLogFolder = new File(commitLogProperty.getStringValue()); + + File[] commitLogFiles = commitLogFolder.listFiles(); + for (File file : commitLogFiles) { + file.delete(); + } + + return true; + } + + public CassandraNodeComponent getCassandraNodeComponent() { + return (CassandraNodeComponent) this.context.getParentResourceComponent(); + } + /** * Loads the bean with the given object name. * diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/MetricsDiscoveryComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/MetricsDiscoveryComponent.java new file mode 100644 index 0000000..fbd2ef5 --- /dev/null +++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/MetricsDiscoveryComponent.java @@ -0,0 +1,61 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2012 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation, and/or the GNU Lesser + * General Public License, version 2.1, also as published by the Free + * Software Foundation. + * + * This program 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 General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with this program; + * if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.rhq.plugins.cassandra; + +import java.util.Set; + +import org.rhq.core.domain.util.StringUtils; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; +import org.rhq.plugins.jmx.JMXComponent; +import org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent; + +/** + * @author Stefan Negrea + */ +public class MetricsDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent<?>> { + + public static final String PROPERTY_NAME_MARKER = "nameMarker"; + + public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JMXComponent<?>> context) { + String nameMarker = context.getDefaultPluginConfiguration().getSimpleValue(PROPERTY_NAME_MARKER); + + Set<DiscoveredResourceDetails> discoveredResources = super.discoverResources(context, true); + + String updatedResourceName; + int index; + for (DiscoveredResourceDetails discoveredResource : discoveredResources) { + updatedResourceName = discoveredResource.getResourceName(); + if ( (index = updatedResourceName.indexOf(nameMarker)) != -1) { + updatedResourceName = updatedResourceName.substring(index + nameMarker.length()); + if (updatedResourceName.length() != 0) { + updatedResourceName = StringUtils.deCamelCase(updatedResourceName); + discoveredResource.setResourceName(updatedResourceName); + } + } + } + + return discoveredResources; + } + +} diff --git a/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml index 6ed9ef4..e3c33d0 100644 --- a/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml @@ -28,6 +28,8 @@
<subcategories> <subcategory name="Client Request Metrics" description="Client Request Metrics"/> + <subcategory name="Server Request Metrics" description="Server Request Metrics"/> + <subcategory name="Internal Server Metrics" description="Server Request Metrics"/> </subcategories>
<plugin-configuration> @@ -181,8 +183,8 @@ </plugin-configuration>
<metric property="TotalCommitLogSize" measurementType="trendsup" displayType="summary" description="Size of all commit log segments"/> - <metric property="PendingTasks" measurementType="dynamic" displayType="detail" description="Number of tasks waiting to be executed"/> - <metric property="CompletedTasks" measurementType="trendsup" displayType="detail" description="Number of completed tasks"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Number of tasks waiting to be executed"/> + <metric property="CompletedTasks" measurementType="trendsup" displayType="summary" description="Number of completed tasks"/> </service>
@@ -260,7 +262,7 @@ </operation>
<metric property="CompletedTasks" measurementType="trendsup" displayType="summary" description="Number of completed compactions since server [re]start"/> - <metric property="PendingTasks" measurementType="dynamic" displayType="detail" description="Number of tasks waiting to be executed"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Number of tasks waiting to be executed"/> <metric property="TotalBytesCompacted" measurementType="trendsup" displayType="detail" description="Total number of bytes compacted since server [re]start"/> <metric property="TotalCompactionsCompleted" measurementType="trendsup" displayType="detail" description="Total number of compactions since server [re]start"/> </service> @@ -280,17 +282,17 @@ <operation name="invalidateKeyCache" description="Invalidate the key cache."/> <operation name="invalidateRowCache" description="Invalidate the row cache."/>
- <metric property="KeyCacheHits" measurementType="dynamic" displayType="detail" description="Number of key cache hits"/> - <metric property="RowCacheHists" measurementType="dynamic" displayType="detail" description="Number of row cache hits"/> + <metric property="KeyCacheHits" measurementType="dynamic" displayType="summary" description="Number of key cache hits"/> + <metric property="RowCacheHists" measurementType="dynamic" displayType="summary" description="Number of row cache hits"/>
- <metric property="KeyCacheRequests" measurementType="dynamic" displayType="detail" description="Number of key cache requests"/> - <metric property="RowCacheRequests" measurementType="dynamic" displayType="detail" description="Number of row cache requests"/> + <metric property="KeyCacheRequests" measurementType="dynamic" displayType="summary" description="Number of key cache requests"/> + <metric property="RowCacheRequests" measurementType="dynamic" displayType="summary" description="Number of row cache requests"/>
- <metric property="KeyCacheRecentHitRate" measurementType="dynamic" displayType="detail" description="Recent key cache hit rate"/> - <metric property="RowCacheRecentHitRate" measurementType="dynamic" displayType="detail" description="Recent row cache hit rate"/> + <metric property="KeyCacheRecentHitRate" measurementType="dynamic" displayType="summary" description="Recent key cache hit rate"/> + <metric property="RowCacheRecentHitRate" measurementType="dynamic" displayType="summary" description="Recent row cache hit rate"/>
- <metric property="KeyCacheCapacityInBytes" measurementType="dynamic" displayType="detail" description="Key cache capacity in bytes"/> - <metric property="RowCacheCapacityInBytes" measurementType="dynamic" displayType="detail" description="Row cache capacity in bytes"/> + <metric property="KeyCacheCapacityInBytes" measurementType="dynamic" displayType="summary" description="Key cache capacity in bytes"/> + <metric property="RowCacheCapacityInBytes" measurementType="dynamic" displayType="summary" description="Row cache capacity in bytes"/>
<metric property="KeyCacheSize" measurementType="dynamic" displayType="detail" description="Key cache size"/> <metric property="RowCacheSize" measurementType="dynamic" displayType="detail" description="Row cache size"/> @@ -344,6 +346,9 @@ <c:simple-property name="strategyOptionValue" type="string" readOnly="true"/> </c:map-property> </c:list-property> + <c:list-property name="keyspaceFileLocations" readOnly="true" description="List of data file locations"> + <c:simple-property name="directory" type="string" readOnly="true"/> + </c:list-property> </resource-configuration>
<service name="ColumnFamily" @@ -393,24 +398,34 @@ <c:simple-property name="operationResult" description="Filenames that contain the given key on this node."/> </results> </operation> + <operation name="restoreSnapshot" description="Restore the column family from a previously taken snapshot."> + <parameters> + <c:simple-property name="snapshotName" required="true" type="string" description="Snapshot Name"> + <c:option-source target="configuration" expression="snapshots:type=ColumnFamily"/> + </c:simple-property> + </parameters> + <results> + <c:simple-property name="operationResult" description="Filenames that contain the given key on this node."/> + </results> + </operation>
- <metric property="CompressionRatio" measurementType="dynamic" displayType="detail" description="Compression Ratio"/> - <metric property="LiveDiskSpaceUsed" displayName="Live Disk Space Used" measurementType="dynamic" displayType="detail" description="Disk space used by SSTables belonging to this CF"/> - <metric property="LiveSSTableCount" displayName="Live SS Table Count" measurementType="dynamic" displayType="detail" description="Number of SSTables on disk for this CF"/> - <metric property="MaxRowSize" measurementType="dynamic" displayType="detail" description="Size of the largest compacted row"/> - <metric property="MeanRowSize" measurementType="dynamic" displayType="detail" description="Means size of the compacted rows"/> - <metric property="MemtableColumnsCount" displayName="Memtable Columns Count" measurementType="dynamic" displayType="detail" description="Total number of columns present in the memtable."/> + <metric property="CompressionRatio" measurementType="dynamic" displayType="summary" description="Compression Ratio"/> + <metric property="LiveDiskSpaceUsed" displayName="Live Disk Space Used" measurementType="dynamic" displayType="summary" description="Disk space used by SSTables belonging to this CF"/> + <metric property="LiveSSTableCount" displayName="Live SS Table Count" measurementType="dynamic" displayType="summary" description="Number of SSTables on disk for this CF"/> + <metric property="MaxRowSize" measurementType="dynamic" displayType="summary" description="Size of the largest compacted row"/> + <metric property="MeanRowSize" measurementType="dynamic" displayType="summary" description="Means size of the compacted rows"/> + <metric property="MemtableColumnsCount" displayName="Memtable Columns Count" measurementType="dynamic" displayType="summary" description="Total number of columns present in the memtable."/> <metric property="MemtableDataSize" displayName="Memtable Data Size" measurementType="dynamic" displayType="detail" description="Total amount of data stored in the memtable, including column related overhead."/> - <metric property="MemtableSwitchCount" displayName="Memtable Switch Count" measurementType="dynamic" displayType="detail" description="Number of times that a flush has resulted in the memtable being switched out."/> - <metric property="MinRowSize" measurementType="dynamic" displayType="detail" description="Size of the smallest compacted row"/> - <metric property="PendingTasks" measurementType="dynamic" displayType="detail" description="Estimated number of tasks pending for this column family"/> + <metric property="MemtableSwitchCount" displayName="Memtable Switch Count" measurementType="dynamic" displayType="summary" description="Number of times that a flush has resulted in the memtable being switched out."/> + <metric property="MinRowSize" measurementType="dynamic" displayType="summary" description="Size of the smallest compacted row"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Estimated number of tasks pending for this column family"/> <metric property="ReadCount" displayName="Read Count" measurementType="trendsup" displayType="summary" description="Number of read operations since execution start"/> <metric property="RecentReadLatencyMicros" displayName="Recent Read Latency (in micro seconds)" measurementType="trendsup" displayType="detail" description="Latency of read operations since this metric was last sampled"/> <metric property="RecentWriteLatencyMicros" displayName="Recent Write Latency (in micro seconds)" measurementType="trendsup" displayType="detail" description="Latency of write operations since this metric was last sampled"/> - <metric property="TotalDiskSpaceUsed" measurementType="dynamic" displayType="summary" description="Total disk space used by SSTables belonging to this CF, including obsolete ones waiting to be GC'd"/> + <metric property="TotalDiskSpaceUsed" measurementType="dynamic" displayType="detail" description="Total disk space used by SSTables belonging to this CF, including obsolete ones waiting to be GC'd"/> <metric property="TotalReadLatencyMicros" displayName="Total Read Latency (in micro seconds)" measurementType="trendsup" displayType="detail" description="Latency of read operations since execution start"/> <metric property="TotalWriteLatencyMicros" displayName="Total Write Latency (in micro seconds)" measurementType="trendsup" displayType="detail" description="Latency of write operations since execution start"/> - <metric property="UnleveledSSTables" measurementType="dynamic" displayType="detail" description="Number of SSTables in L0. Always return 0 if Leveled compaction is not enabled."/> + <metric property="UnleveledSSTables" measurementType="dynamic" displayType="summary" description="Number of SSTables in L0. Always return 0 if Leveled compaction is not enabled."/> <metric property="WriteCount" displayName="Write Count" measurementType="trendsup" displayType="summary" description="Number of write operations since execution start"/>
<resource-configuration> @@ -422,9 +437,100 @@ <c:simple-property name="CompressionParameters" type="string" required="true" description="Compression parameters"/> <c:simple-property name="MinimumCompactionThreshold" type="integer" required="true" description="Minimum number of sstables in queue before compaction kicks off."/> <c:simple-property name="MaximumCompactionThreshold" type="integer" required="true" description="Maximum number of sstables in queue before compaction kicks off."/> + <c:list-property name="snapshots" readOnly="true" required="false"> + <c:map-property name="snapshot" readOnly="true"> + <c:simple-property name="name" readOnly="true"/> + <c:simple-property name="folder" readOnly="true" description="Snapshot Folder"/> + </c:map-property> + </c:list-property> </resource-configuration> </service> </service>
+ + <service name="ConfigurableStages" + discovery="org.rhq.plugins.cassandra.MetricsDiscoveryComponent" + class="org.rhq.plugins.jmx.MBeanResourceComponent" + singleton="true" + subCategory="Server Request Metrics"> + + <plugin-configuration> + <c:simple-property name="objectName" readOnly="true" type="string" + default="org.apache.cassandra.request:type=MutationStage|org.apache.cassandra.request:type=ReadStage|org.apache.cassandra.request:type=ReplicateOnWriteStage"/> + <c:simple-property name="nameMarker" readOnly="true" type="string" default="type=" /> + </plugin-configuration> + + <metric property="ActiveCount" measurementType="dynamic" displayType="summary" description="Active Count"/> + <metric property="CurrentlyBlockedTasks" measurementType="dynamic" displayType="summary" description="Currently Blocked Tasks"/> + <metric property="CompletedTasks" measurementType="dynamic" displayType="summary" description="Completed Tasks"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Pending Tasks"/> + <metric property="TotalBlockedTasks" measurementType="dynamic" displayType="summary" description="Total Blocked Tasks"/> + + <resource-configuration> + <c:simple-property name="CorePoolSize" type="integer" required="true" description="Core Pool Size."/> + </resource-configuration> + </service> + + <service name="EnabledStages" + discovery="org.rhq.plugins.cassandra.MetricsDiscoveryComponent" + class="org.rhq.plugins.jmx.MBeanResourceComponent" + singleton="true" + subCategory="Server Request Metrics"> + + <plugin-configuration> + <c:simple-property name="objectName" readOnly="true" type="string" + default="org.apache.cassandra.request:type=ReadRepairStage|org.apache.cassandra.request:type=RequestResponseStage"/> + <c:simple-property name="nameMarker" readOnly="true" type="string" default="type=" /> + </plugin-configuration> + + <metric property="ActiveCount" measurementType="dynamic" displayType="summary" description="Active Count"/> + <metric property="CurrentlyBlockedTasks" measurementType="dynamic" displayType="summary" description="Currently Blocked Tasks"/> + <metric property="CompletedTasks" measurementType="dynamic" displayType="summary" description="Completed Tasks"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Pending Tasks"/> + <metric property="TotalBlockedTasks" measurementType="dynamic" displayType="summary" description="Total Blocked Tasks"/> + </service> + + <service name="ConfigurableInternalServerMetrics" + discovery="org.rhq.plugins.cassandra.MetricsDiscoveryComponent" + class="org.rhq.plugins.jmx.MBeanResourceComponent" + singleton="true" + subCategory="Internal Server Metrics"> + + <plugin-configuration> + <c:simple-property name="objectName" readOnly="true" type="string" + default="org.apache.cassandra.internal:type=AntiEntropySessions"/> + <c:simple-property name="nameMarker" readOnly="true" type="string" default="type=" /> + </plugin-configuration> + + <metric property="ActiveCount" measurementType="dynamic" displayType="summary" description="Active Count"/> + <metric property="CurrentlyBlockedTasks" measurementType="dynamic" displayType="summary" description="Currently Blocked Tasks"/> + <metric property="CompletedTasks" measurementType="dynamic" displayType="summary" description="Completed Tasks"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Pending Tasks"/> + <metric property="TotalBlockedTasks" measurementType="dynamic" displayType="summary" description="Total Blocked Tasks"/> + + <resource-configuration> + <c:simple-property name="CorePoolSize" type="integer" required="true" description="Core Pool Size."/> + </resource-configuration> + </service> + + <service name="EnabledInternalServerMetrics" + discovery="org.rhq.plugins.cassandra.MetricsDiscoveryComponent" + class="org.rhq.plugins.jmx.MBeanResourceComponent" + singleton="true" + subCategory="Internal Server Metrics"> + + <plugin-configuration> + <c:simple-property name="objectName" readOnly="true" type="string" + default="org.apache.cassandra.internal:type=AntiEntropyStage|org.apache.cassandra.internal:type=FlushWriter|org.apache.cassandra.internal:type=GossipStage|org.apache.cassandra.internal:type=HintedHandoff|org.apache.cassandra.internal:type=InternalResponseStage|org.apache.cassandra.internal:type=MemtablePostFlusher|org.apache.cassandra.internal:type=MigrationStage|org.apache.cassandra.internal:type=MiscStage|org.apache.cassandra.internal:type=StreamStage|org.apache.cassandra.internal:type=commitlog_archiver"/> + <c:simple-property name="nameMarker" readOnly="true" type="string" default="type=" /> + </plugin-configuration> + + <metric property="ActiveCount" measurementType="dynamic" displayType="summary" description="Active Count"/> + <metric property="CurrentlyBlockedTasks" measurementType="dynamic" displayType="summary" description="Currently Blocked Tasks"/> + <metric property="CompletedTasks" measurementType="dynamic" displayType="summary" description="Completed Tasks"/> + <metric property="PendingTasks" measurementType="dynamic" displayType="summary" description="Pending Tasks"/> + <metric property="TotalBlockedTasks" measurementType="dynamic" displayType="summary" description="Total Blocked Tasks"/> + </service> + </server> </plugin> \ No newline at end of file
rhq-commits@lists.fedorahosted.org