Search in sources :

Example 6 with SessionInfo

use of org.apache.cassandra.streaming.SessionInfo in project scylla-jmx by scylladb.

the class StreamStateCompositeData method fromCompositeData.

public static StreamState fromCompositeData(CompositeData cd) {
    assert cd.getCompositeType().equals(COMPOSITE_TYPE);
    Object[] values = cd.getAll(ITEM_NAMES);
    UUID planId = UUID.fromString((String) values[0]);
    String description = (String) values[1];
    Set<SessionInfo> sessions = Sets.newHashSet(Iterables.transform(Arrays.asList((CompositeData[]) values[2]), input -> SessionInfoCompositeData.fromCompositeData(input)));
    return new StreamState(planId, description, sessions);
}
Also used : Arrays(java.util.Arrays) CompositeType(javax.management.openmbean.CompositeType) OpenDataException(javax.management.openmbean.OpenDataException) Iterables(com.google.common.collect.Iterables) SimpleType(javax.management.openmbean.SimpleType) Set(java.util.Set) CompositeData(javax.management.openmbean.CompositeData) Throwables(com.google.common.base.Throwables) HashMap(java.util.HashMap) UUID(java.util.UUID) Sets(com.google.common.collect.Sets) OpenType(javax.management.openmbean.OpenType) StreamState(org.apache.cassandra.streaming.StreamState) Lists(com.google.common.collect.Lists) Map(java.util.Map) SessionInfo(org.apache.cassandra.streaming.SessionInfo) ArrayType(javax.management.openmbean.ArrayType) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport) StreamState(org.apache.cassandra.streaming.StreamState) CompositeData(javax.management.openmbean.CompositeData) SessionInfo(org.apache.cassandra.streaming.SessionInfo) UUID(java.util.UUID)

Aggregations

SessionInfo (org.apache.cassandra.streaming.SessionInfo)6 HashMap (java.util.HashMap)3 CompositeData (javax.management.openmbean.CompositeData)3 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)3 OpenDataException (javax.management.openmbean.OpenDataException)3 ProgressInfo (org.apache.cassandra.streaming.ProgressInfo)3 Function (com.google.common.base.Function)2 Throwables (com.google.common.base.Throwables)2 Iterables (com.google.common.collect.Iterables)2 Lists (com.google.common.collect.Lists)2 Sets (com.google.common.collect.Sets)2 InetAddress (java.net.InetAddress)2 UnknownHostException (java.net.UnknownHostException)2 Arrays (java.util.Arrays)2 Map (java.util.Map)2 UUID (java.util.UUID)2 ArrayType (javax.management.openmbean.ArrayType)2 CompositeType (javax.management.openmbean.CompositeType)2 OpenType (javax.management.openmbean.OpenType)2 SimpleType (javax.management.openmbean.SimpleType)2