Repository: oozie Updated Branches: refs/heads/master 311fda181 -> 4f3afcaca
OOZIE-2852 Remove simple-json dependency from oozie sharelib (Artem Ervits via gezapeti) Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/4f3afcac Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/4f3afcac Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/4f3afcac Branch: refs/heads/master Commit: 4f3afcacad072792feb02d59fe1f440f1487bf00 Parents: 311fda1 Author: Gezapeti Cseh <gezap...@gmail.com> Authored: Wed Aug 2 14:27:02 2017 +0200 Committer: Gezapeti Cseh <gezap...@gmail.com> Committed: Wed Aug 2 14:44:38 2017 +0200 ---------------------------------------------------------------------- .../apache/oozie/action/hadoop/ActionStats.java | 39 +++++++++++++ .../apache/oozie/action/hadoop/ActionType.java | 27 +++++++++ .../org/apache/oozie/action/hadoop/MRStats.java | 58 ++++++++++++++++++++ pom.xml | 2 +- release-log.txt | 1 + sharelib/oozie/pom.xml | 5 -- .../apache/oozie/action/hadoop/ActionStats.java | 39 ------------- .../apache/oozie/action/hadoop/ActionType.java | 27 --------- .../org/apache/oozie/action/hadoop/MRStats.java | 58 -------------------- 9 files changed, 126 insertions(+), 130 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/core/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java b/core/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java new file mode 100644 index 0000000..d5c36aa --- /dev/null +++ b/core/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java @@ -0,0 +1,39 @@ +/** + * 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.oozie.action.hadoop; + +/** + * Abstract class that represents the statistics for any type of Oozie action. + */ +public abstract class ActionStats { + protected ActionType currentActionType; + + /** + * Return the statistics in JSON format. Sub-classes must override this + * method to provide statistics for their particular action type. + * + * @return a JSON string with the statistics information. + */ + public abstract String toJSON(); + + public ActionType getCurrentActionType() { + return currentActionType; + } +} http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/core/src/main/java/org/apache/oozie/action/hadoop/ActionType.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/ActionType.java b/core/src/main/java/org/apache/oozie/action/hadoop/ActionType.java new file mode 100644 index 0000000..aae0a0c --- /dev/null +++ b/core/src/main/java/org/apache/oozie/action/hadoop/ActionType.java @@ -0,0 +1,27 @@ +/** + * 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.oozie.action.hadoop; + +/** + * Enumerator that lists the various kinds of actions supported by Oozie. + */ +public enum ActionType { + MAP_REDUCE, PIG, HIVE +} http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/core/src/main/java/org/apache/oozie/action/hadoop/MRStats.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/oozie/action/hadoop/MRStats.java b/core/src/main/java/org/apache/oozie/action/hadoop/MRStats.java new file mode 100644 index 0000000..6adc178 --- /dev/null +++ b/core/src/main/java/org/apache/oozie/action/hadoop/MRStats.java @@ -0,0 +1,58 @@ +/** + * 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.oozie.action.hadoop; + +import org.apache.hadoop.mapred.Counters; +import org.apache.hadoop.mapred.Counters.Counter; +import org.json.simple.JSONObject; + +/** + * Class to collect statistics for Map-Reduce action. + */ +public class MRStats extends ActionStats { + public static final String ACTION_TYPE_LABEL = "ACTION_TYPE"; + private Counters counters = null; + + public MRStats(Counters groups) { + this.currentActionType = ActionType.MAP_REDUCE; + this.counters = groups; + } + + @SuppressWarnings("unchecked") + @Override + public String toJSON() { + if (counters == null) { + return null; + } + + JSONObject groups = new JSONObject(); + groups.put(ACTION_TYPE_LABEL, getCurrentActionType().toString()); + for (String gName : counters.getGroupNames()) { + JSONObject group = new JSONObject(); + for (Counter counter : counters.getGroup(gName)) { + String cName = counter.getName(); + Long cValue = counter.getValue(); + group.put(cName, cValue); + } + groups.put(gName, group); + } + return groups.toJSONString(); + } +} http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 8df5ad4..4978d21 100644 --- a/pom.xml +++ b/pom.xml @@ -264,7 +264,7 @@ <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> - <version>1.1</version> + <version>1.1.1</version> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 52d2dab..4023346 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 5.0.0 release (trunk - unreleased) +OOZIE-2852 Remove simple-json dependency from oozie sharelib (Artem Ervits via gezapeti) OOZIE-3021 Error on job or SLA event listening: WARN logs instead of DEBUG (andras.piros via asasvari) OOZIE-2931 Fix warnings during build for "no @param for" (Artem Ervits via gezapeti) OOZIE-2974 Change TestLiteWorkflowAppParser so that it works with Hadoop 3 (asasvari via gezapeti) http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/sharelib/oozie/pom.xml ---------------------------------------------------------------------- diff --git a/sharelib/oozie/pom.xml b/sharelib/oozie/pom.xml index 6c54903..c74c06d 100644 --- a/sharelib/oozie/pom.xml +++ b/sharelib/oozie/pom.xml @@ -38,11 +38,6 @@ </properties> <dependencies> - <dependency> - <groupId>com.googlecode.json-simple</groupId> - <artifactId>json-simple</artifactId> - <scope>compile</scope> - </dependency> <dependency> <groupId>org.apache.hadoop</groupId> http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java ---------------------------------------------------------------------- diff --git a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java deleted file mode 100644 index d5c36aa..0000000 --- a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionStats.java +++ /dev/null @@ -1,39 +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.oozie.action.hadoop; - -/** - * Abstract class that represents the statistics for any type of Oozie action. - */ -public abstract class ActionStats { - protected ActionType currentActionType; - - /** - * Return the statistics in JSON format. Sub-classes must override this - * method to provide statistics for their particular action type. - * - * @return a JSON string with the statistics information. - */ - public abstract String toJSON(); - - public ActionType getCurrentActionType() { - return currentActionType; - } -} http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionType.java ---------------------------------------------------------------------- diff --git a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionType.java b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionType.java deleted file mode 100644 index aae0a0c..0000000 --- a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ActionType.java +++ /dev/null @@ -1,27 +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.oozie.action.hadoop; - -/** - * Enumerator that lists the various kinds of actions supported by Oozie. - */ -public enum ActionType { - MAP_REDUCE, PIG, HIVE -} http://git-wip-us.apache.org/repos/asf/oozie/blob/4f3afcac/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/MRStats.java ---------------------------------------------------------------------- diff --git a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/MRStats.java b/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/MRStats.java deleted file mode 100644 index 6adc178..0000000 --- a/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/MRStats.java +++ /dev/null @@ -1,58 +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.oozie.action.hadoop; - -import org.apache.hadoop.mapred.Counters; -import org.apache.hadoop.mapred.Counters.Counter; -import org.json.simple.JSONObject; - -/** - * Class to collect statistics for Map-Reduce action. - */ -public class MRStats extends ActionStats { - public static final String ACTION_TYPE_LABEL = "ACTION_TYPE"; - private Counters counters = null; - - public MRStats(Counters groups) { - this.currentActionType = ActionType.MAP_REDUCE; - this.counters = groups; - } - - @SuppressWarnings("unchecked") - @Override - public String toJSON() { - if (counters == null) { - return null; - } - - JSONObject groups = new JSONObject(); - groups.put(ACTION_TYPE_LABEL, getCurrentActionType().toString()); - for (String gName : counters.getGroupNames()) { - JSONObject group = new JSONObject(); - for (Counter counter : counters.getGroup(gName)) { - String cName = counter.getName(); - Long cValue = counter.getValue(); - group.put(cName, cValue); - } - groups.put(gName, group); - } - return groups.toJSONString(); - } -}