You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2017/05/31 14:37:15 UTC
[01/17] ambari git commit: AMBARI-21121: Missing storm-site.xml in
HDP-2.6 stack (Sriharsha Chintalapani via jluniya)
Repository: ambari
Updated Branches:
refs/heads/branch-feature-AMBARI-12556 2892aee53 -> 138aa48f5
AMBARI-21121: Missing storm-site.xml in HDP-2.6 stack (Sriharsha Chintalapani via jluniya)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1e3d64bf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1e3d64bf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1e3d64bf
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 1e3d64bfeaa59ac471c013cac1a96b1df14921f0
Parents: 14acc0a
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Thu May 25 10:00:14 2017 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Thu May 25 10:00:14 2017 -0700
----------------------------------------------------------------------
.../services/STORM/configuration/storm-site.xml | 61 ++++++++++++++++++++
1 file changed, 61 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1e3d64bf/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/storm-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/storm-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/storm-site.xml
new file mode 100644
index 0000000..902fdc9
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/storm-site.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!--
+ censed 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.
+ */
+-->
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+ <property>
+ <name>java.library.path</name>
+ <value>/usr/local/lib:/opt/local/lib:/usr/lib:/usr/hdp/current/storm-client/lib</value>
+ <description>This value is passed to spawned JVMs (e.g., Nimbus, Supervisor, and Workers)
+ for the java.library.path value. java.library.path tells the JVM where
+ to look for native libraries. It is necessary to set this config correctly since
+ Storm uses the ZeroMQ and JZMQ native libs. </description>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>nimbus.childopts</name>
+ <value>-Xmx1024m _JAAS_PLACEHOLDER -javaagent:/usr/hdp/current/storm-nimbus/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=localhost,port=8649,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-nimbus/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Nimbus_JVM</value>
+ <description>This parameter is used by the storm-deploy project to configure the jvm options for the nimbus daemon.</description>
+ <value-attributes>
+ <overridable>false</overridable>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>worker.childopts</name>
+ <value>-Xmx768m _JAAS_PLACEHOLDER -javaagent:/usr/hdp/current/storm-client/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=localhost,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-client/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM</value>
+ <description>The jvm opts provided to workers launched by this supervisor. All \"%ID%\" substrings are replaced with an identifier for this worker.</description>
+ <value-attributes>
+ <type>multiLine</type>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>supervisor.childopts</name>
+ <value>-Xmx256m _JAAS_PLACEHOLDER -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port={{jmxremote_port}} -javaagent:/usr/hdp/current/storm-supervisor/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=localhost,port=8650,wireformat31x=true,mode=multicast,config=/usr/hdp/current/storm-supervisor/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Supervisor_JVM</value>
+ <description>This parameter is used by the storm-deploy project to configure the jvm options for the supervisor daemon.</description>
+ <value-attributes>
+ <overridable>false</overridable>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+ <name>metrics.reporter.register</name>
+ <on-ambari-upgrade delete="true"/>
+ </property>
+</configuration>
[14/17] ambari git commit: AMBARI-21144 ADDENDUM - Create .md files
to describe Log Search input configurations (oleewere)
Posted by jo...@apache.org.
AMBARI-21144 ADDENDUM - Create .md files to describe Log Search input configurations (oleewere)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4f36e145
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4f36e145
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4f36e145
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 4f36e1454dd37396782ef6497629192c603d5baf
Parents: f0d970b
Author: oleewere <ol...@gmail.com>
Authored: Wed May 31 11:29:08 2017 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Wed May 31 11:29:08 2017 +0200
----------------------------------------------------------------------
.../ambari-logsearch-logfeeder/README.md | 15 ++++++++-------
.../ambari-logsearch-logfeeder/docs/filter.md | 6 +++---
.../ambari-logsearch-logfeeder/docs/input.md | 6 +++---
.../ambari-logsearch-logfeeder/docs/inputConfig.md | 2 +-
.../ambari-logsearch-logfeeder/docs/postMapValues.md | 10 +++++-----
5 files changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f36e145/ambari-logsearch/ambari-logsearch-logfeeder/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/README.md b/ambari-logsearch/ambari-logsearch-logfeeder/README.md
index c5c6848..5a64daf 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/README.md
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/README.md
@@ -17,26 +17,27 @@ limitations under the License.
{% endcomment %}
-->
-#Log Search - Log Feeder:
+# Log Search - Log Feeder:
Log Feeder is a component of the Log Search service that reads logs, parses them and stores them in Apache Solr for the purpose
of later analysis.
-#Compilation
+# Compilation
+```bash
mvn clean compile package
-
-#Deploy
-##Copy to remote
+```
+# Deploy
+## Copy to remote
copy target/logsearch-logfeeder.tgz to host machine
-##Setup environment
+## Setup environment
```bash
mkdir /opt/logfeeder
cd /opt/logfeeder
tar xfz ~/logsearch-logfeeder.tar.gz
```
-#Input Configuration
+# Input Configuration
The configuration for the log feeder contains
* description of the log files
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f36e145/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
index 42c3271..129279b 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
@@ -17,7 +17,7 @@ limitations under the License.
{% endcomment %}
-->
-#Filter
+# Filter
The filter element in the [input configuration](inputConfig.md) contains a list of filter descriptions, each describing one filter
applied on an input.
@@ -35,7 +35,7 @@ The general elements in the json are the following:
| is\_enabled | A flag to show if the filter should be used | true |
-##Grok Filter
+## Grok Filter
Grok filters have the following additional parameters:
@@ -46,7 +46,7 @@ Grok filters have the following additional parameters:
| message\_pattern | The grok pattern to use to parse the log entry | - |
-##Key-value Filter
+## Key-value Filter
Key-value filters have the following additional parameters:
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f36e145/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
index e95401a..661eeb8 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
@@ -17,7 +17,7 @@ limitations under the License.
{% endcomment %}
-->
-#Input
+# Input
The input element in the [input configuration](inputConfig.md) contains a list of input descriptions, each describing one source
of input.
@@ -42,7 +42,7 @@ The general elements in the json are the following:
| is\_enabled | A flag to show if the input should be used | true |
-##File Input
+## File Input
File inputs have the following parameters too:
@@ -53,7 +53,7 @@ File inputs have the following parameters too:
| copy\_file | Should the file be copied \(only if not processed\) | false |
-##S3 File Input
+## S3 File Input
S3 file inputs have the following parameters in addition to the general file parameters:
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f36e145/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
index ae7ac05..a507bfd 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
@@ -17,7 +17,7 @@ limitations under the License.
{% endcomment %}
-->
-#Input Configuration
+# Input Configuration
The input configurations are stored in json files. Each of them are describing the processing of the log files of a service.
http://git-wip-us.apache.org/repos/asf/ambari/blob/4f36e145/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
index aa381cd..906359a 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
@@ -17,14 +17,14 @@ limitations under the License.
{% endcomment %}
-->
-#Post Map Values
+# Post Map Values
The Post Map Values element in the [filter](filter.md) field names as keys, the values are lists of sets of post map values, each
describing one mapping done on a field named before obtained after filtering.
Currently there are four kind of mappings are supported:
-##Map Date
+## Map Date
The name of the mapping element should be map\_date. The value json element may contain the following parameters:
@@ -34,7 +34,7 @@ The name of the mapping element should be map\_date. The value json element may
| target\_date\_pattern | If 'epoch' then the field is parsed as seconds from 1970, otherwise the content used as pattern |
-##Map Copy
+## Map Copy
The name of the mapping element should be map\_copy. The value json element should contain the following parameter:
@@ -43,7 +43,7 @@ The name of the mapping element should be map\_copy. The value json element shou
| copy\_name | The name of the copied field |
-##Map Field Name
+## Map Field Name
The name of the mapping element should be map\_fieldname. The value json element should contain the following parameter:
@@ -51,7 +51,7 @@ The name of the mapping element should be map\_fieldname. The value json element
|------------------|-------------------------------|
| new\_field\_name | The name of the renamed field |
-##Map Field Value
+## Map Field Value
The name of the mapping element should be map\_fieldvalue. The value json element should contain the following parameter:
[10/17] ambari git commit: AMBARI-21119 Log Search REST API validate
input configurations and log level filters (mgergely)
Posted by jo...@apache.org.
AMBARI-21119 Log Search REST API validate input configurations and log level filters (mgergely)
Change-Id: I9e09a73c60ad76fd51218742d1ebf18f42afbc62
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/93130e6b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/93130e6b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/93130e6b
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 93130e6bf83dc656ecb486a8f5fbabcb97a694f1
Parents: 9f5f765
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Mon May 29 12:06:25 2017 +0200
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Mon May 29 12:07:01 2017 +0200
----------------------------------------------------------------------
.../impl/MapFieldNameDescriptorImpl.java | 4 +-
.../logsearch/manager/ShipperConfigManager.java | 10 +--
.../model/common/LSServerConditions.java | 7 ++
.../logsearch/model/common/LSServerFields.java | 6 ++
.../logsearch/model/common/LSServerFilter.java | 26 ++++---
.../common/LSServerFilterDeserializer.java | 60 +++++++++++++++
.../model/common/LSServerFilterGrok.java | 6 ++
.../model/common/LSServerFilterJson.java | 2 +
.../model/common/LSServerFilterKeyValue.java | 2 +
.../logsearch/model/common/LSServerInput.java | 37 +++++----
.../model/common/LSServerInputConfig.java | 13 ++++
.../model/common/LSServerInputDeserializer.java | 62 +++++++++++++++
.../model/common/LSServerInputFile.java | 2 +
.../model/common/LSServerInputFileBase.java | 2 +
.../model/common/LSServerInputS3File.java | 6 ++
.../model/common/LSServerLogLevelFilter.java | 24 ++++--
.../model/common/LSServerLogLevelFilterMap.java | 5 ++
.../logsearch/model/common/LSServerMapDate.java | 5 ++
.../model/common/LSServerMapFieldCopy.java | 5 ++
.../model/common/LSServerMapFieldName.java | 5 ++
.../model/common/LSServerMapFieldValue.java | 6 ++
.../model/common/LSServerPostMapValues.java | 34 ++++++---
.../model/common/LSServerPostMapValuesList.java | 59 +++++++++++++++
.../LSServerPostMapValuesListDeserializer.java | 79 ++++++++++++++++++++
.../LSServerPostMapValuesListSerializer.java | 44 +++++++++++
.../common/LSServerPostMapValuesSerializer.java | 39 ----------
.../logsearch/rest/ShipperConfigResource.java | 19 +++--
27 files changed, 474 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapFieldNameDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapFieldNameDescriptorImpl.java b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapFieldNameDescriptorImpl.java
index 333cb67..e5676b0 100644
--- a/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapFieldNameDescriptorImpl.java
+++ b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapFieldNameDescriptorImpl.java
@@ -27,11 +27,11 @@ import com.google.gson.annotations.SerializedName;
public class MapFieldNameDescriptorImpl implements MapFieldNameDescriptor {
@Override
public String getJsonName() {
- return "map_fieldname";
+ return "map_field_name";
}
@Expose
- @SerializedName("new_fieldname")
+ @SerializedName("new_field_name")
private String newFieldName;
@Override
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ShipperConfigManager.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ShipperConfigManager.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ShipperConfigManager.java
index 44d91a9..a0db92f 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ShipperConfigManager.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ShipperConfigManager.java
@@ -27,6 +27,7 @@ import org.apache.ambari.logsearch.model.common.LSServerInputConfig;
import org.apache.ambari.logsearch.model.common.LSServerLogLevelFilterMap;
import org.apache.log4j.Logger;
+import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import javax.annotation.PostConstruct;
@@ -57,8 +58,7 @@ public class ShipperConfigManager extends JsonManagerBase {
return new LSServerInputConfig(inputConfig);
}
- public Response createInputConfig(String clusterName, String serviceName, String inputConfig) {
-
+ public Response createInputConfig(String clusterName, String serviceName, LSServerInputConfig inputConfig) {
try {
if (LogSearchConfigConfigurer.getConfig().inputConfigExists(clusterName, serviceName)) {
return Response.serverError()
@@ -67,7 +67,7 @@ public class ShipperConfigManager extends JsonManagerBase {
.build();
}
- LogSearchConfigConfigurer.getConfig().createInputConfig(clusterName, serviceName, inputConfig);
+ LogSearchConfigConfigurer.getConfig().createInputConfig(clusterName, serviceName, new ObjectMapper().writeValueAsString(inputConfig));
return Response.ok().build();
} catch (Exception e) {
logger.warn("Could not create input config", e);
@@ -75,7 +75,7 @@ public class ShipperConfigManager extends JsonManagerBase {
}
}
- public Response setInputConfig(String clusterName, String serviceName, String inputConfig) {
+ public Response setInputConfig(String clusterName, String serviceName, LSServerInputConfig inputConfig) {
try {
if (!LogSearchConfigConfigurer.getConfig().inputConfigExists(clusterName, serviceName)) {
return Response.serverError()
@@ -84,7 +84,7 @@ public class ShipperConfigManager extends JsonManagerBase {
.build();
}
- LogSearchConfigConfigurer.getConfig().setInputConfig(clusterName, serviceName, inputConfig);
+ LogSearchConfigConfigurer.getConfig().setInputConfig(clusterName, serviceName, new ObjectMapper().writeValueAsString(inputConfig));
return Response.ok().build();
} catch (Exception e) {
logger.warn("Could not update input config", e);
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerConditions.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerConditions.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerConditions.java
index 9cd9710..11c4f70 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerConditions.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerConditions.java
@@ -19,14 +19,21 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.Conditions;
import io.swagger.annotations.ApiModel;
@ApiModel
public class LSServerConditions {
+ @Valid
+ @NotNull
private LSServerFields fields;
+ public LSServerConditions() {}
+
public LSServerConditions(Conditions conditions) {
this.fields = new LSServerFields(conditions.getFields());
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFields.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFields.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFields.java
index 5f570da..dcaadb6 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFields.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFields.java
@@ -21,14 +21,20 @@ package org.apache.ambari.logsearch.model.common;
import java.util.Set;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.Fields;
import io.swagger.annotations.ApiModel;
@ApiModel
public class LSServerFields {
+ @NotNull
private Set<String> type;
+ public LSServerFields() {
+ }
+
public LSServerFields(Fields fields) {
this.type = fields.getType();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
index 0190c01..d99a77d 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
@@ -19,11 +19,13 @@
package org.apache.ambari.logsearch.model.common;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.FilterDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.PostMapValues;
@@ -36,8 +38,11 @@ import io.swagger.annotations.ApiModel;
@ApiModel
@JsonInclude(Include.NON_NULL)
public abstract class LSServerFilter {
+ @NotNull
private String filter;
+ @Valid
+ @NotNull
private LSServerConditions conditions;
@JsonProperty("sort_order")
@@ -48,10 +53,14 @@ public abstract class LSServerFilter {
@JsonProperty("remove_source_field")
private Boolean removeSourceField;
- private Map<String, List<LSServerPostMapValues>> postMapValues;
+ @Valid
+ @JsonProperty("post_map_values")
+ private Map<String, LSServerPostMapValuesList> postMapValues;
@JsonProperty("is_enabled")
private Boolean isEnabled;
+
+ public LSServerFilter() {}
public LSServerFilter(FilterDescriptor filterDescriptor) {
this.filter = filterDescriptor.getFilter();
@@ -60,13 +69,10 @@ public abstract class LSServerFilter {
this.sourceField = filterDescriptor.getSourceField();
this.removeSourceField = filterDescriptor.isRemoveSourceField();
- postMapValues = new HashMap<String, List<LSServerPostMapValues>>();
+ this.postMapValues = new HashMap<String, LSServerPostMapValuesList>();
for (Map.Entry<String, ? extends List<? extends PostMapValues>> e : filterDescriptor.getPostMapValues().entrySet()) {
- List<LSServerPostMapValues> lsServerPostMapValues = new ArrayList<>();
- for (PostMapValues pmv : e.getValue()) {
- lsServerPostMapValues.add(new LSServerPostMapValues(pmv));
- }
- postMapValues.put(e.getKey(), lsServerPostMapValues);
+ LSServerPostMapValuesList lsServerPostMapValuesList = new LSServerPostMapValuesList(e.getValue());
+ postMapValues.put(e.getKey(), lsServerPostMapValuesList);
}
this.isEnabled = filterDescriptor.isEnabled();
@@ -112,11 +118,11 @@ public abstract class LSServerFilter {
this.removeSourceField = removeSourceField;
}
- public Map<String, List<LSServerPostMapValues>> getPostMapValues() {
+ public Map<String, LSServerPostMapValuesList> getPostMapValues() {
return postMapValues;
}
- public void setPostMapValues(Map<String, List<LSServerPostMapValues>> postMapValues) {
+ public void setPostMapValues(Map<String, LSServerPostMapValuesList> postMapValues) {
this.postMapValues = postMapValues;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterDeserializer.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterDeserializer.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterDeserializer.java
new file mode 100644
index 0000000..df3998f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterDeserializer.java
@@ -0,0 +1,60 @@
+/*
+ * 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.ambari.logsearch.model.common;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.core.TreeNode;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class LSServerFilterDeserializer extends JsonDeserializer<List<LSServerFilter>> {
+ @Override
+ public List<LSServerFilter> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ ObjectCodec oc = jp.getCodec();
+ JsonNode node = oc.readTree(jp);
+
+ List<LSServerFilter> filters = new ArrayList<>();
+ for (JsonNode filterNode : node) {
+ if (filterNode.get("filter") == null) {
+ throw new IllegalArgumentException("Each filter element must have a field called 'filter' declaring it's type");
+ }
+ switch (filterNode.get("filter").asText()) {
+ case "grok" :
+ filters.add(oc.treeToValue((TreeNode)filterNode, LSServerFilterGrok.class));
+ break;
+ case "keyvalue" :
+ filters.add(oc.treeToValue((TreeNode)filterNode, LSServerFilterKeyValue.class));
+ break;
+ case "json" :
+ filters.add(oc.treeToValue((TreeNode)filterNode, LSServerFilterJson.class));
+ break;
+ }
+ }
+
+ return filters;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterGrok.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterGrok.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterGrok.java
index a8c4a7a..6de9f4c 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterGrok.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterGrok.java
@@ -19,6 +19,8 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.FilterDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.FilterGrokDescriptor;
@@ -31,12 +33,16 @@ public class LSServerFilterGrok extends LSServerFilter {
@JsonProperty("log4j_format")
private String log4jFormat;
+ @NotNull
@JsonProperty("multiline_pattern")
private String multilinePattern;
+ @NotNull
@JsonProperty("message_pattern")
private String messagePattern;
+ public LSServerFilterGrok() {}
+
public LSServerFilterGrok(FilterDescriptor filterDescriptor) {
super(filterDescriptor);
if (filterDescriptor instanceof FilterGrokDescriptor) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterJson.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterJson.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterJson.java
index 3c0ed17..d20f842 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterJson.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterJson.java
@@ -25,6 +25,8 @@ import io.swagger.annotations.ApiModel;
@ApiModel
public class LSServerFilterJson extends LSServerFilter {
+ public LSServerFilterJson() {}
+
public LSServerFilterJson(FilterDescriptor filterDescriptor) {
super(filterDescriptor);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterKeyValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterKeyValue.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterKeyValue.java
index dcee25d..a879bb8 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterKeyValue.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilterKeyValue.java
@@ -37,6 +37,8 @@ public class LSServerFilterKeyValue extends LSServerFilter {
@JsonProperty("value_borders")
private String valueBorders;
+ public LSServerFilterKeyValue() {}
+
public LSServerFilterKeyValue(FilterDescriptor filterDescriptor) {
super(filterDescriptor);
FilterKeyValueDescriptor filterKeyValueDescriptor = (FilterKeyValueDescriptor)filterDescriptor;
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
index fe83fe4..e0f7564 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
@@ -21,6 +21,8 @@ package org.apache.ambari.logsearch.model.common;
import java.util.Map;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.InputDescriptor;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -32,42 +34,47 @@ import io.swagger.annotations.ApiModel;
@ApiModel
@JsonInclude(Include.NON_NULL)
public abstract class LSServerInput {
- private final String type;
- private final String rowtype;
- private final String path;
+ @NotNull
+ private String type;
+ private String rowtype;
+
+ @NotNull
+ private String path;
@JsonProperty("add_fields")
- private final Map<String, String> addFields;
+ private Map<String, String> addFields;
- private final String source;
- private final Boolean tail;
+ private String source;
+ private Boolean tail;
@JsonProperty("gen_event_md5")
- private final Boolean genEventMd5;
+ private Boolean genEventMd5;
@JsonProperty("use_event_md5_as_id")
- private final Boolean useEventMd5AsId;
+ private Boolean useEventMd5AsId;
@JsonProperty("start_position")
- private final String startPosition;
+ private String startPosition;
@JsonProperty("cache_enabled")
- private final Boolean cacheEnabled;
+ private Boolean cacheEnabled;
@JsonProperty("cache_key_field")
- private final String cacheKeyField;
+ private String cacheKeyField;
@JsonProperty("cache_last_dedup_enabled")
- private final Boolean cacheLastDedupEnabled;
+ private Boolean cacheLastDedupEnabled;
@JsonProperty("cache_size")
- private final Integer cacheSize;
+ private Integer cacheSize;
@JsonProperty("cache_dedup_interval")
- private final Long cacheDedupInterval;
+ private Long cacheDedupInterval;
@JsonProperty("is_enabled")
- private final Boolean isEnabled;
+ private Boolean isEnabled;
+
+ public LSServerInput() {}
public LSServerInput(InputDescriptor inputDescriptor) {
this.type = inputDescriptor.getType();
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputConfig.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputConfig.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputConfig.java
index e3dc0d1..81c4593 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputConfig.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputConfig.java
@@ -22,6 +22,9 @@ package org.apache.ambari.logsearch.model.common;
import java.util.ArrayList;
import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.FilterDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.FilterGrokDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.FilterJsonDescriptor;
@@ -31,17 +34,27 @@ import org.apache.ambari.logsearch.config.api.model.inputconfig.InputDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.InputFileBaseDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.InputS3FileDescriptor;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class LSServerInputConfig {
+ @Valid
+ @NotNull
@ApiModelProperty
+ @JsonDeserialize(using = LSServerInputDeserializer.class)
private List<LSServerInput> input;
+ @Valid
+ @NotNull
@ApiModelProperty
+ @JsonDeserialize(using = LSServerFilterDeserializer.class)
private List<LSServerFilter> filter;
+ public LSServerInputConfig() {}
+
public LSServerInputConfig(InputConfig inputConfig) {
input = new ArrayList<>();
for (InputDescriptor inputDescriptor : inputConfig.getInput()) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputDeserializer.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputDeserializer.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputDeserializer.java
new file mode 100644
index 0000000..63a8627
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputDeserializer.java
@@ -0,0 +1,62 @@
+/*
+ * 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.ambari.logsearch.model.common;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.core.TreeNode;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class LSServerInputDeserializer extends JsonDeserializer<List<LSServerInput>> {
+ @Override
+ public List<LSServerInput> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
+ ObjectCodec oc = jp.getCodec();
+ JsonNode node = oc.readTree(jp);
+
+ List<LSServerInput> inputs = new ArrayList<>();
+ for (JsonNode inputNode : node) {
+
+ String source = null;
+ if (inputNode.get("source") != null) {
+ source = inputNode.get("source").asText();
+ } else {
+ source = (inputNode.get("s3_access_key") != null || inputNode.get("s3_secret_key") != null) ? "s3_file" : "file";
+ }
+
+ switch (source) {
+ case "file" :
+ inputs.add(oc.treeToValue((TreeNode)inputNode, LSServerInputFile.class));
+ break;
+ case "s3_file" :
+ inputs.add(oc.treeToValue((TreeNode)inputNode, LSServerInputS3File.class));
+ break;
+ }
+ }
+
+ return inputs;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFile.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFile.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFile.java
index 5c547ad..bb2a49c 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFile.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFile.java
@@ -25,6 +25,8 @@ import io.swagger.annotations.ApiModel;
@ApiModel
public class LSServerInputFile extends LSServerInputFileBase {
+ public LSServerInputFile() {}
+
public LSServerInputFile(InputDescriptor inputDescriptor) {
super(inputDescriptor);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFileBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFileBase.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFileBase.java
index df21d0d..429d50a 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFileBase.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputFileBase.java
@@ -37,6 +37,8 @@ public abstract class LSServerInputFileBase extends LSServerInput {
@JsonProperty("copy_file")
private Boolean copyFile;
+ public LSServerInputFileBase() {}
+
public LSServerInputFileBase(InputDescriptor inputDescriptor) {
super(inputDescriptor);
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputS3File.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputS3File.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputS3File.java
index 8e9acf0..24d25c4 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputS3File.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInputS3File.java
@@ -19,6 +19,8 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.InputDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.InputS3FileDescriptor;
@@ -28,12 +30,16 @@ import io.swagger.annotations.ApiModel;
@ApiModel
public class LSServerInputS3File extends LSServerInputFileBase {
+ @NotNull
@JsonProperty("s3_access_key")
private String s3AccessKey;
+ @NotNull
@JsonProperty("s3_secret_key")
private String s3SecretKey;
+ public LSServerInputS3File() {}
+
public LSServerInputS3File(InputDescriptor inputDescriptor) {
super(inputDescriptor);
InputS3FileDescriptor inputS3FileDescriptor = (InputS3FileDescriptor)inputDescriptor;
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilter.java
index 2a00802..f79fafa 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilter.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilter.java
@@ -22,6 +22,8 @@ package org.apache.ambari.logsearch.model.common;
import java.util.Date;
import java.util.List;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.loglevelfilter.LogLevelFilter;
import io.swagger.annotations.ApiModel;
@@ -30,11 +32,23 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class LSServerLogLevelFilter {
- @ApiModelProperty private String label;
- @ApiModelProperty private List<String> hosts;
- @ApiModelProperty private List<String> defaultLevels;
- @ApiModelProperty private List<String> overrideLevels;
- @ApiModelProperty private Date expiryTime;
+ @NotNull
+ @ApiModelProperty
+ private String label;
+
+ @NotNull
+ @ApiModelProperty
+ private List<String> hosts;
+
+ @NotNull
+ @ApiModelProperty
+ private List<String> defaultLevels;
+
+ @ApiModelProperty
+ private List<String> overrideLevels;
+
+ @ApiModelProperty
+ private Date expiryTime;
public LSServerLogLevelFilter() {}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilterMap.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilterMap.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilterMap.java
index 3088db1..8081a27 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilterMap.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerLogLevelFilterMap.java
@@ -22,6 +22,9 @@ package org.apache.ambari.logsearch.model.common;
import java.util.Map;
import java.util.TreeMap;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.loglevelfilter.LogLevelFilter;
import org.apache.ambari.logsearch.config.api.model.loglevelfilter.LogLevelFilterMap;
@@ -31,6 +34,8 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class LSServerLogLevelFilterMap {
+ @Valid
+ @NotNull
@ApiModelProperty
private TreeMap<String, LSServerLogLevelFilter> filter;
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
index dcacceb..3147402 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
@@ -19,6 +19,8 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapDateDescriptor;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -35,9 +37,12 @@ public class LSServerMapDate extends LSServerMapField {
@JsonProperty("source_date_pattern")
private String sourceDatePattern;
+ @NotNull
@JsonProperty("target_date_pattern")
private String targetDatePattern;
+ public LSServerMapDate() {}
+
public LSServerMapDate(MapDateDescriptor mapDateDescriptor) {
this.sourceDatePattern = mapDateDescriptor.getSourceDatePattern();
this.targetDatePattern = mapDateDescriptor.getTargetDatePattern();
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldCopy.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldCopy.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldCopy.java
index b0bea83..ab12698 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldCopy.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldCopy.java
@@ -19,6 +19,8 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldCopyDescriptor;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -32,9 +34,12 @@ public class LSServerMapFieldCopy extends LSServerMapField {
return "map_fieldcopy";
}
+ @NotNull
@JsonProperty("copy_name")
private String copyName;
+ public LSServerMapFieldCopy() {}
+
public LSServerMapFieldCopy(MapFieldCopyDescriptor mapFieldCopyDescriptor) {
this.copyName = mapFieldCopyDescriptor.getCopyName();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldName.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldName.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldName.java
index 000b29d..ab7311c 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldName.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldName.java
@@ -19,6 +19,8 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldNameDescriptor;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -32,9 +34,12 @@ public class LSServerMapFieldName extends LSServerMapField {
return "map_fieldname";
}
+ @NotNull
@JsonProperty("new_field_name")
private String newFieldName;
+ public LSServerMapFieldName() {}
+
public LSServerMapFieldName(MapFieldNameDescriptor mapFieldNameDescriptor) {
this.newFieldName = mapFieldNameDescriptor.getNewFieldName();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldValue.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldValue.java
index 6152de5..a7d3949 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldValue.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapFieldValue.java
@@ -19,6 +19,8 @@
package org.apache.ambari.logsearch.model.common;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldValueDescriptor;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -32,12 +34,16 @@ public class LSServerMapFieldValue extends LSServerMapField {
return "map_fieldvalue";
}
+ @NotNull
@JsonProperty("pre_value")
private String preValue;
+ @NotNull
@JsonProperty("post_value")
private String postValue;
+ public LSServerMapFieldValue() {}
+
public LSServerMapFieldValue(MapFieldValueDescriptor mapFieldValueDescriptor) {
this.preValue = mapFieldValueDescriptor.getPreValue();
this.postValue = mapFieldValueDescriptor.getPostValue();
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValues.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValues.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValues.java
index 5f361c9..c62a9fd 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValues.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValues.java
@@ -22,6 +22,9 @@ package org.apache.ambari.logsearch.model.common;
import java.util.ArrayList;
import java.util.List;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapDateDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldCopyDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldDescriptor;
@@ -29,30 +32,37 @@ import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldNameDesc
import org.apache.ambari.logsearch.config.api.model.inputconfig.MapFieldValueDescriptor;
import org.apache.ambari.logsearch.config.api.model.inputconfig.PostMapValues;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
import io.swagger.annotations.ApiModel;
@ApiModel
-@JsonSerialize(using = LSServerPostMapValuesSerializer.class)
public class LSServerPostMapValues {
+ @Valid
+ @NotNull
private List<LSServerMapField> mappers;
+ public LSServerPostMapValues() {}
+
public LSServerPostMapValues(PostMapValues pmv) {
mappers = new ArrayList<>();
for (MapFieldDescriptor mapFieldDescriptor : pmv.getMappers()) {
- if (mapFieldDescriptor instanceof MapDateDescriptor) {
- mappers.add(new LSServerMapDate((MapDateDescriptor)mapFieldDescriptor));
- } else if (mapFieldDescriptor instanceof MapFieldCopyDescriptor) {
- mappers.add(new LSServerMapFieldCopy((MapFieldCopyDescriptor)mapFieldDescriptor));
- } else if (mapFieldDescriptor instanceof MapFieldNameDescriptor) {
- mappers.add(new LSServerMapFieldName((MapFieldNameDescriptor)mapFieldDescriptor));
- } else if (mapFieldDescriptor instanceof MapFieldValueDescriptor) {
- mappers.add(new LSServerMapFieldValue((MapFieldValueDescriptor)mapFieldDescriptor));
- }
+ mappers.add(convert(mapFieldDescriptor));
}
}
+ private LSServerMapField convert(MapFieldDescriptor mapFieldDescriptor) {
+ if (mapFieldDescriptor instanceof MapDateDescriptor) {
+ return new LSServerMapDate((MapDateDescriptor)mapFieldDescriptor);
+ } else if (mapFieldDescriptor instanceof MapFieldCopyDescriptor) {
+ return new LSServerMapFieldCopy((MapFieldCopyDescriptor)mapFieldDescriptor);
+ } else if (mapFieldDescriptor instanceof MapFieldNameDescriptor) {
+ return new LSServerMapFieldName((MapFieldNameDescriptor)mapFieldDescriptor);
+ } else if (mapFieldDescriptor instanceof MapFieldValueDescriptor) {
+ return new LSServerMapFieldValue((MapFieldValueDescriptor)mapFieldDescriptor);
+ }
+
+ throw new IllegalArgumentException("Unknown mapper: " + mapFieldDescriptor.getClass());
+ }
+
public List<LSServerMapField> getMappers() {
return mappers;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesList.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesList.java
new file mode 100644
index 0000000..2d29de0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesList.java
@@ -0,0 +1,59 @@
+/*
+ * 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.ambari.logsearch.model.common;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+import org.apache.ambari.logsearch.config.api.model.inputconfig.PostMapValues;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+import io.swagger.annotations.ApiModel;
+
+@ApiModel
+@JsonSerialize(using = LSServerPostMapValuesListSerializer.class)
+@JsonDeserialize(using = LSServerPostMapValuesListDeserializer.class)
+public class LSServerPostMapValuesList {
+ @Valid
+ @NotNull
+ private List<LSServerPostMapValues> mapperLists;
+
+ public LSServerPostMapValuesList() {}
+
+ public LSServerPostMapValuesList(List<? extends PostMapValues> list) {
+ mapperLists = new ArrayList<>();
+ for (PostMapValues postMapValues : list) {
+ mapperLists.add(new LSServerPostMapValues(postMapValues));
+ }
+ }
+
+ public List<LSServerPostMapValues> getMappersList() {
+ return mapperLists;
+ }
+
+ public void setMappersList(List<LSServerPostMapValues> mapperLists) {
+ this.mapperLists = mapperLists;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListDeserializer.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListDeserializer.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListDeserializer.java
new file mode 100644
index 0000000..18744e2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListDeserializer.java
@@ -0,0 +1,79 @@
+/*
+ * 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.ambari.logsearch.model.common;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.ObjectCodec;
+import com.fasterxml.jackson.core.TreeNode;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class LSServerPostMapValuesListDeserializer extends JsonDeserializer<LSServerPostMapValuesList> {
+ @Override
+ public LSServerPostMapValuesList deserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ ObjectCodec oc = jp.getCodec();
+ JsonNode node = oc.readTree(jp);
+
+ List<LSServerPostMapValues> mappersList = new ArrayList<>();
+ for (JsonNode childNode : node) {
+ List<LSServerMapField> mappers = new ArrayList<>();
+ for (Iterator<Map.Entry<String, JsonNode>> i = childNode.fields(); i.hasNext();) {
+ Map.Entry<String, JsonNode> mapperData = i.next();
+ String mapperType = mapperData.getKey();
+ JsonNode mapperProperties = mapperData.getValue();
+ switch (mapperType) {
+ case "map_date" :
+ LSServerMapDate mapDate = oc.treeToValue((TreeNode)mapperProperties, LSServerMapDate.class);
+ mappers.add(mapDate);
+ break;
+ case "map_fieldname" :
+ LSServerMapFieldName mapFieldName = oc.treeToValue((TreeNode)mapperProperties, LSServerMapFieldName.class);
+ mappers.add(mapFieldName);
+ break;
+ case "map_fieldvalue" :
+ LSServerMapFieldValue mapFieldValue = oc.treeToValue((TreeNode)mapperProperties, LSServerMapFieldValue.class);
+ mappers.add(mapFieldValue);
+ break;
+ case "map_fieldcopy" :
+ LSServerMapFieldCopy mapFieldCopy = oc.treeToValue((TreeNode)mapperProperties, LSServerMapFieldCopy.class);
+ mappers.add(mapFieldCopy);
+ break;
+ }
+ }
+
+ LSServerPostMapValues lsServerPostMapValues = new LSServerPostMapValues();
+ lsServerPostMapValues.setMappers(mappers);
+ mappersList.add(lsServerPostMapValues);
+ }
+
+ LSServerPostMapValuesList lsServerPostMapValuesList = new LSServerPostMapValuesList();
+ lsServerPostMapValuesList.setMappersList(mappersList);
+ return lsServerPostMapValuesList;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListSerializer.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListSerializer.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListSerializer.java
new file mode 100644
index 0000000..bb1eadf
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesListSerializer.java
@@ -0,0 +1,44 @@
+/*
+ * 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.ambari.logsearch.model.common;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializerProvider;
+
+public class LSServerPostMapValuesListSerializer extends JsonSerializer<LSServerPostMapValuesList> {
+ @Override
+ public void serialize(LSServerPostMapValuesList value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeStartArray();
+ for (LSServerPostMapValues postMapValues : value.getMappersList()) {
+ jgen.writeStartObject();
+ for (LSServerMapField mapField : postMapValues.getMappers()) {
+ jgen.writeObjectField(mapField.getName(), mapField);
+ }
+ jgen.writeEndObject();
+ }
+
+ jgen.writeEndArray();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesSerializer.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesSerializer.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesSerializer.java
deleted file mode 100644
index 7543677..0000000
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerPostMapValuesSerializer.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.ambari.logsearch.model.common;
-
-import java.io.IOException;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-
-public class LSServerPostMapValuesSerializer extends JsonSerializer<LSServerPostMapValues> {
- @Override
- public void serialize(LSServerPostMapValues value, JsonGenerator jgen, SerializerProvider provider)
- throws IOException, JsonProcessingException {
- jgen.writeStartObject();
- for (LSServerMapField mapField : value.getMappers()) {
- jgen.writeObjectField(mapField.getName(), mapField);
- }
- jgen.writeEndObject();
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93130e6b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/ShipperConfigResource.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/ShipperConfigResource.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/ShipperConfigResource.java
index a7d99c9..71da326 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/ShipperConfigResource.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/rest/ShipperConfigResource.java
@@ -21,6 +21,8 @@ package org.apache.ambari.logsearch.rest;
import javax.inject.Inject;
import javax.inject.Named;
+import javax.validation.Valid;
+import javax.validation.executable.ValidateOnExecution;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
@@ -75,18 +77,20 @@ public class ShipperConfigResource {
@Path("/input/{clusterName}/services/{serviceName}")
@Produces({"application/json"})
@ApiOperation(SET_SHIPPER_CONFIG_OD)
- public Response createShipperConfig(String body, @PathParam("clusterName") String clusterName, @PathParam("serviceName")
- String serviceName) {
- return shipperConfigManager.createInputConfig(clusterName, serviceName, body);
+ @ValidateOnExecution
+ public Response createShipperConfig(@Valid LSServerInputConfig request, @PathParam("clusterName") String clusterName,
+ @PathParam("serviceName") String serviceName) {
+ return shipperConfigManager.createInputConfig(clusterName, serviceName, request);
}
@PUT
@Path("/input/{clusterName}/services/{serviceName}")
@Produces({"application/json"})
@ApiOperation(SET_SHIPPER_CONFIG_OD)
- public Response setShipperConfig(String body, @PathParam("clusterName") String clusterName, @PathParam("serviceName")
- String serviceName) {
- return shipperConfigManager.setInputConfig(clusterName, serviceName, body);
+ @ValidateOnExecution
+ public Response setShipperConfig(@Valid LSServerInputConfig request, @PathParam("clusterName") String clusterName,
+ @PathParam("serviceName") String serviceName) {
+ return shipperConfigManager.setInputConfig(clusterName, serviceName, request);
}
@GET
@@ -101,7 +105,8 @@ public class ShipperConfigResource {
@Path("/filters/{clusterName}/level")
@Produces({"application/json"})
@ApiOperation(UPDATE_LOG_LEVEL_FILTER_OD)
- public Response setLogLevelFilter(LSServerLogLevelFilterMap request, @PathParam("clusterName") String clusterName) {
+ @ValidateOnExecution
+ public Response setLogLevelFilter(@Valid LSServerLogLevelFilterMap request, @PathParam("clusterName") String clusterName) {
return shipperConfigManager.setLogLevelFilters(clusterName, request);
}
[16/17] ambari git commit: AMBARI-20727 ADDENDUM Small fixes in Log
Search (mgergely)
Posted by jo...@apache.org.
AMBARI-20727 ADDENDUM Small fixes in Log Search (mgergely)
Change-Id: I9625487e94032e98a5bf00e9372abb0f6dfc08b4
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/753f8aac
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/753f8aac
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/753f8aac
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 753f8aacc5bf42d7a22ff702b52865d6e14a9792
Parents: b1f9717
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Wed May 31 15:41:46 2017 +0200
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Wed May 31 15:42:00 2017 +0200
----------------------------------------------------------------------
.../java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/753f8aac/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
index 945526a..f068798 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
@@ -23,8 +23,8 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
[15/17] ambari git commit: AMBARI-20727 Small fixes in Log Search
(mgergely)
Posted by jo...@apache.org.
AMBARI-20727 Small fixes in Log Search (mgergely)
Change-Id: I82c90696a963691ec6e26d91fe88a21055a00e0c
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b1f97171
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b1f97171
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b1f97171
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: b1f9717173086a8a6aef59def8a9f4b9ab01a412
Parents: 4f36e14
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Wed May 31 11:51:09 2017 +0200
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Wed May 31 11:51:09 2017 +0200
----------------------------------------------------------------------
.../ambari-logsearch-appender/pom.xml | 3 +-
.../logsearch/steps/LogSearchApiSteps.java | 6 +-
.../ambari-logsearch-logfeeder/pom.xml | 2 -
.../src/main/resources/log4j.xml | 3 +-
.../ambari-logsearch-server/pom.xml | 2 -
.../AbstractLogRequestFacetQueryConverter.java | 2 +
.../handler/ListCollectionHandler.java | 1 +
.../logsearch/manager/AuditLogsManager.java | 11 +-
.../ambari/logsearch/manager/ManagerBase.java | 5 +-
.../logsearch/manager/ServiceLogsManager.java | 62 ++++----
.../LogsearchAuthSuccessHandler.java | 4 -
.../web/filters/LogsearchKrbFilter.java | 62 ++++----
.../web/model/JWTAuthenticationToken.java | 2 +-
.../src/main/resources/log4j.xml | 158 ++++++++++---------
.../server/upgrade/UpgradeCatalog300.java | 19 +++
.../0.5.0/properties/logfeeder-log4j.xml.j2 | 2 +-
.../0.5.0/properties/logsearch-log4j.xml.j2 | 2 +-
.../server/upgrade/UpgradeCatalog300Test.java | 33 ++++
18 files changed, 218 insertions(+), 161 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-appender/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/pom.xml b/ambari-logsearch/ambari-logsearch-appender/pom.xml
index e14d576..1580737 100644
--- a/ambari-logsearch/ambari-logsearch-appender/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-appender/pom.xml
@@ -23,9 +23,8 @@
<groupId>org.apache.ambari</groupId>
<version>2.0.0.0-SNAPSHOT</version>
</parent>
- <groupId>org.apache.ambari</groupId>
+
<artifactId>ambari-logsearch-appender</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Ambari Logsearch Appender</name>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/LogSearchApiSteps.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/LogSearchApiSteps.java b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/LogSearchApiSteps.java
index bcfc4db..90fff94 100644
--- a/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/LogSearchApiSteps.java
+++ b/ambari-logsearch/ambari-logsearch-it/src/test/java/org/apache/ambari/logsearch/steps/LogSearchApiSteps.java
@@ -41,7 +41,6 @@ import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -81,12 +80,13 @@ public class LogSearchApiSteps {
JsonNode expected = mapper.readTree(jsonExpected);
JsonNode result = mapper.readTree(response);
JsonNode patch = JsonDiff.asJson(expected, result);
- List<Object> diffObjects = mapper.convertValue(patch, List.class);
+ List<?> diffObjects = mapper.convertValue(patch, List.class);
assertDiffs(diffObjects, expected);
}
- private void assertDiffs(List<Object> diffObjects, JsonNode expected) {
+ @SuppressWarnings("unchecked")
+ private void assertDiffs(List<?> diffObjects, JsonNode expected) {
for (Object diffObj : diffObjects) {
String path = ((Map<String, String>) diffObj).get("path");
Assert.assertTrue(expected.at(path).isMissingNode());
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
index 5d6f8b6..ddef52f 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
@@ -26,8 +26,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>ambari-logsearch-logfeeder</artifactId>
- <groupId>org.apache.ambari</groupId>
- <version>2.0.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Ambari Logsearch Log Feeder</name>
<url>http://maven.apache.org</url>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
index 8a3d26d..8d5174e 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
@@ -15,7 +15,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/pom.xml b/ambari-logsearch/ambari-logsearch-server/pom.xml
index b505c12..7cd90eb 100755
--- a/ambari-logsearch/ambari-logsearch-server/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-server/pom.xml
@@ -22,10 +22,8 @@
<version>2.0.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.ambari</groupId>
<artifactId>ambari-logsearch-server</artifactId>
<packaging>jar</packaging>
- <version>2.0.0.0-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<name>Ambari Logsearch Server</name>
<properties>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/AbstractLogRequestFacetQueryConverter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/AbstractLogRequestFacetQueryConverter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/AbstractLogRequestFacetQueryConverter.java
index d5e807b..db34684 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/AbstractLogRequestFacetQueryConverter.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/converter/AbstractLogRequestFacetQueryConverter.java
@@ -67,9 +67,11 @@ public abstract class AbstractLogRequestFacetQueryConverter<SOURCE extends BaseL
public abstract LogType getLogType();
+ @SuppressWarnings("unused")
public void appendFacetQuery(SimpleFacetQuery facetQuery, SOURCE request) {
}
+ @SuppressWarnings("unused")
public void appendFacetOptions(FacetOptions facetOptions, SOURCE request) {
facetOptions.setFacetLimit(-1);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/ListCollectionHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/ListCollectionHandler.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/ListCollectionHandler.java
index 124ce40..b2c8e4f 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/ListCollectionHandler.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/handler/ListCollectionHandler.java
@@ -33,6 +33,7 @@ public class ListCollectionHandler implements SolrZkRequestHandler<List<String>>
private static final Logger LOG = LoggerFactory.getLogger(ListCollectionHandler.class);
+ @SuppressWarnings("unchecked")
@Override
public List<String> handle(CloudSolrClient solrClient, SolrPropsConfig solrPropsConfig) throws Exception {
try {
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java
index 99d2675..4f3fcbb 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/AuditLogsManager.java
@@ -46,9 +46,9 @@ import org.apache.ambari.logsearch.model.request.impl.AuditBarGraphRequest;
import org.apache.ambari.logsearch.model.request.impl.AuditComponentRequest;
import org.apache.ambari.logsearch.model.request.impl.AuditLogRequest;
import org.apache.ambari.logsearch.model.request.impl.AuditServiceLoadRequest;
-import org.apache.ambari.logsearch.model.request.impl.FieldAuditLogRequest;
import org.apache.ambari.logsearch.model.request.impl.TopFieldAuditLogRequest;
import org.apache.ambari.logsearch.model.request.impl.UserExportRequest;
+import org.apache.ambari.logsearch.model.response.AuditLogData;
import org.apache.ambari.logsearch.model.response.AuditLogResponse;
import org.apache.ambari.logsearch.model.response.BarGraphDataListResponse;
import org.apache.ambari.logsearch.model.response.GroupListResponse;
@@ -74,7 +74,7 @@ import static org.apache.ambari.logsearch.solr.SolrConstants.AuditLogConstants.A
import static org.apache.ambari.logsearch.solr.SolrConstants.CommonLogConstants.CLUSTER;
@Named
-public class AuditLogsManager extends ManagerBase<SolrAuditLogData, AuditLogResponse> {
+public class AuditLogsManager extends ManagerBase<AuditLogData, AuditLogResponse> {
private static final Logger logger = Logger.getLogger(AuditLogsManager.class);
private static final String AUDIT_LOG_TEMPLATE = "audit_log_txt.ftl";
@@ -208,8 +208,11 @@ public class AuditLogsManager extends ManagerBase<SolrAuditLogData, AuditLogResp
}
@Override
- protected List<SolrAuditLogData> convertToSolrBeans(QueryResponse response) {
- return response.getBeans(SolrAuditLogData.class);
+ protected List<AuditLogData> convertToSolrBeans(QueryResponse response) {
+ List<SolrAuditLogData> solrAuditLogData = response.getBeans(SolrAuditLogData.class);
+ List<AuditLogData> auditLogData = new ArrayList<>();
+ auditLogData.addAll( solrAuditLogData );
+ return auditLogData;
}
@Override
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java
index cddfc85..9ae1961 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ManagerBase.java
@@ -25,7 +25,6 @@ import java.util.List;
import com.google.common.collect.Lists;
import org.apache.ambari.logsearch.common.LogSearchConstants;
-import org.apache.ambari.logsearch.model.response.GroupListResponse;
import org.apache.ambari.logsearch.model.response.LogData;
import org.apache.ambari.logsearch.model.response.LogSearchResponse;
import org.apache.ambari.logsearch.dao.SolrDaoBase;
@@ -40,9 +39,7 @@ import org.springframework.data.solr.core.DefaultQueryParser;
import org.springframework.data.solr.core.query.SimpleQuery;
import org.springframework.data.solr.core.query.SolrDataQuery;
-import static org.apache.ambari.logsearch.solr.SolrConstants.CommonLogConstants.CLUSTER;
-
-public abstract class ManagerBase<LOG_DATA_TYPE extends LogData, SEARCH_RESPONSE extends LogSearchResponse> extends JsonManagerBase {
+public abstract class ManagerBase<LOG_DATA_TYPE extends LogData, SEARCH_RESPONSE extends LogSearchResponse<LOG_DATA_TYPE>> extends JsonManagerBase {
private static final Logger logger = Logger.getLogger(ManagerBase.class);
public ManagerBase() {
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
index cb9e806..9ae8b9a 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/manager/ServiceLogsManager.java
@@ -72,7 +72,6 @@ import org.apache.ambari.logsearch.model.response.ServiceLogResponse;
import org.apache.ambari.logsearch.converter.BaseServiceLogRequestQueryConverter;
import org.apache.ambari.logsearch.converter.ServiceLogTruncatedRequestQueryConverter;
import org.apache.ambari.logsearch.solr.ResponseDataGenerator;
-import org.apache.ambari.logsearch.solr.SolrConstants;
import org.apache.ambari.logsearch.solr.model.SolrComponentTypeLogData;
import org.apache.ambari.logsearch.solr.model.SolrHostLogData;
import org.apache.ambari.logsearch.solr.model.SolrServiceLogData;
@@ -110,7 +109,7 @@ import static org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants
import static org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.LOGTIME;
@Named
-public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceLogResponse> {
+public class ServiceLogsManager extends ManagerBase<ServiceLogData, ServiceLogResponse> {
private static final Logger logger = Logger.getLogger(ServiceLogsManager.class);
private static final String SERVICE_LOG_TEMPLATE = "service_log_txt.ftl";
@@ -239,7 +238,7 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
return responseDataGenerator.generateBarGraphDataResponseWithRanges(response, LEVEL, true);
}
- public LogListResponse getPageByKeyword(ServiceLogRequest request, String event)
+ public LogListResponse<ServiceLogData> getPageByKeyword(ServiceLogRequest request, String event)
throws SolrServerException {
String defaultChoice = "0";
String keyword = request.getKeyWord();
@@ -251,7 +250,7 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
return getPageForKeywordByType(request, keyword, isNext, event);
}
- private LogListResponse getPageForKeywordByType(ServiceLogRequest request, String keyword, boolean isNext, String event) {
+ private LogListResponse<ServiceLogData> getPageForKeywordByType(ServiceLogRequest request, String keyword, boolean isNext, String event) {
String fromDate = request.getFrom(); // store start & end dates
String toDate = request.getTo();
boolean timeAscending = LogSearchConstants.ASCENDING_ORDER.equals(request.getSortType());
@@ -421,6 +420,7 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
File file = File.createTempFile(fileName, format);
FileOutputStream fis = new FileOutputStream(file);
fis.write(textToSave.getBytes());
+ fis.close();
return Response
.ok(file, MediaType.APPLICATION_OCTET_STREAM)
.header("Content-Disposition", "attachment;filename=" + fileName + format)
@@ -451,7 +451,7 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
public ServiceLogResponse getAfterBeforeLogs(ServiceLogTruncatedRequest request) {
ServiceLogResponse logResponse = new ServiceLogResponse();
- List<SolrServiceLogData> docList = null;
+ List<ServiceLogData> docList = null;
String scrollType = request.getScrollType() != null ? request.getScrollType() : "";
String logTime = null;
@@ -515,8 +515,11 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
}
@Override
- protected List<SolrServiceLogData> convertToSolrBeans(QueryResponse response) {
- return response.getBeans(SolrServiceLogData.class);
+ protected List<ServiceLogData> convertToSolrBeans(QueryResponse response) {
+ List<SolrServiceLogData> solrServiceLogData = response.getBeans(SolrServiceLogData.class);
+ List<ServiceLogData> serviceLogData = new ArrayList<>();
+ serviceLogData.addAll(solrServiceLogData);
+ return serviceLogData;
}
@Override
@@ -524,19 +527,19 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
return new ServiceLogResponse();
}
- private List<LogData> getLogDataListByFieldType(Class clazz, QueryResponse response, List<Count> fieldList) {
- List<LogData> groupList = getComponentBeans(clazz, response);
+ private <T extends LogData> List<T> getLogDataListByFieldType(Class<T> clazz, QueryResponse response, List<Count> fieldList) {
+ List<T> groupList = getComponentBeans(clazz, response);
String temp = "";
for (Count cnt : fieldList) {
- LogData logData = createNewFieldByType(clazz, cnt, temp);
+ T logData = createNewFieldByType(clazz, cnt, temp);
groupList.add(logData);
}
return groupList;
}
- private <T extends LogData> List<LogData> getComponentBeans(Class<T> clazz, QueryResponse response) {
+ private <T extends LogData> List<T> getComponentBeans(Class<T> clazz, QueryResponse response) {
if (clazz.isAssignableFrom(SolrHostLogData.class) || clazz.isAssignableFrom(SolrComponentTypeLogData.class)) {
- return (List<LogData>) response.getBeans(clazz);
+ return response.getBeans(clazz);
} else {
throw new UnsupportedOperationException();
}
@@ -547,15 +550,13 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
solrQuery.setQuery("*:*");
SolrUtil.addListFilterToSolrQuery(solrQuery, CLUSTER, clusters);
GroupListResponse collection = new GroupListResponse();
- SolrUtil.setFacetField(solrQuery,
- field);
+ SolrUtil.setFacetField(solrQuery, field);
SolrUtil.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
QueryResponse response = serviceLogsSolrDao.process(solrQuery);
if (response == null) {
return collection;
}
- FacetField facetField = response
- .getFacetField(field);
+ FacetField facetField = response.getFacetField(field);
if (facetField == null) {
return collection;
}
@@ -567,7 +568,9 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
if (docList == null) {
return collection;
}
- List<LogData> groupList = getLogDataListByFieldType(clazz, response, fieldList);
+ List<T> logDataListByFieldType = getLogDataListByFieldType(clazz, response, fieldList);
+ List<LogData> groupList = new ArrayList<>();
+ groupList.addAll(logDataListByFieldType);
collection.setGroupList(groupList);
if (!docList.isEmpty()) {
@@ -577,22 +580,21 @@ public class ServiceLogsManager extends ManagerBase<SolrServiceLogData, ServiceL
return collection;
}
- private <T extends LogData> LogData createNewFieldByType(Class<T> clazz, Count count, String temp) {
+ @SuppressWarnings("unchecked")
+ private <T extends LogData> T createNewFieldByType(Class<T> clazz, Count count, String temp) {
temp = count.getName();
LogData result = null;
- if (clazz.isAssignableFrom(SolrHostLogData.class)) {
- SolrHostLogData fieldData = new SolrHostLogData();
- fieldData.setHost(temp);
- result = fieldData;
- } else if (clazz.isAssignableFrom(SolrComponentTypeLogData.class)) {
- SolrComponentTypeLogData fieldData = new SolrComponentTypeLogData();
- fieldData.setType(temp);
- result = fieldData;
- }
- if (result != null) {
- return result;
+ if (clazz.equals(SolrHostLogData.class)) {
+ result = new SolrHostLogData();
+ ((SolrHostLogData)result).setHost(temp);
+ } else if (clazz.equals(SolrComponentTypeLogData.class)) {
+ result = new SolrComponentTypeLogData();
+ ((SolrComponentTypeLogData)result).setType(temp);
+ } else {
+ throw new UnsupportedOperationException();
}
- throw new UnsupportedOperationException();
+
+ return (T)result;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
index cf9d200..756cb2e 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
@@ -24,14 +24,10 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
public class LogsearchAuthSuccessHandler implements AuthenticationSuccessHandler {
- private static final Logger logger = Logger.getLogger(LogsearchAuthSuccessHandler.class);
-
-
@Override
public void onAuthenticationSuccess(HttpServletRequest request,
HttpServletResponse response, Authentication authentication)
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKrbFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKrbFilter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKrbFilter.java
index f4e70d7..b4c68fb 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKrbFilter.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchKrbFilter.java
@@ -150,13 +150,13 @@ public class LogsearchKrbFilter implements Filter {
* 1000; //10 hours
initializeSecretProvider(filterConfig);
- initializeAuthHandler(authHandlerClassName, filterConfig);
+ initializeAuthHandler(authHandlerClassName);
cookieDomain = config.getProperty(COOKIE_DOMAIN, null);
cookiePath = config.getProperty(COOKIE_PATH, null);
}
- protected void initializeAuthHandler(String authHandlerClassName, FilterConfig filterConfig)
+ private void initializeAuthHandler(String authHandlerClassName)
throws ServletException {
try {
Class<?> klass = Thread.currentThread().getContextClassLoader().loadClass(authHandlerClassName);
@@ -168,7 +168,7 @@ public class LogsearchKrbFilter implements Filter {
}
}
- protected void initializeSecretProvider(FilterConfig filterConfig)
+ private void initializeSecretProvider(FilterConfig filterConfig)
throws ServletException {
secretProvider = (SignerSecretProvider) filterConfig.getServletContext().
getAttribute(SIGNER_SECRET_PROVIDER_ATTRIBUTE);
@@ -184,20 +184,20 @@ public class LogsearchKrbFilter implements Filter {
signer = new Signer(secretProvider);
}
- public static SignerSecretProvider constructSecretProvider(
+ private static SignerSecretProvider constructSecretProvider(
ServletContext ctx, Properties config,
boolean disallowFallbackToRandomSecretProvider) throws Exception {
long validity = Long.parseLong(config.getProperty(AUTH_TOKEN_VALIDITY,
"36000")) * 1000;
- String name = config.getProperty(SIGNER_SECRET_PROVIDER);
- if (StringUtils.isEmpty(name)) {
- if (!disallowFallbackToRandomSecretProvider) {
- name = "random";
- } else {
- name = "file";
- }
- }
+ String name = config.getProperty(SIGNER_SECRET_PROVIDER);
+ if (StringUtils.isEmpty(name)) {
+ if (!disallowFallbackToRandomSecretProvider) {
+ name = "random";
+ } else {
+ name = "file";
+ }
+ }
SignerSecretProvider provider;
if ("file".equals(name)) {
@@ -263,7 +263,7 @@ public class LogsearchKrbFilter implements Filter {
* @return if a custom implementation of a SignerSecretProvider is being used.
*/
protected boolean isCustomSignerSecretProvider() {
- Class<?> clazz = secretProvider != null ? secretProvider.getClass() : null;
+ Class<?> clazz = secretProvider != null ? secretProvider.getClass() : null;
return clazz != FileSignerSecretProvider.class && clazz !=
RandomSignerSecretProvider.class && clazz != ZKSignerSecretProvider
.class;
@@ -327,16 +327,16 @@ public class LogsearchKrbFilter implements Filter {
protected Properties getConfiguration(String configPrefix, FilterConfig filterConfig) throws ServletException {
Properties props = new Properties();
if(filterConfig != null){
- Enumeration<?> names = filterConfig.getInitParameterNames();
- if(names != null){
- while (names.hasMoreElements()) {
- String name = (String) names.nextElement();
- if (name != null && configPrefix != null && name.startsWith(configPrefix)) {
- String value = filterConfig.getInitParameter(name);
- props.put(name.substring(configPrefix.length()), value);
- }
- }
- }
+ Enumeration<?> names = filterConfig.getInitParameterNames();
+ if(names != null){
+ while (names.hasMoreElements()) {
+ String name = (String) names.nextElement();
+ if (name != null && configPrefix != null && name.startsWith(configPrefix)) {
+ String value = filterConfig.getInitParameter(name);
+ props.put(name.substring(configPrefix.length()), value);
+ }
+ }
+ }
}
return props;
}
@@ -395,12 +395,12 @@ public class LogsearchKrbFilter implements Filter {
if (tokenStr != null) {
token = AuthenticationToken.parse(tokenStr);
if(token != null){
- if (!token.getType().equals(authHandler.getType())) {
- throw new AuthenticationException("Invalid AuthenticationToken type");
- }
- if (token.isExpired()) {
- throw new AuthenticationException("AuthenticationToken expired");
- }
+ if (!token.getType().equals(authHandler.getType())) {
+ throw new AuthenticationException("Invalid AuthenticationToken type");
+ }
+ if (token.isExpired()) {
+ throw new AuthenticationException("AuthenticationToken expired");
+ }
}
}
return token;
@@ -434,7 +434,7 @@ public class LogsearchKrbFilter implements Filter {
token = getToken(httpRequest);
}
catch (AuthenticationException ex) {
- ex.printStackTrace();
+ ex.printStackTrace();
logger.warn("AuthenticationToken ignored: " + ex.getMessage());
// will be sent back in a 401 unless filter authenticates
authenticationEx = ex;
@@ -546,7 +546,7 @@ public class LogsearchKrbFilter implements Filter {
* because of the fact that Hadoop is stuck at servlet 2.5 and jetty 6
* right now.
*/
- public static void createAuthCookie(HttpServletResponse resp, String token,
+ private static void createAuthCookie(HttpServletResponse resp, String token,
String domain, String path, long expires,
boolean isSecure) {
StringBuilder sb = new StringBuilder(AuthenticatedURL.AUTH_COOKIE)
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/model/JWTAuthenticationToken.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/model/JWTAuthenticationToken.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/model/JWTAuthenticationToken.java
index 35175b6..dfac191 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/model/JWTAuthenticationToken.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/web/model/JWTAuthenticationToken.java
@@ -30,7 +30,7 @@ public class JWTAuthenticationToken extends AbstractAuthenticationToken {
private String principal;
public JWTAuthenticationToken(String principal, String credential) {
- super((Collection)null);
+ super((Collection<? extends GrantedAuthority>)null);
this.principal = principal;
this.credential = credential;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-logsearch/ambari-logsearch-server/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/resources/log4j.xml b/ambari-logsearch/ambari-logsearch-server/src/main/resources/log4j.xml
index 547841a..dd85da8 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/resources/log4j.xml
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/resources/log4j.xml
@@ -1,56 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<!-- 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. -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!--
+ 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.
+-->
+
+<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
- </layout>
- </appender>
-
- <!-- <appender name="rolling_file" class="org.apache.log4j.RollingFileAppender">
- <param name="file" value="logs/logsearch-app.log" />
- <param name="Threshold" value="info" />
- <param name="append" value="true" />
- <param name="maxFileSize" value="10MB" />
- <param name="maxBackupIndex" value="10" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
- </layout>
- </appender>
-
- <appender name="audit_rolling_file" class="org.apache.log4j.RollingFileAppender">
- <param name="file" value="logs/logsearch-audit.log" />
- <param name="Threshold" value="info" />
- <param name="append" value="true" />
- <param name="maxFileSize" value="10MB" />
- <param name="maxBackupIndex" value="10" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
- </layout>
- </appender>
-
- <appender name="performance_analyzer" class="org.apache.log4j.RollingFileAppender">
- <param name="file" value="logs/logsearch-performance.log" />
- <param name="Threshold" value="info" />
- <param name="append" value="true" />
- <param name="maxFileSize" value="10MB" />
- <param name="maxBackupIndex" value="10" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
- </layout>
- </appender>
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <!-- <appender name="rolling_file" class="org.apache.log4j.RollingFileAppender">
+ <param name="file" value="logs/logsearch-app.log" />
+ <param name="Threshold" value="info" />
+ <param name="append" value="true" />
+ <param name="maxFileSize" value="10MB" />
+ <param name="maxBackupIndex" value="10" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="audit_rolling_file" class="org.apache.log4j.RollingFileAppender">
+ <param name="file" value="logs/logsearch-audit.log" />
+ <param name="Threshold" value="info" />
+ <param name="append" value="true" />
+ <param name="maxFileSize" value="10MB" />
+ <param name="maxBackupIndex" value="10" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="performance_analyzer" class="org.apache.log4j.RollingFileAppender">
+ <param name="file" value="logs/logsearch-performance.log" />
+ <param name="Threshold" value="info" />
+ <param name="append" value="true" />
+ <param name="maxFileSize" value="10MB" />
+ <param name="maxBackupIndex" value="10" />
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+ </layout>
+ </appender>
-->
<!-- logsearch appender config for the all above appender -->
@@ -85,35 +93,35 @@
<layout class="org.apache.ambari.logsearch.appender.LogsearchConversion" />
</appender>
- <!-- Logs to suppress BEGIN -->
- <category name="org.apache.solr.common.cloud.ZkStateReader" additivity="false">
- <priority value="error" />
- <appender-ref ref="console" />
- </category>
- <!-- Logs to suppress END -->
-
- <logger name="org.apache.ambari.logsearch.audit"
- additivity="true">
- <!-- <appender-ref ref="audit_rolling_file" />-->
+ <!-- Logs to suppress BEGIN -->
+ <category name="org.apache.solr.common.cloud.ZkStateReader" additivity="false">
+ <priority value="error" />
+ <appender-ref ref="console" />
+ </category>
+ <!-- Logs to suppress END -->
+
+ <logger name="org.apache.ambari.logsearch.audit"
+ additivity="true">
+ <!-- <appender-ref ref="audit_rolling_file" />-->
<appender-ref ref="audit_rolling_file_json" />
- </logger>
+ </logger>
- <logger name="org.apache.ambari.logsearch.performance"
- additivity="false">
- <!-- <appender-ref ref="performance_analyzer" />-->
+ <logger name="org.apache.ambari.logsearch.performance"
+ additivity="false">
+ <!-- <appender-ref ref="performance_analyzer" />-->
<appender-ref ref="performance_analyzer_json" />
- </logger>
+ </logger>
- <logger name="org.apache.ambari.logsearch" additivity="false">
- <!-- <appender-ref ref="console" /> -->
- <!-- <appender-ref ref="rolling_file" />-->
+ <logger name="org.apache.ambari.logsearch" additivity="false">
+ <!-- <appender-ref ref="console" /> -->
+ <!-- <appender-ref ref="rolling_file" />-->
<appender-ref ref="rolling_file_json" />
- </logger>
+ </logger>
- <root>
- <level value="warn" />
- <!-- <appender-ref ref="console" /> -->
- <!--<appender-ref ref="rolling_file" />-->
+ <root>
+ <level value="warn" />
+ <!-- <appender-ref ref="console" /> -->
+ <!--<appender-ref ref="rolling_file" />-->
<appender-ref ref="rolling_file_json" />
- </root>
+ </root>
</log4j:configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
index 44fbd4d..945526a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog300.java
@@ -24,6 +24,7 @@ import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -348,6 +349,24 @@ public class UpgradeCatalog300 extends AbstractUpgradeCatalog {
newProperties.put("logfeeder.include.default.level", defaultLogLevels);
updateConfigurationPropertiesForCluster(cluster, "logfeeder-properties", newProperties, true, true);
}
+
+ Config logfeederLog4jProperties = cluster.getDesiredConfigByType("logfeeder-log4j");
+ if (logfeederLog4jProperties != null) {
+ String content = logfeederLog4jProperties.getProperties().get("content");
+ if (content.contains("<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">")) {
+ content = content.replace("<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">", "<!DOCTYPE log4j:configuration SYSTEM \"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd\">");
+ updateConfigurationPropertiesForCluster(cluster, "logfeeder-log4j", Collections.singletonMap("content", content), true, true);
+ }
+ }
+
+ Config logsearchLog4jProperties = cluster.getDesiredConfigByType("logsearch-log4j");
+ if (logsearchLog4jProperties != null) {
+ String content = logsearchLog4jProperties.getProperties().get("content");
+ if (content.contains("<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">")) {
+ content = content.replace("<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">", "<!DOCTYPE log4j:configuration SYSTEM \"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd\">");
+ updateConfigurationPropertiesForCluster(cluster, "logsearch-log4j", Collections.singletonMap("content", content), true, true);
+ }
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
index a818fe0..697d672 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
@@ -15,7 +15,7 @@ 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.
-->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logsearch-log4j.xml.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logsearch-log4j.xml.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logsearch-log4j.xml.j2
index 63f9f0a..98f58f2 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logsearch-log4j.xml.j2
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logsearch-log4j.xml.j2
@@ -15,7 +15,7 @@ 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.
-->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b1f97171/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
index c949ca2..dbc77af 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
@@ -324,10 +324,37 @@ public class UpgradeCatalog300Test {
expect(controller.createConfig(anyObject(Cluster.class), eq("logsearch-properties"), capture(logSearchPropertiesCapture),
anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once();
+ Map<String, String> oldLogFeederLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">");
+
+ Map<String, String> expectedLogFeederLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd\">");
+
+ Config mockLogFeederLog4j = easyMockSupport.createNiceMock(Config.class);
+ expect(cluster.getDesiredConfigByType("logfeeder-log4j")).andReturn(mockLogFeederLog4j).atLeastOnce();
+ expect(mockLogFeederLog4j.getProperties()).andReturn(oldLogFeederLog4j).anyTimes();
+ Capture<Map<String, String>> logFeederLog4jCapture = EasyMock.newCapture();
+ expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(logFeederLog4jCapture), anyString(),
+ EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once();
+
+ Map<String, String> oldLogSearchLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">");
+
+ Map<String, String> expectedLogSearchLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd\">");
+
+ Config mockLogSearchLog4j = easyMockSupport.createNiceMock(Config.class);
+ expect(cluster.getDesiredConfigByType("logsearch-log4j")).andReturn(mockLogSearchLog4j).atLeastOnce();
+ expect(mockLogSearchLog4j.getProperties()).andReturn(oldLogSearchLog4j).anyTimes();
+ Capture<Map<String, String>> logSearchLog4jCapture = EasyMock.newCapture();
+ expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(logSearchLog4jCapture), anyString(),
+ EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once();
+
replay(clusters, cluster);
replay(controller, injector2);
replay(confSomethingElse1, confSomethingElse2, confLogSearchConf1, confLogSearchConf2);
replay(logSearchPropertiesConf, logFeederPropertiesConf);
+ replay(mockLogFeederLog4j, mockLogSearchLog4j);
new UpgradeCatalog300(injector2).updateLogSearchConfigs();
easyMockSupport.verifyAll();
@@ -342,5 +369,11 @@ public class UpgradeCatalog300Test {
Map<String,String> newLogSearchProperties = logSearchPropertiesCapture.getValue();
assertTrue(Maps.difference(Collections.<String, String> emptyMap(), newLogSearchProperties).areEqual());
+
+ Map<String, String> updatedLogFeederLog4j = logFeederLog4jCapture.getValue();
+ assertTrue(Maps.difference(expectedLogFeederLog4j, updatedLogFeederLog4j).areEqual());
+
+ Map<String, String> updatedLogSearchLog4j = logSearchLog4jCapture.getValue();
+ assertTrue(Maps.difference(expectedLogSearchLog4j, updatedLogSearchLog4j).areEqual());
}
}
[13/17] ambari git commit: AMBARI-21144 Create .md files to describe
Log Search input configurations (mgergely)
Posted by jo...@apache.org.
AMBARI-21144 Create .md files to describe Log Search input configurations (mgergely)
Change-Id: I632de5e66607119548ba083fdfed31d39a4e085f
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f0d970b5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f0d970b5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f0d970b5
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: f0d970b5b93a40c2e0830d5eaf3039c81ada2290
Parents: 5845d54
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Wed May 31 09:10:00 2017 +0200
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Wed May 31 09:10:00 2017 +0200
----------------------------------------------------------------------
.../api/model/inputconfig/InputDescriptor.java | 2 -
.../inputconfig/impl/InputDescriptorImpl.java | 12 -
.../inputconfig/impl/MapDateDescriptorImpl.java | 2 +-
.../ambari-logsearch-logfeeder/README.md | 17 +-
.../ambari-logsearch-logfeeder/docs/filter.md | 59 ++++
.../ambari-logsearch-logfeeder/docs/input.md | 63 ++++
.../docs/inputConfig.md | 29 ++
.../docs/postMapValues.md | 61 ++++
.../logfeeder/input/AbstractInputFile.java | 9 +-
.../ambari/logfeeder/mapper/MapperDate.java | 2 +-
.../ambari/logfeeder/input/InputFileTest.java | 1 -
.../resources/samples/config/config_audit.json | 339 +++++++++----------
.../samples/config/config_service.json | 79 +++--
.../logsearch/model/common/LSServerInput.java | 8 -
.../logsearch/model/common/LSServerMapDate.java | 2 +-
.../logfeeder/shipper-conf/global.config.json | 5 +-
.../package/templates/global.config.json.j2 | 3 +-
17 files changed, 442 insertions(+), 251 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-config-api/src/main/java/org/apache/ambari/logsearch/config/api/model/inputconfig/InputDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-config-api/src/main/java/org/apache/ambari/logsearch/config/api/model/inputconfig/InputDescriptor.java b/ambari-logsearch/ambari-logsearch-config-api/src/main/java/org/apache/ambari/logsearch/config/api/model/inputconfig/InputDescriptor.java
index c41da93..82e9504 100644
--- a/ambari-logsearch/ambari-logsearch-config-api/src/main/java/org/apache/ambari/logsearch/config/api/model/inputconfig/InputDescriptor.java
+++ b/ambari-logsearch/ambari-logsearch-config-api/src/main/java/org/apache/ambari/logsearch/config/api/model/inputconfig/InputDescriptor.java
@@ -38,8 +38,6 @@ public interface InputDescriptor {
Boolean isUseEventMd5AsId();
- String getStartPosition();
-
Boolean isCacheEnabled();
String getCacheKeyField();
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/InputDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/InputDescriptorImpl.java b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/InputDescriptorImpl.java
index 94dcc2a..54b4b9b 100644
--- a/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/InputDescriptorImpl.java
+++ b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/InputDescriptorImpl.java
@@ -53,10 +53,6 @@ public abstract class InputDescriptorImpl implements InputDescriptor {
@Expose
@SerializedName("use_event_md5_as_id")
private Boolean useEventMd5AsId;
-
- @Expose
- @SerializedName("start_position")
- private String startPosition;
@Expose
@SerializedName("cache_enabled")
@@ -146,14 +142,6 @@ public abstract class InputDescriptorImpl implements InputDescriptor {
this.useEventMd5AsId = useEventMd5AsId;
}
- public String getStartPosition() {
- return startPosition;
- }
-
- public void setStartPosition(String startPosition) {
- this.startPosition = startPosition;
- }
-
public Boolean isCacheEnabled() {
return cacheEnabled;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapDateDescriptorImpl.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapDateDescriptorImpl.java b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapDateDescriptorImpl.java
index 9daad2b..2e54e7a 100644
--- a/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapDateDescriptorImpl.java
+++ b/ambari-logsearch/ambari-logsearch-config-zookeeper/src/main/java/org/apache/ambari/logsearch/config/zookeeper/model/inputconfig/impl/MapDateDescriptorImpl.java
@@ -31,7 +31,7 @@ public class MapDateDescriptorImpl implements MapDateDescriptor {
}
@Expose
- @SerializedName("source_date_pattern")
+ @SerializedName("src_date_pattern")
private String sourceDatePattern;
@Expose
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/README.md b/ambari-logsearch/ambari-logsearch-logfeeder/README.md
index d00eb57..c5c6848 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/README.md
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/README.md
@@ -17,9 +17,10 @@ limitations under the License.
{% endcomment %}
-->
-#LogSearch - LogFeeder:
+#Log Search - Log Feeder:
-Logfeeder is a tool that reads log, parses it and stores it in Apache Solr for analyising purpose.
+Log Feeder is a component of the Log Search service that reads logs, parses them and stores them in Apache Solr for the purpose
+of later analysis.
#Compilation
mvn clean compile package
@@ -34,3 +35,15 @@ mkdir /opt/logfeeder
cd /opt/logfeeder
tar xfz ~/logsearch-logfeeder.tar.gz
```
+
+#Input Configuration
+
+The configuration for the log feeder contains
+* description of the log files
+* description of the filters that parse the data of the log entries
+* description of the mappers that modify the parsed fields
+
+The element description can be found [here](docs/inputConfig.md)
+
+All these data are stored in json files, which should be named in the directory /etc/ambari-logsearch-logfeeder/conf, and the
+name of the files should be input.config-<service\_name>.json
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
new file mode 100644
index 0000000..42c3271
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/filter.md
@@ -0,0 +1,59 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#Filter
+
+The filter element in the [input configuration](inputConfig.md) contains a list of filter descriptions, each describing one filter
+applied on an input.
+
+The general elements in the json are the following:
+
+| Field | Description | Default |
+|-----------------------|-------------------------------------------------------------------------------------------------|-------------|
+| filter | The type of the filter, currently grok, keyvalue and json are supported | - |
+| conditions | The conditions of which input to filter | - |
+| sort\_order | Describes the order in which the filters should be applied | - |
+| source\_field | The source of the filter, must be set for keyvalue filters | log_message |
+| remove\_source\_field | Remove the source field after the filter is applied | false |
+| post\_map\_values | Mappings done after the filtering provided it's result, see [post map values](postMapValues.md) | - |
+| is\_enabled | A flag to show if the filter should be used | true |
+
+
+##Grok Filter
+
+Grok filters have the following additional parameters:
+
+| Field | Description | Default |
+|--------------------|------------------------------------------------------------------------------------------------------------|---------|
+| log4j\_format | The log4j pattern of the log, not used, it is only there for documentation | - |
+| multiline\_pattern | The grok pattern that shows that the line is not a log line on it's own but the part of a multi line entry | - |
+| message\_pattern | The grok pattern to use to parse the log entry | - |
+
+
+##Key-value Filter
+
+Key-value filters have the following additional parameters:
+
+| Field | Description | Default |
+|----------------|-------------------------------------------------------------------------------------------|---------|
+| field\_split | The string that splits the key-value pairs | "\t" |
+| value\_split | The string that separates keys from values | "=" |
+| value\_borders | The borders around the value, must be 2 characters long, first before it, second after it | - |
+
+If value\_borders is only used if it is specified, and value\_split is not.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
new file mode 100644
index 0000000..e95401a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/input.md
@@ -0,0 +1,63 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#Input
+
+The input element in the [input configuration](inputConfig.md) contains a list of input descriptions, each describing one source
+of input.
+
+The general elements in the json are the following:
+
+| Field | Description | Default |
+|-----------------------------|-------------------------------------------------------------------------------------------------------|--------------|
+| type | The type of the input source, currently file and s3_file are supported | - |
+| rowtype | The type of the row, can be service / audit | - |
+| path | The path of the source, may contain '*' characters too | - |
+| add\_fields | The element contains field\_name: field\_value pairs which will be added to each rows data | - |
+| tail | The input should check for only the latest file matching the pattern, not all of them | true |
+| gen\_event\_md5 | Generate an event\_md5 field for each row by creating a hash of the row data | true |
+| use\_event\_md5\_as\_id | Generate an id for each row by creating a hash of the row data | false |
+| start\_position | Should the parsing start from the beginning | beginning |
+| cache\_enabled | Allows the input to use a cache to filter out duplications | true |
+| cache\_key\_field | Specifies the field for which to use the cache to find duplications of | log\_message |
+| cache\_last\_dedup\_enabled | Allow to filter out entries which are same as the most recent one irrelevant of it's time | false |
+| cache\_size | The number of entries to store in the cache | 100 |
+| cache\_dedup\_interval | The maximum interval in ms which may pass between two identical log messages to filter the latter out | 1000 |
+| is\_enabled | A flag to show if the input should be used | true |
+
+
+##File Input
+
+File inputs have the following parameters too:
+
+| Field | Description | Default |
+|--------------------------|--------------------------------------------------------------------|---------|
+| checkpoint\_interval\_ms | The time interval in ms when the checkpoint file should be updated | 5000 |
+| process\_file | Should the file be processed | true |
+| copy\_file | Should the file be copied \(only if not processed\) | false |
+
+
+##S3 File Input
+
+S3 file inputs have the following parameters in addition to the general file parameters:
+
+| Field | Description | Default |
+|-----------------|-----------------------------------------|---------|
+| s3\_access\_key | The access key used for AWS credentials | - |
+| s3\_secret\_key | The secret key used for AWS credentials | - |
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
new file mode 100644
index 0000000..ae7ac05
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/inputConfig.md
@@ -0,0 +1,29 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#Input Configuration
+
+The input configurations are stored in json files. Each of them are describing the processing of the log files of a service.
+
+The json contains two elements:
+
+| Field | Description |
+|--------|--------------------------------------------|
+| input | A list of [input descriptions](input.md) |
+| filter | A list of [filter descriptions](filter.md) |
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md b/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
new file mode 100644
index 0000000..aa381cd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/docs/postMapValues.md
@@ -0,0 +1,61 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#Post Map Values
+
+The Post Map Values element in the [filter](filter.md) field names as keys, the values are lists of sets of post map values, each
+describing one mapping done on a field named before obtained after filtering.
+
+Currently there are four kind of mappings are supported:
+
+##Map Date
+
+The name of the mapping element should be map\_date. The value json element may contain the following parameters:
+
+| Field | Description |
+|-----------------------|--------------------------------------------------------------------------------------------------------|
+| src\_date\_pattern | If it is specified than the mapper converts from this format to the target, and also adds missing year |
+| target\_date\_pattern | If 'epoch' then the field is parsed as seconds from 1970, otherwise the content used as pattern |
+
+
+##Map Copy
+
+The name of the mapping element should be map\_copy. The value json element should contain the following parameter:
+
+| Field | Description |
+|------------|-------------------------------|
+| copy\_name | The name of the copied field |
+
+
+##Map Field Name
+
+The name of the mapping element should be map\_fieldname. The value json element should contain the following parameter:
+
+| Field | Description |
+|------------------|-------------------------------|
+| new\_field\_name | The name of the renamed field |
+
+##Map Field Value
+
+The name of the mapping element should be map\_fieldvalue. The value json element should contain the following parameter:
+
+| Field | Description |
+|-------------|--------------------------------------------------------------------|
+| pre\_value | The value that the field must match \(ignoring case\) to be mapped |
+| post\_value | The value to which the field is modified to |
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/AbstractInputFile.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/AbstractInputFile.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/AbstractInputFile.java
index cfa1903..2bc4e68 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/AbstractInputFile.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/AbstractInputFile.java
@@ -45,7 +45,6 @@ public abstract class AbstractInputFile extends Input {
protected String base64FileKey;
protected boolean isReady;
- private boolean isStartFromBegining = true;
private String checkPointExtension;
private File checkPointFile;
@@ -82,12 +81,6 @@ public abstract class AbstractInputFile extends Input {
return;
}
- String startPosition = inputDescriptor.getStartPosition();
- if (StringUtils.isEmpty(startPosition) || startPosition.equalsIgnoreCase("beginning") ||
- startPosition.equalsIgnoreCase("begining") || !tail) {
- isStartFromBegining = true;
- }
-
setFilePath(logPath);
boolean isFileReady = isReady();
@@ -109,7 +102,7 @@ public abstract class AbstractInputFile extends Input {
br = openLogFile(logPathFile);
- boolean resume = isStartFromBegining;
+ boolean resume = true;
int resumeFromLineNumber = getResumeFromLineNumber();
if (resumeFromLineNumber > 0) {
resume = false;
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
index 5d34c06..305688b 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
@@ -38,7 +38,7 @@ public class MapperDate extends Mapper {
private SimpleDateFormat targetDateFormatter = null;
private boolean isEpoch = false;
- private SimpleDateFormat srcDateFormatter=null;
+ private SimpleDateFormat srcDateFormatter = null;
@Override
public boolean init(String inputDesc, String fieldName, String mapClassCode, MapFieldDescriptor mapFieldDescriptor) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/input/InputFileTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/input/InputFileTest.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/input/InputFileTest.java
index 3a5f31e..efebc08 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/input/InputFileTest.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/input/InputFileTest.java
@@ -81,7 +81,6 @@ public class InputFileTest {
inputFileDescriptor.setSource("file");
inputFileDescriptor.setTail(true);
inputFileDescriptor.setGenEventMd5(true);
- inputFileDescriptor.setStartPosition("beginning");
inputFileDescriptor.setType("hdfs_datanode");
inputFileDescriptor.setRowtype("service");
inputFileDescriptor.setPath(path);
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
index b7d0a6e..05f3bff 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
@@ -1,173 +1,172 @@
{
- "global": {
- "add_fields": {
- "cluster": "audit"
- },
- "source": "file",
- "tail": "true",
- "gen_event_md5": "true",
- "start_position": "beginning"
- },
- "input": [{
- "type": "hdfs_audit",
- "rowtype": "hdfs_audit",
- "path": "{path}/src/test/resources/samples/jsonlogs/audit_log.json"
- }],
- "filter": [{
- "filter": "json",
- "conditions": {
- "fields": {
- "type": [
- "hdfs_audit"
- ]
-
- }
- }
- }, {
- "filter": "keyvalue",
- "sort_order": 1,
- "conditions": {
- "fields": {
- "type": [
- "hdfs_audit"
- ]
-
- }
-
- },
- "source_field": "log_message",
- "value_split": "=",
- "field_split": "\t",
- "post_map_values": {
- "src": {
- "map_fieldname": {
- "new_fieldname": "resource"
- }
-
- },
- "ip": {
- "map_fieldname": {
- "new_fieldname": "cliIP"
- }
-
- },
- "allowed": [{
- "map_fieldvalue": {
- "pre_value": "true",
- "post_value": "1"
- }
-
- }, {
- "map_fieldvalue": {
- "pre_value": "false",
- "post_value": "0"
- }
-
- }, {
- "map_fieldname": {
- "new_fieldname": "result"
- }
-
- }
-
- ],
- "cmd": {
- "map_fieldname": {
- "new_fieldname": "action"
- }
-
- },
- "proto": {
- "map_fieldname": {
- "new_fieldname": "cliType"
- }
-
- },
- "callerContext": {
- "map_fieldname": {
- "new_fieldname": "req_caller_id"
- }
-
- }
-
- }
-
- }, {
- "filter": "grok",
- "sort_order": 2,
- "source_field": "ugi",
- "remove_source_field": "false",
- "conditions": {
- "fields": {
- "type": [
- "hdfs_audit"
- ]
-
- }
-
- },
- "message_pattern": "%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
- "post_map_values": {
- "user": {
- "map_fieldname": {
- "new_fieldname": "reqUser"
- }
-
- },
- "x_user": {
- "map_fieldname": {
- "new_fieldname": "reqUser"
- }
-
- },
- "p_user": {
- "map_fieldname": {
- "new_fieldname": "reqUser"
- }
-
- },
- "k_user": {
- "map_fieldname": {
- "new_fieldname": "proxyUsers"
- }
-
- },
- "p_authType": {
- "map_fieldname": {
- "new_fieldname": "authType"
- }
-
- },
- "k_authType": {
- "map_fieldname": {
- "new_fieldname": "proxyAuthType"
- }
-
- }
-
- }
-
- }
-
- ],
-
- "output": [{
- "is_enabled": "true",
- "comment": "Output to file for audit logs",
- "destination": "solr",
- "url": "http://localhost:8983/solr/audit_logs",
- "collection": "audit_logs",
- "number_of_shards": "1",
- "splits_interval_mins": "100000",
- "conditions": {
- "fields": {
- "rowtype": [
- "hdfs_audit"
- ]
- }
- }
- }
-
- ]
+ "global": {
+ "add_fields": {
+ "cluster": "audit"
+ },
+ "source": "file",
+ "tail": "true",
+ "gen_event_md5": "true"
+ },
+ "input": [{
+ "type": "hdfs_audit",
+ "rowtype": "hdfs_audit",
+ "path": "{path}/src/test/resources/samples/jsonlogs/audit_log.json"
+ }],
+ "filter": [{
+ "filter": "json",
+ "conditions": {
+ "fields": {
+ "type": [
+ "hdfs_audit"
+ ]
+
+ }
+ }
+ }, {
+ "filter": "keyvalue",
+ "sort_order": 1,
+ "conditions": {
+ "fields": {
+ "type": [
+ "hdfs_audit"
+ ]
+
+ }
+
+ },
+ "source_field": "log_message",
+ "value_split": "=",
+ "field_split": "\t",
+ "post_map_values": {
+ "src": {
+ "map_fieldname": {
+ "new_fieldname": "resource"
+ }
+
+ },
+ "ip": {
+ "map_fieldname": {
+ "new_fieldname": "cliIP"
+ }
+
+ },
+ "allowed": [{
+ "map_fieldvalue": {
+ "pre_value": "true",
+ "post_value": "1"
+ }
+
+ }, {
+ "map_fieldvalue": {
+ "pre_value": "false",
+ "post_value": "0"
+ }
+
+ }, {
+ "map_fieldname": {
+ "new_fieldname": "result"
+ }
+
+ }
+
+ ],
+ "cmd": {
+ "map_fieldname": {
+ "new_fieldname": "action"
+ }
+
+ },
+ "proto": {
+ "map_fieldname": {
+ "new_fieldname": "cliType"
+ }
+
+ },
+ "callerContext": {
+ "map_fieldname": {
+ "new_fieldname": "req_caller_id"
+ }
+
+ }
+
+ }
+
+ }, {
+ "filter": "grok",
+ "sort_order": 2,
+ "source_field": "ugi",
+ "remove_source_field": "false",
+ "conditions": {
+ "fields": {
+ "type": [
+ "hdfs_audit"
+ ]
+
+ }
+
+ },
+ "message_pattern": "%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
+ "post_map_values": {
+ "user": {
+ "map_fieldname": {
+ "new_fieldname": "reqUser"
+ }
+
+ },
+ "x_user": {
+ "map_fieldname": {
+ "new_fieldname": "reqUser"
+ }
+
+ },
+ "p_user": {
+ "map_fieldname": {
+ "new_fieldname": "reqUser"
+ }
+
+ },
+ "k_user": {
+ "map_fieldname": {
+ "new_fieldname": "proxyUsers"
+ }
+
+ },
+ "p_authType": {
+ "map_fieldname": {
+ "new_fieldname": "authType"
+ }
+
+ },
+ "k_authType": {
+ "map_fieldname": {
+ "new_fieldname": "proxyAuthType"
+ }
+
+ }
+
+ }
+
+ }
+
+ ],
+
+ "output": [{
+ "is_enabled": "true",
+ "comment": "Output to file for audit logs",
+ "destination": "solr",
+ "url": "http://localhost:8983/solr/audit_logs",
+ "collection": "audit_logs",
+ "number_of_shards": "1",
+ "splits_interval_mins": "100000",
+ "conditions": {
+ "fields": {
+ "rowtype": [
+ "hdfs_audit"
+ ]
+ }
+ }
+ }
+
+ ]
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
index 2e96fd7..0fff050 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
@@ -1,43 +1,42 @@
{
- "global": {
- "add_fields": {
- "cluster": "cluster_name"
- },
- "source": "file",
- "tail": "true",
- "gen_event_md5": "true",
- "start_position": "beginning"
- },
- "input": [{
- "type": "logsearch",
- "rowtype": "service",
- "path": "{path}/src/test/resources/samples/jsonlogs/service_log.json"
- }],
- "filter": [{
- "filter": "json",
- "conditions": {
- "fields": {
- "type": [
- "logsearch"
- ]
- }
- }
- }],
- "output": [{
- "comment": "Output to solr for service records",
- "is_enabled": "true",
- "destination": "solr",
- "url": "http://localhost:8983/solr/hadoop_logs",
- "collection": "hadoop_logs",
- "number_of_shards": "1",
- "splits_interval_mins": "100000",
- "conditions": {
- "fields": {
- "rowtype": [
- "service"
- ]
- }
- }
- }]
+ "global": {
+ "add_fields": {
+ "cluster": "cluster_name"
+ },
+ "source": "file",
+ "tail": "true",
+ "gen_event_md5": "true"
+ },
+ "input": [{
+ "type": "logsearch",
+ "rowtype": "service",
+ "path": "{path}/src/test/resources/samples/jsonlogs/service_log.json"
+ }],
+ "filter": [{
+ "filter": "json",
+ "conditions": {
+ "fields": {
+ "type": [
+ "logsearch"
+ ]
+ }
+ }
+ }],
+ "output": [{
+ "comment": "Output to solr for service records",
+ "is_enabled": "true",
+ "destination": "solr",
+ "url": "http://localhost:8983/solr/hadoop_logs",
+ "collection": "hadoop_logs",
+ "number_of_shards": "1",
+ "splits_interval_mins": "100000",
+ "conditions": {
+ "fields": {
+ "rowtype": [
+ "service"
+ ]
+ }
+ }
+ }]
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
index e0f7564..6ef3d3f 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerInput.java
@@ -53,9 +53,6 @@ public abstract class LSServerInput {
@JsonProperty("use_event_md5_as_id")
private Boolean useEventMd5AsId;
- @JsonProperty("start_position")
- private String startPosition;
-
@JsonProperty("cache_enabled")
private Boolean cacheEnabled;
@@ -85,7 +82,6 @@ public abstract class LSServerInput {
this.tail = inputDescriptor.isTail();
this.genEventMd5 = inputDescriptor.isGenEventMd5();
this.useEventMd5AsId = inputDescriptor.isUseEventMd5AsId();
- this.startPosition = inputDescriptor.getStartPosition();
this.cacheEnabled = inputDescriptor.isCacheEnabled();
this.cacheKeyField = inputDescriptor.getCacheKeyField();
this.cacheLastDedupEnabled = inputDescriptor.getCacheLastDedupEnabled();
@@ -126,10 +122,6 @@ public abstract class LSServerInput {
return useEventMd5AsId;
}
- public String getStartPosition() {
- return startPosition;
- }
-
public Boolean getCacheEnabled() {
return cacheEnabled;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
index 3147402..dcb0393 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerMapDate.java
@@ -34,7 +34,7 @@ public class LSServerMapDate extends LSServerMapField {
return "map_date";
}
- @JsonProperty("source_date_pattern")
+ @JsonProperty("src_date_pattern")
private String sourceDatePattern;
@NotNull
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/global.config.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/global.config.json b/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/global.config.json
index 7ac29dd..65da726 100644
--- a/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/global.config.json
+++ b/ambari-logsearch/docker/test-config/logfeeder/shipper-conf/global.config.json
@@ -5,7 +5,6 @@
},
"source":"file",
"tail":"true",
- "gen_event_md5":"true",
- "start_position":"beginning"
+ "gen_event_md5":"true"
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0d970b5/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
index f337527..1b63e2a 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
@@ -22,7 +22,6 @@
},
"source":"file",
"tail":"true",
- "gen_event_md5":"true",
- "start_position":"beginning"
+ "gen_event_md5":"true"
}
}
\ No newline at end of file
[11/17] ambari git commit: AMBARI-21141 Web Client Is Using the Wrong
Recommendations Endpoint When Adding a Service. (atkach)
Posted by jo...@apache.org.
AMBARI-21141 Web Client Is Using the Wrong Recommendations Endpoint When Adding a Service. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/64238cb9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/64238cb9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/64238cb9
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 64238cb9162f5098d2bafaa79999606f6c7abac3
Parents: 93130e6
Author: Andrii Tkach <at...@apache.org>
Authored: Mon May 29 17:50:50 2017 +0300
Committer: Andrii Tkach <at...@apache.org>
Committed: Mon May 29 20:24:25 2017 +0300
----------------------------------------------------------------------
ambari-web/app/utils/ajax/ajax.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/64238cb9/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index f7d0914..86c91e8 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1353,7 +1353,7 @@ var urls = {
}
},
'cluster.load_cluster_name': {
- 'real': '/clusters?fields=Clusters/security_type',
+ 'real': '/clusters?fields=Clusters/security_type,Clusters/version',
'mock': '/data/clusters/info.json'
},
'cluster.load_last_upgrade': {
[07/17] ambari git commit: Ambari 2.5.1 website updates.
Posted by jo...@apache.org.
Ambari 2.5.1 website updates.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/617a6b4a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/617a6b4a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/617a6b4a
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 617a6b4a9bbd59bff3bcab17c466f4871ada8f6a
Parents: 9ff0a78
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Fri May 26 12:45:33 2017 -0700
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Fri May 26 12:45:33 2017 -0700
----------------------------------------------------------------------
docs/pom.xml | 2 +-
docs/src/site/apt/index.apt | 2 +-
docs/src/site/apt/whats-new.apt | 4 ++--
docs/src/site/site.xml | 4 ++++
4 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/617a6b4a/docs/pom.xml
----------------------------------------------------------------------
diff --git a/docs/pom.xml b/docs/pom.xml
index 6553c83..a9c48d6 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -28,7 +28,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.ambari</groupId>
- <version>2.5.0</version>
+ <version>2.5.1</version>
<artifactId>ambari</artifactId>
<packaging>pom</packaging>
http://git-wip-us.apache.org/repos/asf/ambari/blob/617a6b4a/docs/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/docs/src/site/apt/index.apt b/docs/src/site/apt/index.apt
index 030716b..1f19eb0 100644
--- a/docs/src/site/apt/index.apt
+++ b/docs/src/site/apt/index.apt
@@ -52,7 +52,7 @@ Introduction
Getting Started with Ambari
- Follow the {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.0} installation guide for Ambari 2.5.0}}.
+ Follow the {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.1} installation guide for Ambari 2.5.1}}.
Note: Ambari currently supports the 64-bit version of the following Operating Systems:
http://git-wip-us.apache.org/repos/asf/ambari/blob/617a6b4a/docs/src/site/apt/whats-new.apt
----------------------------------------------------------------------
diff --git a/docs/src/site/apt/whats-new.apt b/docs/src/site/apt/whats-new.apt
index 973f0b9..34db432 100644
--- a/docs/src/site/apt/whats-new.apt
+++ b/docs/src/site/apt/whats-new.apt
@@ -16,7 +16,7 @@
What's New with Ambari?
- * The latest release of Ambari is Ambari 2.5.0.
+ * The latest release of Ambari is Ambari 2.5.1.
* Ambari 2.5.0 added the following features:
@@ -49,7 +49,7 @@ JIRA
User Guide
- Take a look at {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.0} how to install a Hadoop cluster using Ambari 2.5.0}}.
+ Take a look at {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.1} how to install a Hadoop cluster using Ambari 2.5.1}}.
Stay Tuned
http://git-wip-us.apache.org/repos/asf/ambari/blob/617a6b4a/docs/src/site/site.xml
----------------------------------------------------------------------
diff --git a/docs/src/site/site.xml b/docs/src/site/site.xml
index 7b85c0b..db45a35 100644
--- a/docs/src/site/site.xml
+++ b/docs/src/site/site.xml
@@ -107,7 +107,9 @@
<item name="Quick Start Guide" href="https://cwiki.apache.org/confluence/display/AMBARI/Quick+Start+Guide"/>
<item name="Features + Roadmap" href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30755705"/>
<item name="API Reference" href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md"/>
+ <item name="Install Guide for 2.5.1" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.1"/>
<item name="Install Guide for 2.5.0" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.0"/>
+ <item name="Install Guide for 2.4.2" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.3"/>
<item name="Install Guide for 2.4.2" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.2"/>
<item name="Install Guide for 2.4.1" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.1"/>
<item name="Install Guide for 2.4.0" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.0"/>
@@ -139,7 +141,9 @@
</menu>
<menu name="Releases">
+ <item name="2.5.1" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.5.1"/>
<item name="2.5.0" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.5.0"/>
+ <item name="2.4.3" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.4.3"/>
<item name="2.4.2" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.4.2"/>
<item name="2.4.1" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.4.1"/>
<item name="2.4.0" href="http://archive.apache.org/dist/ambari/ambari-2.4.0"/>
[09/17] ambari git commit: AMBARI-21133. Configure Ambari Identity
fails with "Cannot run program: ambari-sudo.sh" on Ubuntu
Posted by jo...@apache.org.
AMBARI-21133. Configure Ambari Identity fails with "Cannot run program: ambari-sudo.sh" on Ubuntu
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9f5f7656
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9f5f7656
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9f5f7656
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 9f5f7656c18f722df175dc54cdf6aafdca940ee9
Parents: 7c1cb60
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Fri May 26 16:36:04 2017 +0200
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Mon May 29 07:59:01 2017 +0200
----------------------------------------------------------------------
ambari-server/conf/unix/ambari-env.sh | 2 +-
ambari-server/src/main/python/ambari_server_main.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9f5f7656/ambari-server/conf/unix/ambari-env.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari-env.sh b/ambari-server/conf/unix/ambari-env.sh
index 33912b6..7c91c85 100644
--- a/ambari-server/conf/unix/ambari-env.sh
+++ b/ambari-server/conf/unix/ambari-env.sh
@@ -15,7 +15,7 @@
AMBARI_PASSHPHRASE="DEV"
-export AMBARI_JVM_ARGS=$AMBARI_JVM_ARGS' -Xms512m -Xmx2048m -XX:MaxPermSize=128m -Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false'
+export AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS -Xms512m -Xmx2048m -XX:MaxPermSize=128m -Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf -Djava.security.krb5.conf=/etc/krb5.conf -Djavax.security.auth.useSubjectCredsOnly=false"
export PATH=$PATH:$ROOT/var/lib/ambari-server
export PYTHONPATH=$PYTHONPATH:$ROOT/usr/lib/python2.6/site-packages
http://git-wip-us.apache.org/repos/asf/ambari/blob/9f5f7656/ambari-server/src/main/python/ambari_server_main.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server_main.py b/ambari-server/src/main/python/ambari_server_main.py
index bf4f6d3..de8f317 100644
--- a/ambari-server/src/main/python/ambari_server_main.py
+++ b/ambari-server/src/main/python/ambari_server_main.py
@@ -184,7 +184,7 @@ def generate_child_process_param_list(ambari_user, java_exe, class_path,
# from subprocess, we have to skip --login option of su command. That's why
# we change dir to / (otherwise subprocess can face with 'permission denied'
# errors while trying to list current directory
- cmd = "{ulimit_cmd} ; {su} {ambari_user} -s {sh_shell} -c 'source {ambari_env_file} ; {command}'".format(ulimit_cmd=ulimit_cmd,
+ cmd = "{ulimit_cmd} ; {su} {ambari_user} -s {sh_shell} -c '. {ambari_env_file} && {command}'".format(ulimit_cmd=ulimit_cmd,
su=locate_file('su', '/bin'), ambari_user=ambari_user,
sh_shell=locate_file('sh', '/bin'), command=command,
ambari_env_file=AMBARI_ENV_FILE)
[17/17] ambari git commit: Merge branch 'trunk' into
branch-feature-AMBARI-12556
Posted by jo...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-12556
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/138aa48f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/138aa48f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/138aa48f
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 138aa48f5f6e21ab7c7ec0636fe12e71a88281b0
Parents: 2892aee 753f8aa
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Wed May 31 10:31:40 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Wed May 31 10:37:02 2017 -0400
----------------------------------------------------------------------
.../ambari-logsearch-appender/pom.xml | 3 +-
.../api/model/inputconfig/InputDescriptor.java | 2 -
.../inputconfig/impl/InputDescriptorImpl.java | 12 -
.../inputconfig/impl/MapDateDescriptorImpl.java | 2 +-
.../impl/MapFieldNameDescriptorImpl.java | 4 +-
.../logsearch/steps/LogSearchApiSteps.java | 6 +-
.../ambari-logsearch-logfeeder/README.md | 28 +-
.../ambari-logsearch-logfeeder/docs/filter.md | 59 ++++
.../ambari-logsearch-logfeeder/docs/input.md | 63 ++++
.../docs/inputConfig.md | 29 ++
.../docs/postMapValues.md | 61 ++++
.../ambari-logsearch-logfeeder/pom.xml | 2 -
.../logfeeder/input/AbstractInputFile.java | 9 +-
.../ambari/logfeeder/mapper/MapperDate.java | 2 +-
.../src/main/resources/log4j.xml | 3 +-
.../ambari/logfeeder/input/InputFileTest.java | 1 -
.../resources/samples/config/config_audit.json | 339 +++++++++----------
.../samples/config/config_service.json | 79 +++--
.../ambari-logsearch-server/pom.xml | 2 -
.../AbstractLogRequestFacetQueryConverter.java | 2 +
.../handler/ListCollectionHandler.java | 1 +
.../logsearch/manager/AuditLogsManager.java | 11 +-
.../ambari/logsearch/manager/ManagerBase.java | 5 +-
.../logsearch/manager/ServiceLogsManager.java | 62 ++--
.../logsearch/manager/ShipperConfigManager.java | 10 +-
.../model/common/LSServerConditions.java | 7 +
.../logsearch/model/common/LSServerFields.java | 6 +
.../logsearch/model/common/LSServerFilter.java | 27 +-
.../common/LSServerFilterDeserializer.java | 60 ++++
.../model/common/LSServerFilterGrok.java | 6 +
.../model/common/LSServerFilterJson.java | 2 +
.../model/common/LSServerFilterKeyValue.java | 2 +
.../logsearch/model/common/LSServerInput.java | 43 ++-
.../model/common/LSServerInputConfig.java | 13 +
.../model/common/LSServerInputDeserializer.java | 62 ++++
.../model/common/LSServerInputFile.java | 2 +
.../model/common/LSServerInputFileBase.java | 2 +
.../model/common/LSServerInputS3File.java | 6 +
.../model/common/LSServerLogLevelFilter.java | 24 +-
.../model/common/LSServerLogLevelFilterMap.java | 5 +
.../logsearch/model/common/LSServerMapDate.java | 7 +-
.../model/common/LSServerMapFieldCopy.java | 5 +
.../model/common/LSServerMapFieldName.java | 5 +
.../model/common/LSServerMapFieldValue.java | 6 +
.../model/common/LSServerPostMapValues.java | 34 +-
.../model/common/LSServerPostMapValuesList.java | 59 ++++
.../LSServerPostMapValuesListDeserializer.java | 79 +++++
.../LSServerPostMapValuesListSerializer.java | 44 +++
.../common/LSServerPostMapValuesSerializer.java | 39 ---
.../logsearch/rest/ShipperConfigResource.java | 19 +-
.../LogsearchAuthSuccessHandler.java | 4 -
.../web/filters/LogsearchKrbFilter.java | 62 ++--
.../web/model/JWTAuthenticationToken.java | 2 +-
.../src/main/resources/log4j.xml | 158 +++++----
.../logfeeder/shipper-conf/global.config.json | 5 +-
ambari-server/conf/unix/ambari-env.sh | 2 +-
.../server/upgrade/UpgradeCatalog300.java | 19 ++
.../src/main/python/ambari_server_main.py | 2 +-
.../package/templates/global.config.json.j2 | 3 +-
.../0.5.0/properties/logfeeder-log4j.xml.j2 | 2 +-
.../0.5.0/properties/logsearch-log4j.xml.j2 | 2 +-
.../scripts/alerts/alert_spark_thrift_port.py | 5 +-
.../scripts/alerts/alert_spark2_thrift_port.py | 5 +-
.../STORM/1.1.0/configuration/storm-site.xml | 36 +-
.../common-services/STORM/1.1.0/kerberos.json | 6 +-
.../HDP/2.0.6/properties/stack_features.json | 6 +-
.../services/STORM/configuration/storm-site.xml | 61 ++++
.../stacks/HDP/2.6/services/STORM/metainfo.xml | 6 +-
.../server/upgrade/UpgradeCatalog300Test.java | 33 ++
.../app/controllers/wizard/step7_controller.js | 3 +
.../app/controllers/wizard/step8_controller.js | 11 +
ambari-web/app/messages.js | 1 +
ambari-web/app/templates/wizard/step8.hbs | 2 +-
ambari-web/app/utils/ajax/ajax.js | 2 +-
docs/pom.xml | 2 +-
docs/src/site/apt/index.apt | 2 +-
docs/src/site/apt/whats-new.apt | 4 +-
docs/src/site/site.xml | 4 +
78 files changed, 1267 insertions(+), 544 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/138aa48f/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
----------------------------------------------------------------------
diff --cc ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
index 43707dd,dbc77af..782cf2c
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog300Test.java
@@@ -322,9 -321,35 +322,35 @@@ public class UpgradeCatalog300Test
expect(cluster.getDesiredConfigByType("logsearch-properties")).andReturn(logSearchPropertiesConf).times(2);
expect(logSearchPropertiesConf.getProperties()).andReturn(oldLogSearchProperties).times(2);
Capture<Map<String, String>> logSearchPropertiesCapture = EasyMock.newCapture();
- expect(controller.createConfig(anyObject(Cluster.class), eq("logsearch-properties"), capture(logSearchPropertiesCapture),
+ expect(controller.createConfig(anyObject(Cluster.class), anyObject(StackId.class), eq("logsearch-properties"), capture(logSearchPropertiesCapture),
anyString(), EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once();
+ Map<String, String> oldLogFeederLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">");
+
+ Map<String, String> expectedLogFeederLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd\">");
+
+ Config mockLogFeederLog4j = easyMockSupport.createNiceMock(Config.class);
+ expect(cluster.getDesiredConfigByType("logfeeder-log4j")).andReturn(mockLogFeederLog4j).atLeastOnce();
+ expect(mockLogFeederLog4j.getProperties()).andReturn(oldLogFeederLog4j).anyTimes();
+ Capture<Map<String, String>> logFeederLog4jCapture = EasyMock.newCapture();
- expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(logFeederLog4jCapture), anyString(),
++ expect(controller.createConfig(anyObject(Cluster.class), anyObject(StackId.class), anyString(), capture(logFeederLog4jCapture), anyString(),
+ EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once();
+
+ Map<String, String> oldLogSearchLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">");
+
+ Map<String, String> expectedLogSearchLog4j = ImmutableMap.of(
+ "content", "<!DOCTYPE log4j:configuration SYSTEM \"http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd\">");
+
+ Config mockLogSearchLog4j = easyMockSupport.createNiceMock(Config.class);
+ expect(cluster.getDesiredConfigByType("logsearch-log4j")).andReturn(mockLogSearchLog4j).atLeastOnce();
+ expect(mockLogSearchLog4j.getProperties()).andReturn(oldLogSearchLog4j).anyTimes();
+ Capture<Map<String, String>> logSearchLog4jCapture = EasyMock.newCapture();
- expect(controller.createConfig(anyObject(Cluster.class), anyString(), capture(logSearchLog4jCapture), anyString(),
++ expect(controller.createConfig(anyObject(Cluster.class), anyObject(StackId.class), anyString(), capture(logSearchLog4jCapture), anyString(),
+ EasyMock.<Map<String, Map<String, String>>>anyObject())).andReturn(config).once();
+
replay(clusters, cluster);
replay(controller, injector2);
replay(confSomethingElse1, confSomethingElse2, confLogSearchConf1, confLogSearchConf2);
@@@ -337,11 -363,17 +364,17 @@@
for (Map<String, String> updatedLogSearchConf : updatedLogSearchConfs) {
assertTrue(Maps.difference(Collections.<String, String> emptyMap(), updatedLogSearchConf).areEqual());
}
-
+
Map<String,String> newLogFeederProperties = logFeederPropertiesCapture.getValue();
assertTrue(Maps.difference(expectedLogFeederProperties, newLogFeederProperties).areEqual());
-
+
Map<String,String> newLogSearchProperties = logSearchPropertiesCapture.getValue();
assertTrue(Maps.difference(Collections.<String, String> emptyMap(), newLogSearchProperties).areEqual());
+
+ Map<String, String> updatedLogFeederLog4j = logFeederLog4jCapture.getValue();
+ assertTrue(Maps.difference(expectedLogFeederLog4j, updatedLogFeederLog4j).areEqual());
+
+ Map<String, String> updatedLogSearchLog4j = logSearchLog4jCapture.getValue();
+ assertTrue(Maps.difference(expectedLogSearchLog4j, updatedLogSearchLog4j).areEqual());
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/138aa48f/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/138aa48f/ambari-web/app/messages.js
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/138aa48f/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
[04/17] ambari git commit: AMBARI-21118. HDP + HDF cluster cannot
save configs for Storm when Streamline is installed due to missing configs
(alejandro)
Posted by jo...@apache.org.
AMBARI-21118. HDP + HDF cluster cannot save configs for Storm when Streamline is installed due to missing configs (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f7c04148
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f7c04148
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f7c04148
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: f7c04148c1214277cf39479d9a0306850c034ef9
Parents: a4482bb
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu May 25 17:24:05 2017 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu May 25 17:24:05 2017 -0700
----------------------------------------------------------------------
.../STORM/1.1.0/configuration/storm-site.xml | 36 +++++++++++---------
.../stacks/HDP/2.6/services/STORM/metainfo.xml | 6 +++-
2 files changed, 25 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7c04148/ambari-server/src/main/resources/common-services/STORM/1.1.0/configuration/storm-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/1.1.0/configuration/storm-site.xml b/ambari-server/src/main/resources/common-services/STORM/1.1.0/configuration/storm-site.xml
index 1a5dde9..b2e9acb 100644
--- a/ambari-server/src/main/resources/common-services/STORM/1.1.0/configuration/storm-site.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/1.1.0/configuration/storm-site.xml
@@ -21,24 +21,28 @@
-->
<configuration supports_final="true">
<property>
- <name>nimbus.autocredential.plugins.classes</name>
+ <name>nimbus.impersonation.acl</name>
<description>
- Allows users to add token based authentication for services such as HDFS, HBase, Hive
- </description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>nimbus.credential.renewers.freq.secs</name>
- <description>
- Frequency at which tokens will be renewed.
- </description>
- <on-ambari-upgrade add="false"/>
- </property>
- <property>
- <name>nimbus.credential.renewers.classes</name>
- <description>
- List of classes for token renewal
+ The ImpersonationAuthorizer uses nimbus.impersonation.acl as the acl to authorize users. Following is a sample nimbus config for supporting impersonation:
+ nimbus.impersonation.acl:
+ impersonating_user1:
+ hosts:
+ [comma separated list of hosts from which impersonating_user1 is allowed to impersonate other users]
+ groups:
+ [comma separated list of groups whose users impersonating_user1 is allowed to impersonate]
+ impersonating_user2:
+ hosts:
+ [comma separated list of hosts from which impersonating_user2 is allowed to impersonate other users]
+ groups:
+ [comma separated list of groups whose users impersonating_user2 is allowed to impersonate]
</description>
+ <!-- The depends-on section is new in this version, required so Stack Advisor can include streamline-env and streamline-common configs. -->
+ <depends-on>
+ <property>
+ <type>streamline-env</type>
+ <name>streamline_principal_name</name>
+ </property>
+ </depends-on>
<on-ambari-upgrade add="false"/>
</property>
</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7c04148/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
index 49e00f7..747d951 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml
@@ -23,9 +23,13 @@
<name>STORM</name>
<version>1.1.0</version>
<extends>common-services/STORM/1.1.0</extends>
+
<configuration-dependencies>
- <config-type>application-properties</config-type>
+ <!-- From Streamline. -->
+ <config-type>streamline-env</config-type>
+ <config-type>streamline-common</config-type>
</configuration-dependencies>
+
</service>
</services>
</metainfo>
[08/17] ambari git commit: AMBARI-21136. Upgrading Ambari to 2.5.1
stops Storm's nimbus in secure moded. (Sriharsha Chintalapani via rlevas)
Posted by jo...@apache.org.
AMBARI-21136. Upgrading Ambari to 2.5.1 stops Storm's nimbus in secure moded. (Sriharsha Chintalapani via rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7c1cb60b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7c1cb60b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7c1cb60b
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 7c1cb60bcd4cfd027bf66b640f6e3425cff1b555
Parents: 617a6b4
Author: Sriharsha Chintalapani <ha...@hortonworks.com>
Authored: Fri May 26 16:37:10 2017 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Fri May 26 16:37:10 2017 -0400
----------------------------------------------------------------------
.../main/resources/common-services/STORM/1.1.0/kerberos.json | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7c1cb60b/ambari-server/src/main/resources/common-services/STORM/1.1.0/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/1.1.0/kerberos.json b/ambari-server/src/main/resources/common-services/STORM/1.1.0/kerberos.json
index 643cfd3..a034411 100644
--- a/ambari-server/src/main/resources/common-services/STORM/1.1.0/kerberos.json
+++ b/ambari-server/src/main/resources/common-services/STORM/1.1.0/kerberos.json
@@ -53,11 +53,7 @@
"nimbus.impersonation.acl": "{ {{storm_bare_jaas_principal}} : {hosts: ['*'], groups: ['*']}}",
"nimbus.admins": "['{{storm_bare_jaas_principal}}', '{{ambari_bare_jaas_principal}}']",
"nimbus.supervisor.users": "['{{storm_bare_jaas_principal}}']",
- "ui.filter.params": "{'type': 'kerberos', 'kerberos.principal': '{{storm_ui_jaas_principal}}', 'kerberos.keytab': '{{storm_ui_keytab_path}}', 'kerberos.name.rules': 'DEFAULT'}",
- "nimbus.autocredential.plugins.classes": "['org.apache.storm.hdfs.security.AutoHDFS', 'org.apache.storm.hbase.security.AutoHBase', 'org.apache.storm.hive.security.AutoHive']",
- "nimbus.credential.renewers.classes": "['org.apache.storm.hdfs.security.AutoHDFS', 'org.apache.storm.hbase.security.AutoHBase', 'org.apache.storm.hive.security.AutoHive']",
- "nimbus.credential.renewers.freq.secs": 82800
-
+ "ui.filter.params": "{'type': 'kerberos', 'kerberos.principal': '{{storm_ui_jaas_principal}}', 'kerberos.keytab': '{{storm_ui_keytab_path}}', 'kerberos.name.rules': 'DEFAULT'}"
}
},
{
[02/17] ambari git commit: AMBARI-21125. Ambari STS2 checker should
use principal in secure cluster (Mingjie Tang via rlevas)
Posted by jo...@apache.org.
AMBARI-21125. Ambari STS2 checker should use principal in secure cluster (Mingjie Tang via rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ad6a78ee
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ad6a78ee
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ad6a78ee
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: ad6a78eeed591cf5b6ea481161194c05eaa5e4b7
Parents: 1e3d64b
Author: Mingjie Tang <mt...@hortonworks.com>
Authored: Thu May 25 15:59:49 2017 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Thu May 25 15:59:49 2017 -0400
----------------------------------------------------------------------
.../1.2.1/package/scripts/alerts/alert_spark_thrift_port.py | 5 ++++-
.../2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ad6a78ee/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
index 503360e..93a2de8 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
@@ -128,7 +128,10 @@ def execute(configurations={}, parameters={}, host_name=None):
if host_name is None:
host_name = socket.getfqdn()
- beeline_url = ['jdbc:hive2://{host_name}:{port}/', "transportMode={transport_mode}"]
+ if security_enabled:
+ beeline_url = ["'jdbc:hive2://{host_name}:{port}/default;principal={hive_principal}'","transportMode={transport_mode}"]
+ else:
+ beeline_url = ["'jdbc:hive2://{host_name}:{port}/default'","transportMode={transport_mode}"]
# append url according to used transport
beeline_cmd = os.path.join(spark_home, "bin", "beeline")
http://git-wip-us.apache.org/repos/asf/ambari/blob/ad6a78ee/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
index 12d2cda..1ce4aca 100644
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
@@ -129,7 +129,10 @@ def execute(configurations={}, parameters={}, host_name=None):
if host_name is None:
host_name = socket.getfqdn()
- beeline_url = ['jdbc:hive2://{host_name}:{port}/', "transportMode={transport_mode}"]
+ if security_enabled:
+ beeline_url = ["'jdbc:hive2://{host_name}:{port}/default;principal={hive_principal}'","transportMode={transport_mode}"]
+ else:
+ beeline_url = ["'jdbc:hive2://{host_name}:{port}/default'","transportMode={transport_mode}"]
# append url according to used transport
beeline_cmd = os.path.join(spark_home, "bin", "beeline")
[05/17] ambari git commit: AMBARI-21131: Add NIFI JAAS Config
StackFeatures to HDP StackFeatures (jluniya)
Posted by jo...@apache.org.
AMBARI-21131: Add NIFI JAAS Config StackFeatures to HDP StackFeatures (jluniya)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/145a8029
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/145a8029
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/145a8029
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 145a80294706f22914c043ebbb8a8d0b5d7d52ee
Parents: f7c0414
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Thu May 25 17:51:16 2017 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Thu May 25 17:51:16 2017 -0700
----------------------------------------------------------------------
.../resources/stacks/HDP/2.0.6/properties/stack_features.json | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/145a8029/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
index 78f7b9f..878645b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
@@ -417,7 +417,11 @@
"name": "tls_toolkit_san",
"description": "Support subject alternative name flag",
"min_version": "2.6.0.0"
+ },
+ {
+ "name": "nifi_jaas_conf_create",
+ "description": "Create NIFI jaas configuration when kerberos is enabled",
+ "min_version": "2.6.0.0"
}
-
]
}
[06/17] ambari git commit: AMBARI-21094 - Customize services shows
inconsistent config-groups after clicking on Back (Amruta Borkar via
sangeetar)
Posted by jo...@apache.org.
AMBARI-21094 - Customize services shows inconsistent config-groups after clicking on Back (Amruta Borkar via sangeetar)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9ff0a785
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9ff0a785
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9ff0a785
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 9ff0a785235ce9c70ca265d3d02edce2dea7f6ea
Parents: 145a802
Author: Sangeeta Ravindran <sa...@apache.org>
Authored: Fri May 26 11:37:47 2017 -0700
Committer: Sangeeta Ravindran <sa...@apache.org>
Committed: Fri May 26 11:37:47 2017 -0700
----------------------------------------------------------------------
ambari-web/app/controllers/wizard/step7_controller.js | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9ff0a785/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 6685c01..9a897d0 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -307,6 +307,9 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
isRecommendedLoaded: false,
initialRecommendations: []
});
+ App.ServiceConfigGroup.find().filterProperty('isDefault', false).forEach(function (record) {
+ App.configGroupsMapper.deleteRecord(record);
+ });
this.get('stepConfigs').clear();
this.set('filter', '');
this.get('filterColumns').setEach('selected', false);
[03/17] ambari git commit: AMBARI-21104 - Add Confirmation pop up for
'Generate Blueprint' button (Amruta Borkar via sangeetar)
Posted by jo...@apache.org.
AMBARI-21104 - Add Confirmation pop up for 'Generate Blueprint' button (Amruta Borkar via sangeetar)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a4482bba
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a4482bba
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a4482bba
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: a4482bba2c7f0d1bb3dfb79df45cd01909dd35ee
Parents: ad6a78e
Author: Sangeeta Ravindran <sa...@apache.org>
Authored: Thu May 25 14:04:09 2017 -0700
Committer: Sangeeta Ravindran <sa...@apache.org>
Committed: Thu May 25 14:04:09 2017 -0700
----------------------------------------------------------------------
ambari-web/app/controllers/wizard/step8_controller.js | 11 +++++++++++
ambari-web/app/messages.js | 1 +
ambari-web/app/templates/wizard/step8.hbs | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a4482bba/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index f2b4ca7..5fbd45d 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1851,6 +1851,17 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
});
},
+ /**
+ * Confirmation popup before generate blueprint
+ */
+ generateBlueprintConfirmation: function () {
+ var self = this;
+ return App.showConfirmationPopup(function () {
+ self.generateBlueprint();
+ }, Em.I18n.t('installer.step8.generateBlueprint.popup.msg').format(App.clusterStatus.clusterName)
+ );
+ },
+
generateBlueprint: function () {
console.log("Prepare blueprint for download...");
var blueprint = {};
http://git-wip-us.apache.org/repos/asf/ambari/blob/a4482bba/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 0c15a19..09a2c0e 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -971,6 +971,7 @@ Em.I18n.translations = {
'installer.step8.header': 'Review',
'installer.step8.body': 'Please review the configuration before installation',
'installer.step8.kerberors.warning': '<strong>Because Kerberos has been manually installed on the cluster, you will have to create/distribute principals and keytabs when this operation is finished.</strong>',
+ 'installer.step8.generateBlueprint.popup.msg': 'You will be <b>downloading</b> blueprint.json and clustertemplate.json to your local machine. <br/><br/> You can use them to deploy a cluster via AMBARI REST API. <br/> Update clustertemplate.json with a custom cluster name if you do not want to use name <b>{0}</b>. <br/><br/>If you want to use custom repo URLs, make sure to update them via Ambari REST API before deploying the cluster.',
'installer.step8.deployPopup.message':'Preparing to Deploy: {0} of {1} tasks completed.',
'installer.step8.hosts':' hosts',
'installer.step8.host':' host',
http://git-wip-us.apache.org/repos/asf/ambari/blob/a4482bba/ambari-web/app/templates/wizard/step8.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step8.hbs b/ambari-web/app/templates/wizard/step8.hbs
index 907b3d4..e210896 100644
--- a/ambari-web/app/templates/wizard/step8.hbs
+++ b/ambari-web/app/templates/wizard/step8.hbs
@@ -100,7 +100,7 @@
<button type="button" class="btn btn-info pull-right" {{action printReview target="view"}}>{{t common.print}}</button>
<button type="button" {{bindAttr class=":btn :btn-primary :pull-right :mrm controller.showDownloadCsv::hide"}} {{action downloadCSV target="controller"}}>{{t admin.kerberos.wizard.step5.downloadCSV}}</button>
{{#unless App.router.clusterInstallCompleted}}
- <button type="button" class="btn btn-success pull-right" {{action generateBlueprint target="controller"}}><i class="glyphicon glyphicon-download-alt"></i>
+ <button type="button" class="btn btn-success pull-right" {{action generateBlueprintConfirmation target="controller"}}><i class="glyphicon glyphicon-download-alt"></i>
{{t common.generate.blueprint}}
</button>
{{/unless}}
[12/17] ambari git commit: AMBARI-21119 ADDENDUM Log Search REST API
validate input configurations and log level filters (mgergely)
Posted by jo...@apache.org.
AMBARI-21119 ADDENDUM Log Search REST API validate input configurations and log level filters (mgergely)
Change-Id: Idf52271a2421410f0b7355f3d9bd695600d5b2fb
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5845d546
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5845d546
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5845d546
Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 5845d546392f199d425aee8a2418f791c21da3a5
Parents: 64238cb
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Mon May 29 22:36:38 2017 +0200
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Mon May 29 22:36:38 2017 +0200
----------------------------------------------------------------------
.../org/apache/ambari/logsearch/model/common/LSServerFilter.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/5845d546/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
index d99a77d..84bddb8 100644
--- a/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
+++ b/ambari-logsearch/ambari-logsearch-server/src/main/java/org/apache/ambari/logsearch/model/common/LSServerFilter.java
@@ -48,6 +48,7 @@ public abstract class LSServerFilter {
@JsonProperty("sort_order")
private Integer sortOrder;
+ @JsonProperty("source_field")
private String sourceField;
@JsonProperty("remove_source_field")