Skip to content
Permalink
Browse files
AMBARI-24692. JDK 11 support for Log Search.
  • Loading branch information
oleewere committed Sep 26, 2018
1 parent 30b55e5 commit f6468c8fad122d6fe29652ad484d2db4383151dc
Show file tree
Hide file tree
Showing 202 changed files with 2,110 additions and 1,493 deletions.
@@ -2,7 +2,9 @@

Log aggregation, analysis, and visualization for Ambari managed (and any other) services.

## Setup local environment with docker
## Development

Requires JDK 11

### Prerequisites

@@ -32,8 +32,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<jar.finalName>ambari-logsearch-appender</jar.finalName>
</properties>

@@ -25,7 +25,7 @@
import org.apache.log4j.spi.LoggingEvent;

public class LogsearchRollingFileAppender extends RollingFileAppender {
private static Logger logger = Logger.getLogger(LogsearchRollingFileAppender.class);
private static final Logger logger = Logger.getLogger(LogsearchRollingFileAppender.class);

public LogsearchRollingFileAppender() {
logger.trace("Initializing LogsearchRollingFileAppender........... ");
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;

public class AppTest {
private static Logger logger = Logger.getLogger(AppTest.class);
private static final Logger logger = Logger.getLogger(AppTest.class);

public static void main(String[] args) {

@@ -41,9 +41,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.20</version>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
</dependencies>
</project>
@@ -18,15 +18,15 @@
*/
package org.apache.ambari.logsearch.config.api;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
* Used for connect a remote source periodically to get / set log level filters.
*/
public abstract class LogLevelFilterUpdater extends Thread {

private static final Logger LOG = LoggerFactory.getLogger(LogLevelFilterUpdater.class);
private static final Logger LOG = LogManager.getLogger(LogLevelFilterUpdater.class);

private final LogLevelFilterMonitor logLevelFilterMonitor;
private final int interval;
@@ -19,20 +19,20 @@

package org.apache.ambari.logsearch.config.api;

import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;

/**
* Factory class for LogSearchConfigServer and LogSearchConfigLogFeeder.
*/
public class LogSearchConfigFactory {
private static final Logger LOG = LoggerFactory.getLogger(LogSearchConfigFactory.class);
private static final Logger logger = LogManager.getLogger(LogSearchConfigFactory.class);

/**
* Creates a Log Search Configuration instance for the Log Search Server that implements
* {@link org.apache.ambari.logsearch.config.api.LogSearchConfigServer}.
* {@link LogSearchConfigServer}.
*
* @param properties The properties of the component for which the configuration is created. If the properties contain the
* "logsearch.config.class" entry than the class defined there would be used instead of the default class.
@@ -63,7 +63,7 @@ public static LogSearchConfigServer createLogSearchConfigServer(Map<String, Stri
}
return logSearchConfig;
} catch (Exception e) {
LOG.error("Could not initialize logsearch config.", e);
logger.error("Could not initialize logsearch config.", e);
throw e;
}
}
@@ -102,14 +102,14 @@ public static LogSearchConfigLogFeeder createLogSearchConfigLogFeeder(Map<String
}
return logSearchConfig;
} catch (Exception e) {
LOG.error("Could not initialize logsearch config.", e);
logger.error("Could not initialize logsearch config.", e);
throw e;
}
}

/**
* Creates a Log Search Configuration instance for the Log Search Server that implements
* {@link org.apache.ambari.logsearch.config.api.LogSearchConfigServer}.
* {@link LogSearchConfigServer}.
*
* @param properties The properties of the component for which the configuration is created. If the properties contain the
* "logsearch.config.class" entry than the class defined there would be used instead of the default class.
@@ -52,5 +52,5 @@ public interface LogSearchConfigLogFeeder extends LogSearchConfig {
* @throws Exception
*/
void monitorInputConfigChanges(InputConfigMonitor inputConfigMonitor, LogLevelFilterMonitor logLevelFilterMonitor,
String clusterName) throws Exception;
String clusterName) throws Exception;
}
@@ -20,6 +20,9 @@
package org.apache.ambari.logsearch.config.api.model.inputconfig;

public interface InputS3FileDescriptor extends InputFileBaseDescriptor {

String getS3Endpoint();

String getS3AccessKey();

String getS3SecretKey();

This file was deleted.

@@ -0,0 +1,23 @@
<?xml version="1.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.
-->
<Configuration>
<Loggers>
<Root level="fatal">
</Root>
</Loggers>
</Configuration>
@@ -50,11 +50,6 @@
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>