public abstract class NewtsUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOSTNAME |
static String |
DEFAULT_KEYSPACE |
static String |
DEFAULT_PORT |
static String |
DEFAULT_TTL |
static boolean |
DISABLE_INDEXING |
static String |
HOSTNAME_PROPERTY |
static org.opennms.newts.cassandra.search.CassandraIndexingOptions |
INDEXING_OPTIONS |
static String |
KEYSPACE_PROPERTY |
static int |
MAX_BATCH_SIZE |
static String |
PORT_PROPERTY |
static int |
TTL |
static String |
TTL_PROPERTY |
Constructor and Description |
---|
NewtsUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addIndicesToAttributes(ResourcePath path,
Map<String,String> attributes)
Extends the attribute map with indices used by the
NewtsResourceStorageDao . |
static org.opennms.newts.api.Sample |
createSampleForIndexingStrings(org.opennms.newts.api.Context context,
org.opennms.newts.api.Resource resource)
Creates a sample used to index string attributes.
|
static org.opennms.newts.api.search.Query |
findResourcesWithMetricsAtDepth(ResourcePath path,
int depth)
Constructs a query used to find all of the resources that have
one or more metrics at the given depth bellow the path.
|
static String |
toMetricName(String resourceId)
Extracts the metric name from the resource id.
|
static String |
toResourceId(ResourcePath path)
Converts a
ResourcePath to a Newts resource id. |
static ResourcePath |
toResourcePath(String resourceId)
Converts a Newts resource id to a
ResourcePath . |
public static final boolean DISABLE_INDEXING
public static final int MAX_BATCH_SIZE
public static final int TTL
public static final String HOSTNAME_PROPERTY
public static final String KEYSPACE_PROPERTY
public static final String PORT_PROPERTY
public static final String TTL_PROPERTY
public static final String DEFAULT_HOSTNAME
public static final String DEFAULT_KEYSPACE
public static final String DEFAULT_PORT
public static final String DEFAULT_TTL
public static final org.opennms.newts.cassandra.search.CassandraIndexingOptions INDEXING_OPTIONS
public static void addIndicesToAttributes(ResourcePath path, Map<String,String> attributes)
NewtsResourceStorageDao
.
A resource path of the form [a, b, c, d] will be indexed with:
public static org.opennms.newts.api.search.Query findResourcesWithMetricsAtDepth(ResourcePath path, int depth)
addIndicesToAttributes(org.opennms.netmgt.model.ResourcePath, java.util.Map<java.lang.String, java.lang.String>)
.public static String toResourceId(ResourcePath path)
ResourcePath
to a Newts resource id.path
- path to convertpublic static ResourcePath toResourcePath(String resourceId)
ResourcePath
.resourceId
- Newts resource idpublic static String toMetricName(String resourceId)
resourceId
- Newts resource idpublic static org.opennms.newts.api.Sample createSampleForIndexingStrings(org.opennms.newts.api.Context context, org.opennms.newts.api.Resource resource)
Copyright © 2021. All rights reserved.