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

[CALCITE-3329] Implement osquery for OS adapter #3585

Closed
wants to merge 4 commits into from

Conversation

XuQianJin-Stars
Copy link
Contributor

@XuQianJin-Stars XuQianJin-Stars commented Dec 16, 2023

Fix ISSUE CALCITE-3329, Achieve similar features of FaceBook's osquery. E.g:

select * from os_version;
select * from system_info;
select * from mounts;
select * from interface_addresses
select * from memory_info;
select * from interface_addresses;
select * from cpu_info;
select * from cpu_time;
select * from java_info;

@XuQianJin-Stars XuQianJin-Stars force-pushed the CALCITE-3329 branch 3 times, most recently from adf185b to 94110de Compare December 17, 2023 07:04
FileSystem fileSystem = OshiUtil.getOs().getFileSystem();
List<OSFileStore> fileStores = fileSystem.getFileStores();
for (OSFileStore fileStore : fileStores) {
Object[] objects = new Object[8];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer

Object[] objects = {
   fileStore.getName(),
   fileStore.getName(),
   getNetFileSizeDescription(fileStore.getTotalSpace()),
    ...
};

Without explicit length and offset it is more maintainable.

@@ -64,6 +64,10 @@ public class SqlShell {
this.err = Objects.requireNonNull(err, "err");
}

public static void setModel(String newModel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really need to be mutable?

Could you achieve what you need with a withModel(String model) method?

Copy link

sonarcloud bot commented Dec 19, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

9 New issues
0 Security Hotspots
95.8% Coverage on New Code
13.7% Duplication on New Code

See analysis details on SonarCloud

julianhyde added a commit to julianhyde/calcite that referenced this pull request Dec 19, 2023
@asfgit asfgit closed this in 48b7922 Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants