http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/NameValuePair.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/NameValuePair.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/NameValuePair.java deleted file mode 100644 index d8dabd2..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/NameValuePair.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.yarn.server.applicationhistoryservice.timeline; - -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; - -/** - * A class holding a name and value pair, used for specifying filters in - * {@link TimelineReader}. - */ -@InterfaceAudience.Private -@InterfaceStability.Unstable -public class NameValuePair { - String name; - Object value; - - public NameValuePair(String name, Object value) { - this.name = name; - this.value = value; - } - - /** - * Get the name. - * @return The name. - */ - public String getName() { - - return name; - } - - /** - * Get the value. - * @return The value. - */ - public Object getValue() { - return value; - } - - @Override - public String toString() { - return "{ name: " + name + ", value: " + value + " }"; - } -}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineReader.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineReader.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineReader.java deleted file mode 100644 index 9ae9954..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineReader.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.timeline; - -import java.io.IOException; -import java.util.Collection; -import java.util.EnumSet; -import java.util.Set; -import java.util.SortedSet; - -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEntities; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEvents; - -/** - * This interface is for retrieving timeline information. - */ -@InterfaceAudience.Private -@InterfaceStability.Unstable -public interface TimelineReader { - - /** - * Possible fields to retrieve for {@link #getEntities} and {@link #getEntity} - * . - */ - enum Field { - EVENTS, - RELATED_ENTITIES, - PRIMARY_FILTERS, - OTHER_INFO, - LAST_EVENT_ONLY - } - - /** - * Default limit for {@link #getEntities} and {@link #getEntityTimelines}. - */ - final long DEFAULT_LIMIT = 100; - - /** - * This method retrieves a list of entity information, {@link TimelineEntity}, - * sorted by the starting timestamp for the entity, descending. The starting - * timestamp of an entity is a timestamp specified by the client. If it is not - * explicitly specified, it will be chosen by the store to be the earliest - * timestamp of the events received in the first put for the entity. - * - * @param entityType - * The type of entities to return (required). - * @param limit - * A limit on the number of entities to return. If null, defaults to - * {@link #DEFAULT_LIMIT}. - * @param windowStart - * The earliest start timestamp to retrieve (exclusive). If null, - * defaults to retrieving all entities until the limit is reached. - * @param windowEnd - * The latest start timestamp to retrieve (inclusive). If null, - * defaults to {@link Long#MAX_VALUE} - * @param fromId - * If fromId is not null, retrieve entities earlier than and - * including the specified ID. If no start time is found for the - * specified ID, an empty list of entities will be returned. The - * windowEnd parameter will take precedence if the start time of this - * entity falls later than windowEnd. - * @param fromTs - * If fromTs is not null, ignore entities that were inserted into the - * store after the given timestamp. The entity's insert timestamp - * used for this comparison is the store's system time when the first - * put for the entity was received (not the entity's start time). - * @param primaryFilter - * Retrieves only entities that have the specified primary filter. If - * null, retrieves all entities. This is an indexed retrieval, and no - * entities that do not match the filter are scanned. - * @param secondaryFilters - * Retrieves only entities that have exact matches for all the - * specified filters in their primary filters or other info. This is - * not an indexed retrieval, so all entities are scanned but only - * those matching the filters are returned. - * @param fieldsToRetrieve - * Specifies which fields of the entity object to retrieve (see - * {@link Field}). If the set of fields contains - * {@link Field#LAST_EVENT_ONLY} and not {@link Field#EVENTS}, the - * most recent event for each entity is retrieved. If null, retrieves - * all fields. - * @return An {@link TimelineEntities} object. - * @throws IOException - */ - TimelineEntities getEntities(String entityType, - Long limit, Long windowStart, Long windowEnd, String fromId, Long fromTs, - NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters, - EnumSet<Field> fieldsToRetrieve) throws IOException; - - /** - * This method retrieves the entity information for a given entity. - * - * @param entityId - * The entity whose information will be retrieved. - * @param entityType - * The type of the entity. - * @param fieldsToRetrieve - * Specifies which fields of the entity object to retrieve (see - * {@link Field}). If the set of fields contains - * {@link Field#LAST_EVENT_ONLY} and not {@link Field#EVENTS}, the - * most recent event for each entity is retrieved. If null, retrieves - * all fields. - * @return An {@link TimelineEntity} object. - * @throws IOException - */ - TimelineEntity getEntity(String entityId, String entityType, EnumSet<Field> - fieldsToRetrieve) throws IOException; - - /** - * This method retrieves the events for a list of entities all of the same - * entity type. The events for each entity are sorted in order of their - * timestamps, descending. - * - * @param entityType - * The type of entities to retrieve events for. - * @param entityIds - * The entity IDs to retrieve events for. - * @param limit - * A limit on the number of events to return for each entity. If - * null, defaults to {@link #DEFAULT_LIMIT} events per entity. - * @param windowStart - * If not null, retrieves only events later than the given time - * (exclusive) - * @param windowEnd - * If not null, retrieves only events earlier than the given time - * (inclusive) - * @param eventTypes - * Restricts the events returned to the given types. If null, events - * of all types will be returned. - * @return An {@link TimelineEvents} object. - * @throws IOException - */ - TimelineEvents getEntityTimelines(String entityType, - SortedSet<String> entityIds, Long limit, Long windowStart, - Long windowEnd, Set<String> eventTypes) throws IOException; -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineStore.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineStore.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineStore.java deleted file mode 100644 index 6b50d83..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineStore.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.timeline; - -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.service.Service; - -@InterfaceAudience.Private -@InterfaceStability.Unstable -public interface TimelineStore extends - Service, TimelineReader, TimelineWriter { -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineWriter.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineWriter.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineWriter.java deleted file mode 100644 index 8f28d82..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/TimelineWriter.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.timeline; - -import org.apache.hadoop.classification.InterfaceAudience; -import org.apache.hadoop.classification.InterfaceStability; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEntities; -import org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse; - -import java.io.IOException; - -/** - * This interface is for storing timeline information. - */ -@InterfaceAudience.Private -@InterfaceStability.Unstable -public interface TimelineWriter { - - /** - * Stores entity information to the timeline store. Any errors occurring for - * individual put request objects will be reported in the response. - * - * @param data - * An {@link TimelineEntities} object. - * @return An {@link TimelinePutResponse} object. - * @throws IOException - */ - TimelinePutResponse put(TimelineEntities data) throws IOException; - -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/package-info.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/package-info.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/package-info.java deleted file mode 100644 index 970e868..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/timeline/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@InterfaceAudience.Private -package org.apache.hadoop.yarn.server.applicationhistoryservice.timeline; -import org.apache.hadoop.classification.InterfaceAudience; http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSController.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSController.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSController.java deleted file mode 100644 index 4e00bc8..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSController.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import org.apache.hadoop.yarn.webapp.Controller; - -import com.google.inject.Inject; - -public class AHSController extends Controller { - - @Inject - AHSController(RequestContext ctx) { - super(ctx); - } - - @Override - public void index() { - setTitle("Application History"); - } - - public void app() { - render(AppPage.class); - } - - public void appattempt() { - render(AppAttemptPage.class); - } - - public void container() { - render(ContainerPage.class); - } - - /** - * Render the logs page. - */ - public void logs() { - render(AHSLogsPage.class); - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSLogsPage.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSLogsPage.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSLogsPage.java deleted file mode 100644 index 8821bc0..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSLogsPage.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import static org.apache.hadoop.yarn.webapp.YarnWebParams.CONTAINER_ID; -import static org.apache.hadoop.yarn.webapp.YarnWebParams.ENTITY_STRING; - -import org.apache.hadoop.yarn.webapp.SubView; -import org.apache.hadoop.yarn.webapp.log.AggregatedLogsBlock; - -public class AHSLogsPage extends AHSView { - /* - * (non-Javadoc) - * - * @see - * org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.AHSView# - * preHead(org.apache.hadoop .yarn.webapp.hamlet.Hamlet.HTML) - */ - @Override - protected void preHead(Page.HTML<_> html) { - String logEntity = $(ENTITY_STRING); - if (logEntity == null || logEntity.isEmpty()) { - logEntity = $(CONTAINER_ID); - } - if (logEntity == null || logEntity.isEmpty()) { - logEntity = "UNKNOWN"; - } - commonPreHead(html); - } - - /** - * The content of this page is the AggregatedLogsBlock - * - * @return AggregatedLogsBlock.class - */ - @Override - protected Class<? extends SubView> content() { - return AggregatedLogsBlock.class; - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSView.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSView.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSView.java deleted file mode 100644 index 4baa75d..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSView.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import static org.apache.hadoop.yarn.util.StringHelper.sjoin; -import static org.apache.hadoop.yarn.webapp.YarnWebParams.APP_STATE; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.ACCORDION; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.ACCORDION_ID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.tableInit; - -import org.apache.hadoop.yarn.server.webapp.AppsBlock; -import org.apache.hadoop.yarn.webapp.SubView; -import org.apache.hadoop.yarn.webapp.view.TwoColumnLayout; - -// Do NOT rename/refactor this to AHSView as it will wreak havoc -// on Mac OS HFS -public class AHSView extends TwoColumnLayout { - static final int MAX_DISPLAY_ROWS = 100; // direct table rendering - static final int MAX_FAST_ROWS = 1000; // inline js array - - @Override - protected void preHead(Page.HTML<_> html) { - commonPreHead(html); - set(DATATABLES_ID, "apps"); - set(initID(DATATABLES, "apps"), appsTableInit()); - setTableStyles(html, "apps", ".queue {width:6em}", ".ui {width:8em}"); - - // Set the correct title. - String reqState = $(APP_STATE); - reqState = (reqState == null || reqState.isEmpty() ? "All" : reqState); - setTitle(sjoin(reqState, "Applications")); - } - - protected void commonPreHead(Page.HTML<_> html) { - set(ACCORDION_ID, "nav"); - set(initID(ACCORDION, "nav"), "{autoHeight:false, active:0}"); - } - - @Override - protected Class<? extends SubView> nav() { - return NavBlock.class; - } - - @Override - protected Class<? extends SubView> content() { - return AppsBlock.class; - } - - private String appsTableInit() { - // id, user, name, queue, starttime, finishtime, state, status, progress, ui - return tableInit().append(", 'aaData': appsTableData") - .append(", bDeferRender: true").append(", bProcessing: true") - - .append("\n, aoColumnDefs: ").append(getAppsTableColumnDefs()) - - // Sort by id upon page load - .append(", aaSorting: [[0, 'desc']]}").toString(); - } - - protected String getAppsTableColumnDefs() { - StringBuilder sb = new StringBuilder(); - return sb.append("[\n").append("{'sType':'numeric', 'aTargets': [0]") - .append(", 'mRender': parseHadoopID }") - - .append("\n, {'sType':'numeric', 'aTargets': [5, 6]") - .append(", 'mRender': renderHadoopDate }") - - .append("\n, {'sType':'numeric', bSearchable:false, 'aTargets': [9]") - .append(", 'mRender': parseHadoopProgress }]").toString(); - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebApp.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebApp.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebApp.java deleted file mode 100644 index 8cff741..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebApp.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import static org.apache.hadoop.yarn.util.StringHelper.pajoin; - -import org.apache.hadoop.yarn.server.api.ApplicationContext; -import org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryManager; -import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricStore; -import org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.TimelineStore; -import org.apache.hadoop.yarn.webapp.GenericExceptionHandler; -import org.apache.hadoop.yarn.webapp.WebApp; -import org.apache.hadoop.yarn.webapp.YarnJacksonJaxbJsonProvider; -import org.apache.hadoop.yarn.webapp.YarnWebParams; - -public class AHSWebApp extends WebApp implements YarnWebParams { - - private final ApplicationHistoryManager applicationHistoryManager; - private final TimelineStore timelineStore; - private final TimelineMetricStore timelineMetricStore; - - public AHSWebApp(ApplicationHistoryManager applicationHistoryManager, - TimelineStore timelineStore, TimelineMetricStore timelineMetricStore) { - this.applicationHistoryManager = applicationHistoryManager; - this.timelineStore = timelineStore; - this.timelineMetricStore = timelineMetricStore; - } - - @Override - public void setup() { - bind(YarnJacksonJaxbJsonProvider.class); - bind(AHSWebServices.class); - bind(TimelineWebServices.class); - bind(GenericExceptionHandler.class); - bind(ApplicationContext.class).toInstance(applicationHistoryManager); - bind(TimelineStore.class).toInstance(timelineStore); - bind(TimelineMetricStore.class).toInstance(timelineMetricStore); - route("/", AHSController.class); - route(pajoin("/apps", APP_STATE), AHSController.class); - route(pajoin("/app", APPLICATION_ID), AHSController.class, "app"); - route(pajoin("/appattempt", APPLICATION_ATTEMPT_ID), AHSController.class, - "appattempt"); - route(pajoin("/container", CONTAINER_ID), AHSController.class, "container"); - route( - pajoin("/logs", NM_NODENAME, CONTAINER_ID, ENTITY_STRING, APP_OWNER, - CONTAINER_LOG_TYPE), AHSController.class, "logs"); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebServices.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebServices.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebServices.java deleted file mode 100644 index 2040f57..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AHSWebServices.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import java.util.Collections; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; - -import org.apache.hadoop.yarn.api.records.YarnApplicationState; -import org.apache.hadoop.yarn.server.api.ApplicationContext; -import org.apache.hadoop.yarn.server.webapp.WebServices; -import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; -import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptsInfo; -import org.apache.hadoop.yarn.server.webapp.dao.AppInfo; -import org.apache.hadoop.yarn.server.webapp.dao.AppsInfo; -import org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo; -import org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo; -import org.apache.hadoop.yarn.webapp.BadRequestException; - -import com.google.inject.Inject; -import com.google.inject.Singleton; - -@Singleton -@Path("/ws/v1/applicationhistory") -public class AHSWebServices extends WebServices { - - @Inject - public AHSWebServices(ApplicationContext appContext) { - super(appContext); - } - - @GET - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - public AppsInfo get(@Context HttpServletRequest req, - @Context HttpServletResponse res) { - return getApps(req, res, null, Collections.<String> emptySet(), null, null, - null, null, null, null, null, null, Collections.<String> emptySet()); - } - - @GET - @Path("/apps") - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Override - public AppsInfo getApps(@Context HttpServletRequest req, - @Context HttpServletResponse res, @QueryParam("state") String stateQuery, - @QueryParam("states") Set<String> statesQuery, - @QueryParam("finalStatus") String finalStatusQuery, - @QueryParam("user") String userQuery, - @QueryParam("queue") String queueQuery, - @QueryParam("limit") String count, - @QueryParam("startedTimeBegin") String startedBegin, - @QueryParam("startedTimeEnd") String startedEnd, - @QueryParam("finishedTimeBegin") String finishBegin, - @QueryParam("finishedTimeEnd") String finishEnd, - @QueryParam("applicationTypes") Set<String> applicationTypes) { - init(res); - validateStates(stateQuery, statesQuery); - return super.getApps(req, res, stateQuery, statesQuery, finalStatusQuery, - userQuery, queueQuery, count, startedBegin, startedEnd, finishBegin, - finishEnd, applicationTypes); - } - - @GET - @Path("/apps/{appid}") - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Override - public AppInfo getApp(@Context HttpServletRequest req, - @Context HttpServletResponse res, @PathParam("appid") String appId) { - init(res); - return super.getApp(req, res, appId); - } - - @GET - @Path("/apps/{appid}/appattempts") - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Override - public AppAttemptsInfo getAppAttempts(@Context HttpServletRequest req, - @Context HttpServletResponse res, @PathParam("appid") String appId) { - init(res); - return super.getAppAttempts(req, res, appId); - } - - @GET - @Path("/apps/{appid}/appattempts/{appattemptid}") - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Override - public AppAttemptInfo getAppAttempt(@Context HttpServletRequest req, - @Context HttpServletResponse res, @PathParam("appid") String appId, - @PathParam("appattemptid") String appAttemptId) { - init(res); - return super.getAppAttempt(req, res, appId, appAttemptId); - } - - @GET - @Path("/apps/{appid}/appattempts/{appattemptid}/containers") - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Override - public ContainersInfo getContainers(@Context HttpServletRequest req, - @Context HttpServletResponse res, @PathParam("appid") String appId, - @PathParam("appattemptid") String appAttemptId) { - init(res); - return super.getContainers(req, res, appId, appAttemptId); - } - - @GET - @Path("/apps/{appid}/appattempts/{appattemptid}/containers/{containerid}") - @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) - @Override - public ContainerInfo getContainer(@Context HttpServletRequest req, - @Context HttpServletResponse res, @PathParam("appid") String appId, - @PathParam("appattemptid") String appAttemptId, - @PathParam("containerid") String containerId) { - init(res); - return super.getContainer(req, res, appId, appAttemptId, containerId); - } - - private static void - validateStates(String stateQuery, Set<String> statesQuery) { - // stateQuery is deprecated. - if (stateQuery != null && !stateQuery.isEmpty()) { - statesQuery.add(stateQuery); - } - Set<String> appStates = parseQueries(statesQuery, true); - for (String appState : appStates) { - switch (YarnApplicationState.valueOf(appState.toUpperCase())) { - case FINISHED: - case FAILED: - case KILLED: - continue; - default: - throw new BadRequestException("Invalid application-state " + appState - + " specified. It should be a final state"); - } - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java deleted file mode 100644 index 63b44bd..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppAttemptPage.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import static org.apache.hadoop.yarn.util.StringHelper.join; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.tableInit; - -import org.apache.hadoop.yarn.server.webapp.AppAttemptBlock; -import org.apache.hadoop.yarn.webapp.SubView; -import org.apache.hadoop.yarn.webapp.YarnWebParams; - -public class AppAttemptPage extends AHSView { - - @Override - protected void preHead(Page.HTML<_> html) { - commonPreHead(html); - - String appAttemptId = $(YarnWebParams.APPLICATION_ATTEMPT_ID); - set( - TITLE, - appAttemptId.isEmpty() ? "Bad request: missing application attempt ID" - : join("Application Attempt ", - $(YarnWebParams.APPLICATION_ATTEMPT_ID))); - - set(DATATABLES_ID, "containers"); - set(initID(DATATABLES, "containers"), containersTableInit()); - setTableStyles(html, "containers", ".queue {width:6em}", ".ui {width:8em}"); - } - - @Override - protected Class<? extends SubView> content() { - return AppAttemptBlock.class; - } - - private String containersTableInit() { - return tableInit().append(", 'aaData': containersTableData") - .append(", bDeferRender: true").append(", bProcessing: true") - - .append("\n, aoColumnDefs: ").append(getContainersTableColumnDefs()) - - // Sort by id upon page load - .append(", aaSorting: [[0, 'desc']]}").toString(); - } - - protected String getContainersTableColumnDefs() { - StringBuilder sb = new StringBuilder(); - return sb.append("[\n").append("{'sType':'numeric', 'aTargets': [0]") - .append(", 'mRender': parseHadoopID }]").toString(); - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java deleted file mode 100644 index 96ca659..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/AppPage.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import static org.apache.hadoop.yarn.util.StringHelper.join; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.DATATABLES_ID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.initID; -import static org.apache.hadoop.yarn.webapp.view.JQueryUI.tableInit; - -import org.apache.hadoop.yarn.server.webapp.AppBlock; -import org.apache.hadoop.yarn.webapp.SubView; -import org.apache.hadoop.yarn.webapp.YarnWebParams; - -public class AppPage extends AHSView { - - @Override - protected void preHead(Page.HTML<_> html) { - commonPreHead(html); - - String appId = $(YarnWebParams.APPLICATION_ID); - set( - TITLE, - appId.isEmpty() ? "Bad request: missing application ID" : join( - "Application ", $(YarnWebParams.APPLICATION_ID))); - - set(DATATABLES_ID, "attempts"); - set(initID(DATATABLES, "attempts"), attemptsTableInit()); - setTableStyles(html, "attempts", ".queue {width:6em}", ".ui {width:8em}"); - } - - @Override - protected Class<? extends SubView> content() { - return AppBlock.class; - } - - private String attemptsTableInit() { - return tableInit().append(", 'aaData': attemptsTableData") - .append(", bDeferRender: true").append(", bProcessing: true") - - .append("\n, aoColumnDefs: ").append(getAttemptsTableColumnDefs()) - - // Sort by id upon page load - .append(", aaSorting: [[0, 'desc']]}").toString(); - } - - protected String getAttemptsTableColumnDefs() { - StringBuilder sb = new StringBuilder(); - return sb.append("[\n").append("{'sType':'numeric', 'aTargets': [0]") - .append(", 'mRender': parseHadoopID }") - - .append("\n, {'sType':'numeric', 'aTargets': [1]") - .append(", 'mRender': renderHadoopDate }]").toString(); - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/ContainerPage.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/ContainerPage.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/ContainerPage.java deleted file mode 100644 index 1be8a26..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/ContainerPage.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import static org.apache.hadoop.yarn.util.StringHelper.join; - -import org.apache.hadoop.yarn.server.webapp.ContainerBlock; -import org.apache.hadoop.yarn.webapp.SubView; -import org.apache.hadoop.yarn.webapp.YarnWebParams; - -public class ContainerPage extends AHSView { - - @Override - protected void preHead(Page.HTML<_> html) { - commonPreHead(html); - - String containerId = $(YarnWebParams.CONTAINER_ID); - set(TITLE, containerId.isEmpty() ? "Bad request: missing container ID" - : join("Container ", $(YarnWebParams.CONTAINER_ID))); - } - - @Override - protected Class<? extends SubView> content() { - return ContainerBlock.class; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/JAXBContextResolver.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/JAXBContextResolver.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/JAXBContextResolver.java deleted file mode 100644 index 5fd0124..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/JAXBContextResolver.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import javax.ws.rs.ext.ContextResolver; -import javax.ws.rs.ext.Provider; -import javax.xml.bind.JAXBContext; - -import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo; -import org.apache.hadoop.yarn.server.webapp.dao.AppAttemptsInfo; -import org.apache.hadoop.yarn.server.webapp.dao.AppInfo; -import org.apache.hadoop.yarn.server.webapp.dao.AppsInfo; -import org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo; -import org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo; - -import com.google.inject.Singleton; -import com.sun.jersey.api.json.JSONConfiguration; -import com.sun.jersey.api.json.JSONJAXBContext; - -@Singleton -@Provider -@SuppressWarnings("rawtypes") -public class JAXBContextResolver implements ContextResolver<JAXBContext> { - - private JAXBContext context; - private final Set<Class> types; - - // you have to specify all the dao classes here - private final Class[] cTypes = { AppInfo.class, AppsInfo.class, - AppAttemptInfo.class, AppAttemptsInfo.class, ContainerInfo.class, - ContainersInfo.class }; - - public JAXBContextResolver() throws Exception { - this.types = new HashSet<Class>(Arrays.asList(cTypes)); - this.context = - new JSONJAXBContext(JSONConfiguration.natural().rootUnwrapping(false) - .build(), cTypes); - } - - @Override - public JAXBContext getContext(Class<?> objectType) { - return (types.contains(objectType)) ? context : null; - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/NavBlock.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/NavBlock.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/NavBlock.java deleted file mode 100644 index e84ddec..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/NavBlock.java +++ /dev/null @@ -1,51 +0,0 @@ -/** -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import org.apache.hadoop.yarn.api.records.YarnApplicationState; -import org.apache.hadoop.yarn.webapp.view.HtmlBlock; - -public class NavBlock extends HtmlBlock { - - @Override - public void render(Block html) { - html. - div("#nav"). - h3("Application History"). - ul(). - li().a(url("apps"), "Applications"). - ul(). - li().a(url("apps", - YarnApplicationState.FINISHED.toString()), - YarnApplicationState.FINISHED.toString()). - _(). - li().a(url("apps", - YarnApplicationState.FAILED.toString()), - YarnApplicationState.FAILED.toString()). - _(). - li().a(url("apps", - YarnApplicationState.KILLED.toString()), - YarnApplicationState.KILLED.toString()). - _(). - _(). - _(). - _(). - _(); - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java deleted file mode 100644 index c9d56fc..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/webapp/TimelineWebServices.java +++ /dev/null @@ -1,504 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hadoop.yarn.server.applicationhistoryservice.webapp; - -import com.google.inject.Inject; -import com.google.inject.Singleton; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.classification.InterfaceAudience.Public; -import org.apache.hadoop.classification.InterfaceStability.Unstable; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEntities; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEntity; -import org.apache.hadoop.yarn.api.records.timeline.TimelineEvents; -import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric; -import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics; -import org.apache.hadoop.yarn.api.records.timeline.TimelinePutResponse; -import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricStore; -import org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.EntityIdentifier; -import org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.GenericObjectMapper; -import org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.NameValuePair; -import org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.TimelineReader.Field; -import org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.TimelineStore; -import org.apache.hadoop.yarn.util.timeline.TimelineUtils; -import org.apache.hadoop.yarn.webapp.BadRequestException; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.io.IOException; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import static org.apache.hadoop.yarn.util.StringHelper.CSV_JOINER; - -@Singleton -@Path("/ws/v1/timeline") -//TODO: support XML serialization/deserialization -public class TimelineWebServices { - - private static final Log LOG = LogFactory.getLog(TimelineWebServices.class); - - private TimelineStore store; - private TimelineMetricStore timelineMetricStore; - - @Inject - public TimelineWebServices(TimelineStore store, - TimelineMetricStore timelineMetricStore) { - this.store = store; - this.timelineMetricStore = timelineMetricStore; - } - - @XmlRootElement(name = "about") - @XmlAccessorType(XmlAccessType.NONE) - @Public - @Unstable - public static class AboutInfo { - - private String about; - - public AboutInfo() { - - } - - public AboutInfo(String about) { - this.about = about; - } - - @XmlElement(name = "About") - public String getAbout() { - return about; - } - - public void setAbout(String about) { - this.about = about; - } - - } - - /** - * Return the description of the timeline web services. - */ - @GET - @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public AboutInfo about( - @Context HttpServletRequest req, - @Context HttpServletResponse res) { - init(res); - return new AboutInfo("Timeline API"); - } - - /** - * Return a list of entities that match the given parameters. - */ - @GET - @Path("/{entityType}") - @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelineEntities getEntities( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - @PathParam("entityType") String entityType, - @QueryParam("primaryFilter") String primaryFilter, - @QueryParam("secondaryFilter") String secondaryFilter, - @QueryParam("windowStart") String windowStart, - @QueryParam("windowEnd") String windowEnd, - @QueryParam("fromId") String fromId, - @QueryParam("fromTs") String fromTs, - @QueryParam("limit") String limit, - @QueryParam("fields") String fields) { - init(res); - TimelineEntities entities = null; - try { - entities = store.getEntities( - parseStr(entityType), - parseLongStr(limit), - parseLongStr(windowStart), - parseLongStr(windowEnd), - parseStr(fromId), - parseLongStr(fromTs), - parsePairStr(primaryFilter, ":"), - parsePairsStr(secondaryFilter, ",", ":"), - parseFieldsStr(fields, ",")); - } catch (NumberFormatException e) { - throw new BadRequestException( - "windowStart, windowEnd or limit is not a numeric value."); - } catch (IllegalArgumentException e) { - throw new BadRequestException("requested invalid field."); - } catch (IOException e) { - LOG.error("Error getting entities", e); - throw new WebApplicationException(e, - Response.Status.INTERNAL_SERVER_ERROR); - } - if (entities == null) { - return new TimelineEntities(); - } - return entities; - } - - /** - * Return a single entity of the given entity type and Id. - */ - @GET - @Path("/{entityType}/{entityId}") - @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelineEntity getEntity( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - @PathParam("entityType") String entityType, - @PathParam("entityId") String entityId, - @QueryParam("fields") String fields) { - init(res); - TimelineEntity entity = null; - try { - entity = - store.getEntity(parseStr(entityId), parseStr(entityType), - parseFieldsStr(fields, ",")); - } catch (IllegalArgumentException e) { - throw new BadRequestException( - "requested invalid field."); - } catch (IOException e) { - LOG.error("Error getting entity", e); - throw new WebApplicationException(e, - Response.Status.INTERNAL_SERVER_ERROR); - } - if (entity == null) { - throw new WebApplicationException(Response.Status.NOT_FOUND); - } - return entity; - } - - /** - * Return the events that match the given parameters. - */ - @GET - @Path("/{entityType}/events") - @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelineEvents getEvents( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - @PathParam("entityType") String entityType, - @QueryParam("entityId") String entityId, - @QueryParam("eventType") String eventType, - @QueryParam("windowStart") String windowStart, - @QueryParam("windowEnd") String windowEnd, - @QueryParam("limit") String limit) { - init(res); - TimelineEvents events = null; - try { - events = store.getEntityTimelines( - parseStr(entityType), - parseArrayStr(entityId, ","), - parseLongStr(limit), - parseLongStr(windowStart), - parseLongStr(windowEnd), - parseArrayStr(eventType, ",")); - } catch (NumberFormatException e) { - throw new BadRequestException( - "windowStart, windowEnd or limit is not a numeric value."); - } catch (IOException e) { - LOG.error("Error getting entity timelines", e); - throw new WebApplicationException(e, - Response.Status.INTERNAL_SERVER_ERROR); - } - if (events == null) { - return new TimelineEvents(); - } - return events; - } - - /** - * Store the given metrics into the timeline store, and return errors that - * happened during storing. - */ - @Path("/metrics") - @POST - @Consumes({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelinePutResponse postMetrics( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - TimelineMetrics metrics) { - - init(res); - if (metrics == null) { - return new TimelinePutResponse(); - } - - try { - - // TODO: Check ACLs for MetricEntity using the TimelineACLManager. - // TODO: Save owner of the MetricEntity. - - if (LOG.isDebugEnabled()) { - LOG.debug("Storing metrics: " + - TimelineUtils.dumpTimelineRecordtoJSON(metrics, true)); - } - - return timelineMetricStore.putMetrics(metrics); - - } catch (Exception e) { - LOG.error("Error saving metrics.", e); - throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR); - } - } - - /** - * Query for a particular metric satisfying the filter criteria. - * @return {@link TimelineMetric} - */ - @GET - @Path("/metrics/{metricName}") - @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelineMetric getTimelineMetric( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - @PathParam("metricName") String metricName, - @QueryParam("appId") String appId, - @QueryParam("instanceId") String instanceId, - @QueryParam("hostname") String hostname, - @QueryParam("startTime") String startTime, - @QueryParam("endTime") String endTime, - @QueryParam("limit") String limit - ) { - init(res); - try { - return timelineMetricStore.getTimelineMetric(metricName, hostname, - appId, instanceId, parseLongStr(startTime), parseLongStr(endTime), - parseIntStr(limit)); - - } catch (NumberFormatException ne) { - throw new BadRequestException("startTime and limit should be numeric " + - "values"); - } catch (SQLException sql) { - throw new WebApplicationException(sql, - Response.Status.INTERNAL_SERVER_ERROR); - } catch (IOException io) { - throw new WebApplicationException(io, - Response.Status.INTERNAL_SERVER_ERROR); - } - } - - /** - * Query for a set of different metrics satisfying the filter criteria. - * All query params are optional. The default limit will apply if none - * specified. - * - * @param metricNames Comma separated list of metrics to retrieve. - * @param appId Application Id for the requested metrics. - * @param instanceId Application instance id. - * @param hostname Hostname where the metrics originated. - * @param startTime Start time for the metric records retrieved. - * @param limit limit on total number of {@link TimelineMetric} records - * retrieved. - * @return {@link TimelineMetrics} - */ - @GET - @Path("/metrics") - @Produces({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelineMetrics getTimelineMetrics( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - @QueryParam("metricNames") String metricNames, - @QueryParam("appId") String appId, - @QueryParam("instanceId") String instanceId, - @QueryParam("hostname") String hostname, - @QueryParam("startTime") String startTime, - @QueryParam("endTime") String endTime, - @QueryParam("limit") String limit, - @QueryParam("grouped") String grouped - ) { - init(res); - try { - LOG.debug("Request for metrics => metricNames: " + metricNames + ", " + - "appId: " + appId + ", instanceId: " + instanceId + ", " + - "hostname: " + hostname + ", startTime: " + startTime + ", " + - "endTime: " + endTime); - - return timelineMetricStore.getTimelineMetrics( - parseListStr(metricNames, ","), hostname, appId, instanceId, - parseLongStr(startTime), parseLongStr(endTime), parseIntStr(limit), - parseBoolean(grouped)); - - } catch (NumberFormatException ne) { - throw new BadRequestException("startTime and limit should be numeric " + - "values"); - } catch (SQLException sql) { - throw new WebApplicationException(sql, - Response.Status.INTERNAL_SERVER_ERROR); - } catch (IOException io) { - throw new WebApplicationException(io, - Response.Status.INTERNAL_SERVER_ERROR); - } - } - - - /** - * Store the given entities into the timeline store, and return the errors - * that happen during storing. - */ - @POST - @Consumes({ MediaType.APPLICATION_JSON /* , MediaType.APPLICATION_XML */}) - public TimelinePutResponse postEntities( - @Context HttpServletRequest req, - @Context HttpServletResponse res, - TimelineEntities entities) { - init(res); - if (entities == null) { - return new TimelinePutResponse(); - } - try { - List<EntityIdentifier> entityIDs = new ArrayList<EntityIdentifier>(); - for (TimelineEntity entity : entities.getEntities()) { - EntityIdentifier entityID = - new EntityIdentifier(entity.getEntityId(), entity.getEntityType()); - entityIDs.add(entityID); - if (LOG.isDebugEnabled()) { - LOG.debug("Storing the entity " + entityID + ", JSON-style content: " - + TimelineUtils.dumpTimelineRecordtoJSON(entity)); - } - } - if (LOG.isDebugEnabled()) { - LOG.debug("Storing entities: " + CSV_JOINER.join(entityIDs)); - } - return store.put(entities); - } catch (IOException e) { - LOG.error("Error putting entities", e); - throw new WebApplicationException(e, - Response.Status.INTERNAL_SERVER_ERROR); - } - } - - private void init(HttpServletResponse response) { - response.setContentType(null); - } - - private static SortedSet<String> parseArrayStr(String str, String delimiter) { - if (str == null) { - return null; - } - SortedSet<String> strSet = new TreeSet<String>(); - String[] strs = str.split(delimiter); - for (String aStr : strs) { - strSet.add(aStr.trim()); - } - return strSet; - } - - private static NameValuePair parsePairStr(String str, String delimiter) { - if (str == null) { - return null; - } - String[] strs = str.split(delimiter, 2); - try { - return new NameValuePair(strs[0].trim(), - GenericObjectMapper.OBJECT_READER.readValue(strs[1].trim())); - } catch (Exception e) { - // didn't work as an Object, keep it as a String - return new NameValuePair(strs[0].trim(), strs[1].trim()); - } - } - - private static Collection<NameValuePair> parsePairsStr( - String str, String aDelimiter, String pDelimiter) { - if (str == null) { - return null; - } - String[] strs = str.split(aDelimiter); - Set<NameValuePair> pairs = new HashSet<NameValuePair>(); - for (String aStr : strs) { - pairs.add(parsePairStr(aStr, pDelimiter)); - } - return pairs; - } - - private static EnumSet<Field> parseFieldsStr(String str, String delimiter) { - if (str == null) { - return null; - } - String[] strs = str.split(delimiter); - List<Field> fieldList = new ArrayList<Field>(); - for (String s : strs) { - s = s.trim().toUpperCase(); - if (s.equals("EVENTS")) { - fieldList.add(Field.EVENTS); - } else if (s.equals("LASTEVENTONLY")) { - fieldList.add(Field.LAST_EVENT_ONLY); - } else if (s.equals("RELATEDENTITIES")) { - fieldList.add(Field.RELATED_ENTITIES); - } else if (s.equals("PRIMARYFILTERS")) { - fieldList.add(Field.PRIMARY_FILTERS); - } else if (s.equals("OTHERINFO")) { - fieldList.add(Field.OTHER_INFO); - } else { - throw new IllegalArgumentException("Requested nonexistent field " + s); - } - } - if (fieldList.size() == 0) { - return null; - } - Field f1 = fieldList.remove(fieldList.size() - 1); - if (fieldList.size() == 0) { - return EnumSet.of(f1); - } else { - return EnumSet.of(f1, fieldList.toArray(new Field[fieldList.size()])); - } - } - - private static Long parseLongStr(String str) { - return str == null ? null : Long.parseLong(str.trim()); - } - - private static Integer parseIntStr(String str) { - return str == null ? null : Integer.parseInt(str.trim()); - } - - private static boolean parseBoolean(String booleanStr) { - return booleanStr == null || Boolean.parseBoolean(booleanStr); - } - - private static List<String> parseListStr(String str, String delimiter) { - return str == null ? null : Arrays.asList(str.trim().split(delimiter)); - } - - private static String parseStr(String str) { - return str == null ? null : str.trim(); - } - -} http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat deleted file mode 100644 index e157630..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/DATANODE.dat +++ /dev/null @@ -1,101 +0,0 @@ -| dfs.datanode.BlockChecksumOpAvgTime | datanode | -| dfs.datanode.BlockChecksumOpNumOps | datanode | -| dfs.datanode.BlockReportsAvgTime | datanode | -| dfs.datanode.BlockReportsNumOps | datanode | -| dfs.datanode.BlockVerificationFailures | datanode | -| dfs.datanode.BlocksCached | datanode | -| dfs.datanode.BlocksGetLocalPathInfo | datanode | -| dfs.datanode.BlocksRead | datanode | -| dfs.datanode.BlocksRemoved | datanode | -| dfs.datanode.BlocksReplicated | datanode | -| dfs.datanode.BlocksUncached | datanode | -| dfs.datanode.BlocksVerified | datanode | -| dfs.datanode.BlocksWritten | datanode | -| dfs.datanode.BytesRead | datanode | -| dfs.datanode.BytesWritten | datanode | -| dfs.datanode.CacheReportsAvgTime | datanode | -| dfs.datanode.CacheReportsNumOps | datanode | -| dfs.datanode.CopyBlockOpAvgTime | datanode | -| dfs.datanode.CopyBlockOpNumOps | datanode | -| dfs.datanode.FlushNanosAvgTime | datanode | -| dfs.datanode.FlushNanosNumOps | datanode | -| dfs.datanode.FsyncCount | datanode | -| dfs.datanode.FsyncNanosAvgTime | datanode | -| dfs.datanode.FsyncNanosNumOps | datanode | -| dfs.datanode.HeartbeatsAvgTime | datanode | -| dfs.datanode.HeartbeatsNumOps | datanode | -| dfs.datanode.PacketAckRoundTripTimeNanosAvgTime | datanode | -| dfs.datanode.PacketAckRoundTripTimeNanosNumOps | datanode | -| dfs.datanode.ReadBlockOpAvgTime | datanode | -| dfs.datanode.ReadBlockOpNumOps | datanode | -| dfs.datanode.ReadsFromLocalClient | datanode | -| dfs.datanode.ReadsFromRemoteClient | datanode | -| dfs.datanode.ReplaceBlockOpAvgTime | datanode | -| dfs.datanode.ReplaceBlockOpNumOps | datanode | -| dfs.datanode.SendDataPacketBlockedOnNetworkNanosAvgTime | datanode | -| dfs.datanode.SendDataPacketBlockedOnNetworkNanosNumOps | datanode | -| dfs.datanode.SendDataPacketTransferNanosAvgTime | datanode | -| dfs.datanode.SendDataPacketTransferNanosNumOps | datanode | -| dfs.datanode.VolumeFailures | datanode | -| dfs.datanode.WriteBlockOpAvgTime | datanode | -| dfs.datanode.WriteBlockOpNumOps | datanode | -| dfs.datanode.WritesFromLocalClient | datanode | -| dfs.datanode.WritesFromRemoteClient | datanode | -| jvm.JvmMetrics.GcCount | datanode | -| jvm.JvmMetrics.GcCountCopy | datanode | -| jvm.JvmMetrics.GcCountMarkSweepCompact | datanode | -| jvm.JvmMetrics.GcTimeMillis | datanode | -| jvm.JvmMetrics.GcTimeMillisCopy | datanode | -| jvm.JvmMetrics.GcTimeMillisMarkSweepCompact | datanode | -| jvm.JvmMetrics.LogError | datanode | -| jvm.JvmMetrics.LogFatal | datanode | -| jvm.JvmMetrics.LogInfo | datanode | -| jvm.JvmMetrics.LogWarn | datanode | -| jvm.JvmMetrics.MemHeapCommittedM | datanode | -| jvm.JvmMetrics.MemHeapMaxM | datanode | -| jvm.JvmMetrics.MemHeapUsedM | datanode | -| jvm.JvmMetrics.MemMaxM | datanode | -| jvm.JvmMetrics.MemNonHeapCommittedM | datanode | -| jvm.JvmMetrics.MemNonHeapMaxM | datanode | -| jvm.JvmMetrics.MemNonHeapUsedM | datanode | -| jvm.JvmMetrics.ThreadsBlocked | datanode | -| jvm.JvmMetrics.ThreadsNew | datanode | -| jvm.JvmMetrics.ThreadsRunnable | datanode | -| jvm.JvmMetrics.ThreadsTerminated | datanode | -| jvm.JvmMetrics.ThreadsTimedWaiting | datanode | -| jvm.JvmMetrics.ThreadsWaiting | datanode | -| metricssystem.MetricsSystem.DroppedPubAll | datanode | -| metricssystem.MetricsSystem.NumActiveSinks | datanode | -| metricssystem.MetricsSystem.NumActiveSources | datanode | -| metricssystem.MetricsSystem.NumAllSinks | datanode | -| metricssystem.MetricsSystem.NumAllSources | datanode | -| metricssystem.MetricsSystem.PublishAvgTime | datanode | -| metricssystem.MetricsSystem.PublishNumOps | datanode | -| metricssystem.MetricsSystem.Sink_timelineAvgTime | datanode | -| metricssystem.MetricsSystem.Sink_timelineDropped | datanode | -| metricssystem.MetricsSystem.Sink_timelineNumOps | datanode | -| metricssystem.MetricsSystem.Sink_timelineQsize | datanode | -| metricssystem.MetricsSystem.SnapshotAvgTime | datanode | -| metricssystem.MetricsSystem.SnapshotNumOps | datanode | -| rpc.rpc.CallQueueLength | datanode | -| rpc.rpc.NumOpenConnections | datanode | -| rpc.rpc.ReceivedBytes | datanode | -| rpc.rpc.RpcAuthenticationFailures | datanode | -| rpc.rpc.RpcAuthenticationSuccesses | datanode | -| rpc.rpc.RpcAuthorizationFailures | datanode | -| rpc.rpc.RpcAuthorizationSuccesses | datanode | -| rpc.rpc.RpcProcessingTimeAvgTime | datanode | -| rpc.rpc.RpcProcessingTimeNumOps | datanode | -| rpc.rpc.RpcQueueTimeAvgTime | datanode | -| rpc.rpc.RpcQueueTimeNumOps | datanode | -| rpc.rpc.SentBytes | datanode | -| rpcdetailed.rpcdetailed.InitReplicaRecoveryAvgTime | datanode | -| rpcdetailed.rpcdetailed.InitReplicaRecoveryNumOps | datanode | -| rpcdetailed.rpcdetailed.UpdateReplicaUnderRecoveryAvgTime | datanode | -| rpcdetailed.rpcdetailed.UpdateReplicaUnderRecoveryNumOps | datanode | -| ugi.UgiMetrics.GetGroupsAvgTime | datanode | -| ugi.UgiMetrics.GetGroupsNumOps | datanode | -| ugi.UgiMetrics.LoginFailureAvgTime | datanode | -| ugi.UgiMetrics.LoginFailureNumOps | datanode | -| ugi.UgiMetrics.LoginSuccessAvgTime | datanode | -| ugi.UgiMetrics.LoginSuccessNumOps | datanode | http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat deleted file mode 100644 index c940800..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/HOST.dat +++ /dev/null @@ -1,23 +0,0 @@ -bytes_in -bytes_out -cpu_idle -cpu_intr -cpu_nice -cpu_sintr -cpu_system -cpu_user -cpu_wio -disk_free -disk_percent -disk_total -disk_used -load_fifteen -load_five -load_one -mem_buffered -mem_cached -mem_free -mem_shared -pkts_in -pkts_out -swap_free \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat deleted file mode 100644 index 9ba90f1..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/MASTER_HBASE.dat +++ /dev/null @@ -1,69 +0,0 @@ -ipc.IPC.authenticationFailures -ipc.IPC.authenticationSuccesses -ipc.IPC.authorizationFailures -ipc.IPC.authorizationSuccesses -ipc.IPC.numCallsInGeneralQueue -ipc.IPC.numCallsInPriorityQueue -ipc.IPC.numCallsInReplicationQueue -ipc.IPC.numOpenConnections -ipc.IPC.ProcessCallTime_75th_percentile -ipc.IPC.ProcessCallTime_95th_percentile -ipc.IPC.ProcessCallTime_99th_percentile -ipc.IPC.ProcessCallTime_max -ipc.IPC.ProcessCallTime_mean -ipc.IPC.ProcessCallTime_median -ipc.IPC.ProcessCallTime_min -ipc.IPC.ProcessCallTime_num_ops -ipc.IPC.QueueCallTime_75th_percentile -ipc.IPC.QueueCallTime_95th_percentile -ipc.IPC.QueueCallTime_99th_percentile -ipc.IPC.QueueCallTime_max -ipc.IPC.QueueCallTime_mean -ipc.IPC.QueueCallTime_median -ipc.IPC.QueueCallTime_min -ipc.IPC.QueueCallTime_num_ops -ipc.IPC.queueSize -ipc.IPC.receivedBytes -ipc.IPC.sentBytes -jvm.JvmMetrics.GcCount -jvm.JvmMetrics.GcCountConcurrentMarkSweep -jvm.JvmMetrics.GcCountCopy -jvm.JvmMetrics.GcTimeMillis -jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep -jvm.JvmMetrics.GcTimeMillisCopy -jvm.JvmMetrics.LogError -jvm.JvmMetrics.LogFatal -jvm.JvmMetrics.LogInfo -jvm.JvmMetrics.LogWarn -jvm.JvmMetrics.MemHeapCommittedM -jvm.JvmMetrics.MemHeapMaxM -jvm.JvmMetrics.MemHeapUsedM -jvm.JvmMetrics.MemMaxM -jvm.JvmMetrics.MemNonHeapCommittedM -jvm.JvmMetrics.MemNonHeapMaxM -jvm.JvmMetrics.MemNonHeapUsedM -jvm.JvmMetrics.ThreadsBlocked -jvm.JvmMetrics.ThreadsNew -jvm.JvmMetrics.ThreadsRunnable -jvm.JvmMetrics.ThreadsTerminated -jvm.JvmMetrics.ThreadsTimedWaiting -jvm.JvmMetrics.ThreadsWaiting -metricssystem.MetricsSystem.DroppedPubAll -metricssystem.MetricsSystem.NumActiveSinks -metricssystem.MetricsSystem.NumActiveSources -metricssystem.MetricsSystem.NumAllSinks -metricssystem.MetricsSystem.NumAllSources -metricssystem.MetricsSystem.PublishAvgTime -metricssystem.MetricsSystem.PublishNumOps -metricssystem.MetricsSystem.Sink_timelineAvgTime -metricssystem.MetricsSystem.Sink_timelineDropped -metricssystem.MetricsSystem.Sink_timelineNumOps -metricssystem.MetricsSystem.Sink_timelineQsize -metricssystem.MetricsSystem.SnapshotAvgTime -metricssystem.MetricsSystem.SnapshotNumOps -ugi.UgiMetrics.GetGroupsAvgTime -ugi.UgiMetrics.GetGroupsNumOps -ugi.UgiMetrics.LoginFailureAvgTime -ugi.UgiMetrics.LoginFailureNumOps -ugi.UgiMetrics.LoginSuccessAvgTime -ugi.UgiMetrics.LoginSuccessNumOps http://git-wip-us.apache.org/repos/asf/ambari/blob/ba3d6926/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat ---------------------------------------------------------------------- diff --git a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat b/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat deleted file mode 100644 index 6e98a9c..0000000 --- a/ambari-metrics/ambari-metrics-hadoop-timelineservice/src/main/resources/metrics_def/NAMENODE.dat +++ /dev/null @@ -1,205 +0,0 @@ -default.StartupProgress.ElapsedTime -default.StartupProgress.LoadingEditsCount -default.StartupProgress.LoadingEditsElapsedTime -default.StartupProgress.LoadingEditsPercentComplete -default.StartupProgress.LoadingEditsTotal -default.StartupProgress.LoadingFsImageCount -default.StartupProgress.LoadingFsImageElapsedTime -default.StartupProgress.LoadingFsImagePercentComplete -default.StartupProgress.LoadingFsImageTotal -default.StartupProgress.PercentComplete -default.StartupProgress.SafeModeCount -default.StartupProgress.SafeModeElapsedTime -default.StartupProgress.SafeModePercentComplete -default.StartupProgress.SafeModeTotal -default.StartupProgress.SavingCheckpointCount -default.StartupProgress.SavingCheckpointElapsedTime -default.StartupProgress.SavingCheckpointPercentComplete -default.StartupProgress.SavingCheckpointTotal -dfs.FSNamesystem.BlockCapacity -dfs.FSNamesystem.BlocksTotal -dfs.FSNamesystem.CapacityRemaining -dfs.FSNamesystem.CapacityRemainingGB -dfs.FSNamesystem.CapacityTotal -dfs.FSNamesystem.CapacityTotalGB -dfs.FSNamesystem.CapacityUsed -dfs.FSNamesystem.CapacityUsedGB -dfs.FSNamesystem.CapacityUsedNonDFS -dfs.FSNamesystem.CorruptBlocks -dfs.FSNamesystem.ExcessBlocks -dfs.FSNamesystem.ExpiredHeartbeats -dfs.FSNamesystem.FilesTotal -dfs.FSNamesystem.LastCheckpointTime -dfs.FSNamesystem.LastWrittenTransactionId -dfs.FSNamesystem.MillisSinceLastLoadedEdits -dfs.FSNamesystem.MissingBlocks -dfs.FSNamesystem.PendingDataNodeMessageCount -dfs.FSNamesystem.PendingDeletionBlocks -dfs.FSNamesystem.PendingReplicationBlocks -dfs.FSNamesystem.PostponedMisreplicatedBlocks -dfs.FSNamesystem.ScheduledReplicationBlocks -dfs.FSNamesystem.Snapshots -dfs.FSNamesystem.SnapshottableDirectories -dfs.FSNamesystem.StaleDataNodes -dfs.FSNamesystem.TotalFiles -dfs.FSNamesystem.TotalLoad -dfs.FSNamesystem.TransactionsSinceLastCheckpoint -dfs.FSNamesystem.TransactionsSinceLastLogRoll -dfs.FSNamesystem.UnderReplicatedBlocks -dfs.namenode.AddBlockOps -dfs.namenode.AllowSnapshotOps -dfs.namenode.BlockReceivedAndDeletedOps -dfs.namenode.BlockReportAvgTime -dfs.namenode.BlockReportNumOps -dfs.namenode.CacheReportAvgTime -dfs.namenode.CacheReportNumOps -dfs.namenode.CreateFileOps -dfs.namenode.CreateSnapshotOps -dfs.namenode.CreateSymlinkOps -dfs.namenode.DeleteFileOps -dfs.namenode.DeleteSnapshotOps -dfs.namenode.DisallowSnapshotOps -dfs.namenode.FileInfoOps -dfs.namenode.FilesAppended -dfs.namenode.FilesCreated -dfs.namenode.FilesDeleted -dfs.namenode.FilesInGetListingOps -dfs.namenode.FilesRenamed -dfs.namenode.FsImageLoadTime -dfs.namenode.GetAdditionalDatanodeOps -dfs.namenode.GetBlockLocations -dfs.namenode.GetEditAvgTime -dfs.namenode.GetEditNumOps -dfs.namenode.GetImageAvgTime -dfs.namenode.GetImageNumOps -dfs.namenode.GetLinkTargetOps -dfs.namenode.GetListingOps -dfs.namenode.ListSnapshottableDirOps -dfs.namenode.PutImageAvgTime -dfs.namenode.PutImageNumOps -dfs.namenode.RenameSnapshotOps -dfs.namenode.SafeModeTime -dfs.namenode.SnapshotDiffReportOps -dfs.namenode.StorageBlockReportOps -dfs.namenode.SyncsAvgTime -dfs.namenode.SyncsNumOps -dfs.namenode.TransactionsAvgTime -dfs.namenode.TransactionsBatchedInSync -dfs.namenode.TransactionsNumOps -jvm.JvmMetrics.GcCount -jvm.JvmMetrics.GcCountConcurrentMarkSweep -jvm.JvmMetrics.GcCountParNew -jvm.JvmMetrics.GcTimeMillis -jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep -jvm.JvmMetrics.GcTimeMillisParNew -jvm.JvmMetrics.LogError -jvm.JvmMetrics.LogFatal -jvm.JvmMetrics.LogInfo -jvm.JvmMetrics.LogWarn -jvm.JvmMetrics.MemHeapCommittedM -jvm.JvmMetrics.MemHeapMaxM -jvm.JvmMetrics.MemHeapUsedM -jvm.JvmMetrics.MemMaxM -jvm.JvmMetrics.MemNonHeapCommittedM -jvm.JvmMetrics.MemNonHeapMaxM -jvm.JvmMetrics.MemNonHeapUsedM -jvm.JvmMetrics.ThreadsBlocked -jvm.JvmMetrics.ThreadsNew -jvm.JvmMetrics.ThreadsRunnable -jvm.JvmMetrics.ThreadsTerminated -jvm.JvmMetrics.ThreadsTimedWaiting -jvm.JvmMetrics.ThreadsWaiting -metricssystem.MetricsSystem.DroppedPubAll -metricssystem.MetricsSystem.NumActiveSinks -metricssystem.MetricsSystem.NumActiveSources -metricssystem.MetricsSystem.NumAllSinks -metricssystem.MetricsSystem.NumAllSources -metricssystem.MetricsSystem.PublishAvgTime -metricssystem.MetricsSystem.PublishNumOps -metricssystem.MetricsSystem.Sink_timelineAvgTime -metricssystem.MetricsSystem.Sink_timelineDropped -metricssystem.MetricsSystem.Sink_timelineNumOps -metricssystem.MetricsSystem.Sink_timelineQsize -metricssystem.MetricsSystem.SnapshotAvgTime -metricssystem.MetricsSystem.SnapshotNumOps -rpc.RetryCache.NameNodeRetryCache.CacheCleared -rpc.RetryCache.NameNodeRetryCache.CacheHit -rpc.RetryCache.NameNodeRetryCache.CacheUpdated -rpc.rpc.CallQueueLength -rpc.rpc.NumOpenConnections -rpc.rpc.ReceivedBytes -rpc.rpc.RpcAuthenticationFailures -rpc.rpc.RpcAuthenticationSuccesses -rpc.rpc.RpcAuthorizationFailures -rpc.rpc.RpcAuthorizationSuccesses -rpc.rpc.RpcProcessingTimeAvgTime -rpc.rpc.RpcProcessingTimeNumOps -rpc.rpc.RpcQueueTimeAvgTime -rpc.rpc.RpcQueueTimeNumOps -rpc.rpc.SentBytes -rpcdetailed.rpcdetailed.AbandonBlockAvgTime -rpcdetailed.rpcdetailed.AbandonBlockNumOps -rpcdetailed.rpcdetailed.AddBlockAvgTime -rpcdetailed.rpcdetailed.AddBlockNumOps -rpcdetailed.rpcdetailed.BlockReceivedAndDeletedAvgTime -rpcdetailed.rpcdetailed.BlockReceivedAndDeletedNumOps -rpcdetailed.rpcdetailed.BlockReportAvgTime -rpcdetailed.rpcdetailed.BlockReportNumOps -rpcdetailed.rpcdetailed.CommitBlockSynchronizationAvgTime -rpcdetailed.rpcdetailed.CommitBlockSynchronizationNumOps -rpcdetailed.rpcdetailed.CompleteAvgTime -rpcdetailed.rpcdetailed.CompleteNumOps -rpcdetailed.rpcdetailed.CreateAvgTime -rpcdetailed.rpcdetailed.CreateNumOps -rpcdetailed.rpcdetailed.DeleteAvgTime -rpcdetailed.rpcdetailed.DeleteNumOps -rpcdetailed.rpcdetailed.FsyncAvgTime -rpcdetailed.rpcdetailed.FsyncNumOps -rpcdetailed.rpcdetailed.GetAdditionalDatanodeAvgTime -rpcdetailed.rpcdetailed.GetAdditionalDatanodeNumOps -rpcdetailed.rpcdetailed.GetBlockLocationsAvgTime -rpcdetailed.rpcdetailed.GetBlockLocationsNumOps -rpcdetailed.rpcdetailed.GetEditLogManifestAvgTime -rpcdetailed.rpcdetailed.GetEditLogManifestNumOps -rpcdetailed.rpcdetailed.GetFileInfoAvgTime -rpcdetailed.rpcdetailed.GetFileInfoNumOps -rpcdetailed.rpcdetailed.GetListingAvgTime -rpcdetailed.rpcdetailed.GetListingNumOps -rpcdetailed.rpcdetailed.GetServerDefaultsAvgTime -rpcdetailed.rpcdetailed.GetServerDefaultsNumOps -rpcdetailed.rpcdetailed.GetTransactionIdAvgTime -rpcdetailed.rpcdetailed.GetTransactionIdNumOps -rpcdetailed.rpcdetailed.IsFileClosedAvgTime -rpcdetailed.rpcdetailed.IsFileClosedNumOps -rpcdetailed.rpcdetailed.MkdirsAvgTime -rpcdetailed.rpcdetailed.MkdirsNumOps -rpcdetailed.rpcdetailed.RecoverLeaseAvgTime -rpcdetailed.rpcdetailed.RecoverLeaseNumOps -rpcdetailed.rpcdetailed.RegisterDatanodeAvgTime -rpcdetailed.rpcdetailed.RegisterDatanodeNumOps -rpcdetailed.rpcdetailed.RenameAvgTime -rpcdetailed.rpcdetailed.RenameNumOps -rpcdetailed.rpcdetailed.RenewLeaseAvgTime -rpcdetailed.rpcdetailed.RenewLeaseNumOps -rpcdetailed.rpcdetailed.ReportBadBlocksAvgTime -rpcdetailed.rpcdetailed.ReportBadBlocksNumOps -rpcdetailed.rpcdetailed.RollEditLogAvgTime -rpcdetailed.rpcdetailed.RollEditLogNumOps -rpcdetailed.rpcdetailed.SendHeartbeatAvgTime -rpcdetailed.rpcdetailed.SendHeartbeatNumOps -rpcdetailed.rpcdetailed.SetSafeModeAvgTime -rpcdetailed.rpcdetailed.SetSafeModeNumOps -rpcdetailed.rpcdetailed.SetTimesAvgTime -rpcdetailed.rpcdetailed.SetTimesNumOps -rpcdetailed.rpcdetailed.UpdateBlockForPipelineAvgTime -rpcdetailed.rpcdetailed.UpdateBlockForPipelineNumOps -rpcdetailed.rpcdetailed.UpdatePipelineAvgTime -rpcdetailed.rpcdetailed.UpdatePipelineNumOps -rpcdetailed.rpcdetailed.VersionRequestAvgTime -rpcdetailed.rpcdetailed.VersionRequestNumOps -ugi.UgiMetrics.GetGroupsAvgTime -ugi.UgiMetrics.GetGroupsNumOps -ugi.UgiMetrics.LoginFailureAvgTime -ugi.UgiMetrics.LoginFailureNumOps -ugi.UgiMetrics.LoginSuccessAvgTime -ugi.UgiMetrics.LoginSuccessNumOps