From fba7532c563179fb3b6304be0319728b5227324d Mon Sep 17 00:00:00 2001 From: Sangjin Lee Date: Tue, 12 Apr 2016 12:32:43 -0700 Subject: [PATCH] Addendum to YARN-3863. Deleted files that were added incorrectly. --- .../reader/filter/TimelineExistsFilter.java | 62 ---------------- .../reader/filter/TimelineKeyValueFilter.java | 48 ------------- .../filter/TimelineKeyValuesFilter.java | 71 ------------------- .../common/TimelineEntityFiltersType.java | 71 ------------------- 4 files changed, 252 deletions(-) delete mode 100644 hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineExistsFilter.java delete mode 100644 hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValueFilter.java delete mode 100644 hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValuesFilter.java delete mode 100644 hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/TimelineEntityFiltersType.java diff --git a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineExistsFilter.java b/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineExistsFilter.java deleted file mode 100644 index 36d0d7b4a0b..00000000000 --- a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineExistsFilter.java +++ /dev/null @@ -1,62 +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.timelineservice.reader.filter; - -import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.classification.InterfaceStability.Unstable; - -/** - * Filter class which represents filter to be applied based on existence of a - * value. - */ -@Private -@Unstable -public class TimelineExistsFilter extends TimelineFilter { - - private final TimelineCompareOp compareOp; - private final String value; - - public TimelineExistsFilter(TimelineCompareOp op, String value) { - this.value = value; - if (op != TimelineCompareOp.EQUAL && op != TimelineCompareOp.NOT_EQUAL) { - throw new IllegalArgumentException("CompareOp for exists filter should " + - "be EQUAL or NOT_EQUAL"); - } - this.compareOp = op; - } - - @Override - public TimelineFilterType getFilterType() { - return TimelineFilterType.EXISTS; - } - - public String getValue() { - return value; - } - - public TimelineCompareOp getCompareOp() { - return compareOp; - } - - @Override - public String toString() { - return String.format("%s (%s %s)", - this.getClass().getSimpleName(), this.compareOp.name(), this.value); - } -} diff --git a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValueFilter.java b/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValueFilter.java deleted file mode 100644 index 58f0ee95f94..00000000000 --- a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValueFilter.java +++ /dev/null @@ -1,48 +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.timelineservice.reader.filter; - -import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.classification.InterfaceStability.Unstable; - -/** - * Filter class which represents filter to be applied based on key-value pair - * being equal or not to the values in back-end store. - */ -@Private -@Unstable -public class TimelineKeyValueFilter extends TimelineCompareFilter { - public TimelineKeyValueFilter(TimelineCompareOp op, String key, Object val, - boolean keyMustExistFlag) { - super(op, key, val, keyMustExistFlag); - if (op != TimelineCompareOp.EQUAL && op != TimelineCompareOp.NOT_EQUAL) { - throw new IllegalArgumentException("TimelineCompareOp for equality" - + " filter should be EQUAL or NOT_EQUAL"); - } - } - - public TimelineKeyValueFilter(TimelineCompareOp op, String key, Object val) { - this(op, key, val, true); - } - - @Override - public TimelineFilterType getFilterType() { - return TimelineFilterType.KEY_VALUE; - } -} diff --git a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValuesFilter.java b/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValuesFilter.java deleted file mode 100644 index 0d34d47e5bd..00000000000 --- a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValuesFilter.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.timelineservice.reader.filter; - -import java.util.Set; - -import org.apache.hadoop.classification.InterfaceAudience.Private; -import org.apache.hadoop.classification.InterfaceStability.Unstable; - -/** - * Filter class which represents filter to be applied based on multiple values - * for a key and these values being equal or not equal to values in back-end - * store. - */ -@Private -@Unstable -public class TimelineKeyValuesFilter extends TimelineFilter { - private final TimelineCompareOp compareOp; - private final String key; - private final Set values; - public TimelineKeyValuesFilter(TimelineCompareOp op, String key, - Set values) { - if (op != TimelineCompareOp.EQUAL && op != TimelineCompareOp.NOT_EQUAL) { - throw new IllegalArgumentException("TimelineCompareOp for multi value " - + "equality filter should be EQUAL or NOT_EQUAL"); - } - this.compareOp = op; - this.key = key; - this.values = values; - } - - @Override - public TimelineFilterType getFilterType() { - return TimelineFilterType.KEY_VALUES; - } - - public String getKey() { - return key; - } - - public Set getValues() { - return values; - } - - public TimelineCompareOp getCompareOp() { - return compareOp; - } - - @Override - public String toString() { - return String.format("%s (%s, %s:%s)", - this.getClass().getSimpleName(), this.compareOp.name(), - this.key, (values == null) ? "" : values.toString()); - } -} diff --git a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/TimelineEntityFiltersType.java b/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/TimelineEntityFiltersType.java deleted file mode 100644 index 4099e92da1a..00000000000 --- a/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/TimelineEntityFiltersType.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.timelineservice.storage.common; - -import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilter.TimelineFilterType; - -/** - * Used to define which filter to match. - */ -enum TimelineEntityFiltersType { - CONFIG { - boolean isValidFilter(TimelineFilterType filterType) { - return filterType == TimelineFilterType.LIST || - filterType == TimelineFilterType.KEY_VALUE; - } - }, - INFO { - boolean isValidFilter(TimelineFilterType filterType) { - return filterType == TimelineFilterType.LIST || - filterType == TimelineFilterType.KEY_VALUE; - } - }, - METRIC { - boolean isValidFilter(TimelineFilterType filterType) { - return filterType == TimelineFilterType.LIST || - filterType == TimelineFilterType.COMPARE; - } - }, - EVENT { - boolean isValidFilter(TimelineFilterType filterType) { - return filterType == TimelineFilterType.LIST || - filterType == TimelineFilterType.EXISTS; - } - }, - IS_RELATED_TO { - boolean isValidFilter(TimelineFilterType filterType) { - return filterType == TimelineFilterType.LIST || - filterType == TimelineFilterType.KEY_VALUES; - } - }, - RELATES_TO { - boolean isValidFilter(TimelineFilterType filterType) { - return filterType == TimelineFilterType.LIST || - filterType == TimelineFilterType.KEY_VALUES; - } - }; - - /** - * Checks whether filter type is valid for the filter being matched. - * - * @param filterType filter type. - * @return true, if its a valid filter, false otherwise. - */ - abstract boolean isValidFilter(TimelineFilterType filterType); -} \ No newline at end of file