Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new SysMonitor based on Oshi library #14359

Merged
merged 12 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ SOURCE/JAVA-CORE
This product contains lpad and rpad methods adapted from Apache Flink.
* processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java

This product contains SystemInfo methods adapted from oshi
* processing/src/main/java/org/apache/druid/java/util/metrics/OshiSysMonitor.java


MIT License
================================
Expand Down
2 changes: 1 addition & 1 deletion distribution/bin/check-licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def build_compatible_license_names():
compatible_licenses['MIT License'] = 'MIT License'
compatible_licenses['The MIT License (MIT)'] = 'MIT License'
compatible_licenses['Bouncy Castle Licence'] = 'MIT License'
compatible_licenses['SPDX-License-Identifier: MIT'] = 'MIT License'

compatible_licenses['The Go license'] = 'The Go license'

Expand Down Expand Up @@ -435,7 +436,6 @@ def check_licenses(license_yaml, dependency_reports_root):

license_yaml = args.license_yaml
dependency_reports_root = args.dependency_reports_root

check_licenses(license_yaml, dependency_reports_root)

except KeyboardInterrupt:
Expand Down
15 changes: 13 additions & 2 deletions licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ name: Java Native Access (JNA)
license_category: binary
module: java-core
license_name: Apache License version 2.0
version: 4.5.1
version: 5.13.0
libraries:
- net.java.dev.jna: jna

Expand Down Expand Up @@ -2341,6 +2341,17 @@ notices:

---

name: OSHI
license_category: binary
module: java-core
license_name: MIT License
version: 6.4.2
libraries:
- com.github.oshi: oshi-core
license_file_path: licenses/bin/oshi.MIT

---

name: JBoss Logging 3
license_category: binary
module: java-core
Expand Down Expand Up @@ -4914,7 +4925,7 @@ libraries:

name: net.java.dev.jna jna-platform
license_category: binary
version: 5.2.0
version: 5.13.0
module: druid-ranger-security
license_name: Apache License version 2.0
libraries:
Expand Down
21 changes: 21 additions & 0 deletions licenses/bin/oshi.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2010-2023 The OSHI Project Contributors: https://github.com/oshi/oshi/graphs/contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
<protobuf.version>3.21.7</protobuf.version>
<resilience4j.version>1.3.1</resilience4j.version>
<slf4j.version>1.7.36</slf4j.version>
<jna.version>5.13.0</jna.version>
<jna-platform.version>5.13.0</jna-platform.version>
<hadoop.compile.version>3.3.5</hadoop.compile.version>
<mockito.version>4.3.1</mockito.version>
<aws.sdk.version>1.12.317</aws.sdk.version>
Expand Down Expand Up @@ -882,7 +884,12 @@
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.5.1</version>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna-platform.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
6 changes: 6 additions & 0 deletions processing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<sigar.base.version>1.6.5</sigar.base.version>
<sigar.version>${sigar.base.version}.132</sigar.version>
<ipaddress.version>5.3.4</ipaddress.version>
<oshi.version>6.4.2</oshi.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -335,6 +336,11 @@
dependency are copied as resources. See maven-dependency-plugin configuration and <resources> below. -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>


<!-- Tests -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.druid.java.util.metrics;

import org.apache.druid.java.util.emitter.service.ServiceEmitter;

public class NoopOshiSysMonitor extends OshiSysMonitor
{
public NoopOshiSysMonitor()
{
super();
}

@Override
public boolean doMonitor(ServiceEmitter emitter)
{
return false;
}
}
Loading