Skip to content

Commit

Permalink
enable JSM and fix compilation warnings related to jackson
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhmaurya committed Oct 3, 2024
1 parent 25bf6c6 commit 51b870e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 66 deletions.
8 changes: 4 additions & 4 deletions libs/arrow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ dependencies {
}
runtimeOnly 'com.google.flatbuffers:flatbuffers-java:2.0.0'

runtimeOnly 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
runtimeOnly 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'
runtimeOnly 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
runtimeOnly 'com.fasterxml.jackson.core:jackson-annotations:2.17.2'
api 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
api 'com.fasterxml.jackson.core:jackson-annotations:2.17.2'

testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testImplementation "junit:junit:${versions.junit}"
Expand Down

This file was deleted.

24 changes: 0 additions & 24 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ plugins {
id('opensearch.internal-cluster-test')
id('opensearch.optional-dependencies')
id('me.champeau.gradle.japicmp') version '0.4.3'
id('com.github.johnrengelman.shadow')
}

publishing {
Expand Down Expand Up @@ -138,9 +137,6 @@ dependencies {
exclude group: 'org.opensearch', module: 'server'
}
}
tasks.withType(JavaCompile) {
options.compilerArgs.removeAll(['-Werror'])
}

tasks.withType(JavaCompile).configureEach {
options.compilerArgs -= '-Xlint:cast'
Expand All @@ -153,26 +149,6 @@ compileJava {
'org.opensearch.common.annotation.processor.ApiAnnotationProcessor'].join(',')]
}

//shadowJar {
// // Optional: set a classifier to differentiate the shadow JAR if needed
// archiveClassifier.set('all')
//
// // Relocate multiple Netty packages to avoid conflicts
// relocate 'io.netty.buffer', 'org.apache.arrow.shaded.io.netty.buffer'
// relocate 'io.netty.util', 'org.apache.arrow.shaded.io.netty.util'
// relocate 'io.netty.channel', 'org.apache.arrow.shaded.io.netty.channel'
// relocate 'io.netty.handler', 'org.apache.arrow.shaded.io.netty.handler'
//}
tasks.build {
dependsOn shadowJar
}
task listConfigurations {
doLast {
configurations.each { config ->
println config.name
}
}
}
tasks.named("internalClusterTest").configure {
// TODO: these run faster with C2 only because they run for so, so long
jvmArgs -= '-XX:TieredStopAtLevel=1'
Expand Down
20 changes: 10 additions & 10 deletions server/src/main/java/org/opensearch/bootstrap/Security.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,22 @@ static void configure(Environment environment, boolean filterBadDefaults) throws

// enable security policy: union of template and environment-based paths, and possibly plugin permissions
Map<String, URL> codebases = getCodebaseJarMap(JarHell.parseClassPath());
// Policy.setPolicy(
// new OpenSearchPolicy(
// codebases,
// createPermissions(environment),
// getPluginPermissions(environment),
// filterBadDefaults,
// createRecursiveDataPathPermission(environment)
// )
// );
Policy.setPolicy(
new OpenSearchPolicy(
codebases,
createPermissions(environment),
getPluginPermissions(environment),
filterBadDefaults,
createRecursiveDataPathPermission(environment)
)
);

// enable security manager
final String[] classesThatCanExit = new String[] {
// SecureSM matches class names as regular expressions so we escape the $ that arises from the nested class name
OpenSearchUncaughtExceptionHandler.PrivilegedHaltAction.class.getName().replace("$", "\\$"),
Command.class.getName() };
// System.setSecurityManager(new SecureSM(classesThatCanExit));
System.setSecurityManager(new SecureSM(classesThatCanExit));

// do some basic tests
selfTest();
Expand Down

0 comments on commit 51b870e

Please sign in to comment.