[
https://issues.apache.org/jira/browse/CASSANDRA-7622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nate McCall updated CASSANDRA-7622:
-----------------------------------
Comment: was deleted
(was: Github user zznate commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/205#discussion_r173965027
--- Diff: src/java/org/apache/cassandra/db/virtual/TableStats.java ---
@@ -0,0 +1,166 @@
+package org.apache.cassandra.db.virtual;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.nio.ByteBuffer;
+import java.util.*;
+
+import org.apache.cassandra.cql3.CQL3Type;
+import org.apache.cassandra.cql3.QueryOptions;
+import org.apache.cassandra.cql3.restrictions.StatementRestrictions;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.InMemoryVirtualTable;
+import org.apache.cassandra.db.marshal.CompositeType;
+import org.apache.cassandra.metrics.LatencyMetrics;
+import org.apache.cassandra.schema.TableMetadata;
+import org.apache.cassandra.utils.EstimatedHistogram;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.codahale.metrics.Counting;
+import com.codahale.metrics.Gauge;
+import com.codahale.metrics.Metric;
+import com.codahale.metrics.Sampling;
+import com.codahale.metrics.Snapshot;
+import com.codahale.metrics.Timer;
+import com.google.common.collect.ImmutableSet;
+
+public class TableStats extends InMemoryVirtualTable
+{
+ private static final Logger logger =
LoggerFactory.getLogger(TableStats.class);
+ private static final Field[] FIELDS =
org.apache.cassandra.metrics.TableMetrics.class.getFields();
+ static
+ {
+ Arrays.sort(FIELDS, Comparator.comparing(Field::getName));
+ }
+ private static final Collection<String> EH_GAUGES = ImmutableSet.of(
+ "estimatedPartitionSizeHistogram",
+ "estimatedColumnCountHistogram");
+ private CompositeType keyType;
+
+ public static Map<String, CQL3Type> columns()
--- End diff --
same as above. Initialize statically.
)
> Implement virtual tables
> ------------------------
>
> Key: CASSANDRA-7622
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7622
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Tupshin Harper
> Assignee: Chris Lohfink
> Priority: Major
> Fix For: 4.x
>
>
> There are a variety of reasons to want virtual tables, which would be any
> table that would be backed by an API, rather than data explicitly managed and
> stored as sstables.
> One possible use case would be to expose JMX data through CQL as a
> resurrection of CASSANDRA-3527.
> Another is a more general framework to implement the ability to expose yaml
> configuration information. So it would be an alternate approach to
> CASSANDRA-7370.
> A possible implementation would be in terms of CASSANDRA-7443, but I am not
> presupposing.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]