public final class DocumentStoreUtils extends Object
DocumentStoreVendor.| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
applyConfigFilter(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList configsToRetrieve,
Map<String,String> configs) |
static String |
constructFlowActivityDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext,
long eventTimestamp)
Creates a composite key for storing
FlowActivityDocument. |
static String |
constructFlowRunDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext)
Creates a composite key for storing
FlowRunDocument. |
static String |
constructTimelineEntityDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext,
String type)
Creates a composite key for storing
TimelineEntityDocument. |
static String |
constructTimelineEntityDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext,
String type,
String id)
Creates a composite key for storing
TimelineEntityDocument. |
static com.microsoft.azure.cosmosdb.rx.AsyncDocumentClient |
createCosmosDBAsyncClient(org.apache.hadoop.conf.Configuration conf)
Creates CosmosDB Async Document Client.
|
static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity |
createEntityToBeReturned(TimelineEntityDocument timelineEntityDocument,
org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve dataToRetrieve)
Creates the final entity to be returned as the result.
|
static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity |
createEntityToBeReturned(TimelineEntityDocument timelineEntityDocument,
org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList confsToRetrieve,
org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList metricsToRetrieve)
Creates the final entity to be returned as the result.
|
static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent |
fetchEvent(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity timelineEntity,
String eventType)
Retrieves a
TimelineEvent from TimelineEntity.events. |
static String |
getCosmosDBDatabaseName(org.apache.hadoop.conf.Configuration conf) |
static DocumentStoreVendor |
getStoreVendor(org.apache.hadoop.conf.Configuration conf)
Retrieves
DocumentStoreVendor configured. |
static long |
getTopOfTheDayTimestamp(long timeStamp)
Returns the timestamp of the day's start (which is midnight 00:00:00 AM)
for a given input timestamp.
|
static boolean |
isNullOrEmpty(String... values)
Checks if the string is null or empty.
|
static Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric> |
transformMetrics(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList metricsToRetrieve,
Map<String,Set<TimelineMetricSubDoc>> metrics) |
static void |
validateCosmosDBConf(org.apache.hadoop.conf.Configuration conf)
Checks whether the cosmosdb conf are set properly in yarn-site.xml conf.
|
public static void validateCosmosDBConf(org.apache.hadoop.conf.Configuration conf)
throws org.apache.hadoop.yarn.exceptions.YarnException
conf - related to yarnorg.apache.hadoop.yarn.exceptions.YarnException - if required config properties are missingpublic static DocumentStoreVendor getStoreVendor(org.apache.hadoop.conf.Configuration conf)
DocumentStoreVendor configured.conf - related to yarnDocumentStoreVendor that is configured, else
uses DocumentStoreVendor.COSMOS_DB as defaultpublic static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent fetchEvent(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity timelineEntity,
String eventType)
TimelineEvent from TimelineEntity.events.timelineEntity - from which the set of events are examined.eventType - that has to be checked.TimelineEvent if found else nullpublic static boolean isNullOrEmpty(String... values)
values - array of string to be checkedpublic static com.microsoft.azure.cosmosdb.rx.AsyncDocumentClient createCosmosDBAsyncClient(org.apache.hadoop.conf.Configuration conf)
conf - to retrieve cosmos db endpoint and keypublic static long getTopOfTheDayTimestamp(long timeStamp)
timeStamp - Timestamp.public static String constructTimelineEntityDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext, String type)
TimelineEntityDocument.collectorContext - of the timeline writertype - of the entitypublic static String constructTimelineEntityDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext, String type, String id)
TimelineEntityDocument.collectorContext - of the timeline writertype - of the entityid - of the entitypublic static String constructFlowRunDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext)
FlowRunDocument.collectorContext - of the timeline writerpublic static String constructFlowActivityDocId(org.apache.hadoop.yarn.server.timelineservice.collector.TimelineCollectorContext collectorContext, long eventTimestamp)
FlowActivityDocument.collectorContext - of the timeline writereventTimestamp - of the timeline entitypublic static String getCosmosDBDatabaseName(org.apache.hadoop.conf.Configuration conf)
public static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity createEntityToBeReturned(TimelineEntityDocument timelineEntityDocument, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve dataToRetrieve)
timelineEntityDocument - which has all the information for the entitydataToRetrieve - specifies filters and fields to retrieveTimelineEntity as the resultpublic static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity createEntityToBeReturned(TimelineEntityDocument timelineEntityDocument, org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList confsToRetrieve, org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList metricsToRetrieve)
timelineEntityDocument - which has all the information for the entityconfsToRetrieve - specifies config filters to be appliedmetricsToRetrieve - specifies metric filters to be appliedTimelineEntity as the resultpublic static Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric> transformMetrics(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList metricsToRetrieve, Map<String,Set<TimelineMetricSubDoc>> metrics)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.