Skip to content
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
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ buildscript {
dependencies {
classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}"
classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.5"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
configurations.all {
resolutionStrategy {
force("org.eclipse.platform:org.eclipse.core.runtime:3.29.0") // for spotless transitive dependency CVE (for 3.26.100)
Expand Down Expand Up @@ -97,6 +98,16 @@ subprojects {
resolutionStrategy.force "com.google.guava:guava:32.1.3-jre"
resolutionStrategy.force 'org.apache.commons:commons-compress:1.26.0'
}

apply plugin: 'com.diffplug.spotless'

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'
eclipse().configFile rootProject.file('.eclipseformat.xml')
}
}
}

ext {
Expand Down
10 changes: 0 additions & 10 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
id 'jacoco'
id 'io.github.goooler.shadow' version "8.1.7"
id 'maven-publish'
id 'com.diffplug.spotless' version '6.25.0'
id 'signing'
}

Expand All @@ -23,15 +22,6 @@ dependencies {

}

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}

jacocoTestReport {
reports {
xml.getRequired().set(true)
Expand Down
10 changes: 0 additions & 10 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
id 'io.github.goooler.shadow' version "8.1.7"
id 'jacoco'
id "io.freefair.lombok"
id 'com.diffplug.spotless' version '6.25.0'
id 'maven-publish'
id 'signing'
}
Expand Down Expand Up @@ -77,15 +76,6 @@ jacocoTestCoverageVerification {
}
check.dependsOn jacocoTestCoverageVerification

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}

shadowJar {
destinationDirectory = file("${project.buildDir}/distributions")
archiveClassifier.set(null)
Expand Down
10 changes: 0 additions & 10 deletions memory/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ plugins {
id 'java'
id 'jacoco'
id "io.freefair.lombok"
id 'com.diffplug.spotless' version '6.25.0'
}

dependencies {
Expand Down Expand Up @@ -81,12 +80,3 @@ jacocoTestCoverageVerification {
dependsOn jacocoTestReport
}
check.dependsOn jacocoTestCoverageVerification

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}
10 changes: 0 additions & 10 deletions ml-algorithms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ plugins {
id 'java-library'
id 'jacoco'
id "io.freefair.lombok"
id 'com.diffplug.spotless' version '6.25.0'
}

repositories {
Expand Down Expand Up @@ -136,12 +135,3 @@ jacocoTestCoverageVerification {
}
check.dependsOn jacocoTestCoverageVerification
compileJava.dependsOn(':opensearch-ml-common:shadowJar')

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}
10 changes: 0 additions & 10 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ plugins {
id "io.freefair.lombok"
id 'jacoco'
id 'java-library'
id 'com.diffplug.spotless' version '6.25.0'
}

ext {
Expand Down Expand Up @@ -482,15 +481,6 @@ afterEvaluate {
}
}

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}

tasks.withType(licenseHeaders.class) {
additionalLicense 'AL ', 'Apache', 'Licensed under the Apache License, Version 2.0 (the "License")'
}
Expand Down
10 changes: 0 additions & 10 deletions search-processors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ plugins {
id 'java'
id 'jacoco'
id "io.freefair.lombok"
id 'com.diffplug.spotless' version '6.25.0'
}

repositories {
Expand Down Expand Up @@ -74,12 +73,3 @@ jacocoTestCoverageVerification {
}

check.dependsOn jacocoTestCoverageVerification

spotless {
java {
removeUnusedImports()
importOrder 'java', 'javax', 'org', 'com'

eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/")).configFile rootProject.file('.eclipseformat.xml')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

package org.opensearch.ml.common.spi;

import org.opensearch.ml.common.spi.tools.Tool;

import java.util.List;

import org.opensearch.ml.common.spi.tools.Tool;

/**
* ml-commons extension interface.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

package org.opensearch.ml.common.spi.memory;

import org.opensearch.core.action.ActionListener;

import java.util.Map;

import org.opensearch.core.action.ActionListener;

/**
* A general memory interface.
* @param <T>
Expand All @@ -28,15 +28,18 @@ public interface Memory<T extends Message> {
*/
default void save(String id, T message) {}

default <S> void save(String id, T message, ActionListener<S> listener){}
default <S> void save(String id, T message, ActionListener<S> listener) {}

/**
* Get messages of memory id.
* @param id memory id
* @return
*/
default T[] getMessages(String id){return null;}
default void getMessages(String id, ActionListener<T> listener){}
default T[] getMessages(String id) {
return null;
}

default void getMessages(String id, ActionListener<T> listener) {}

/**
* Clear all memory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

package org.opensearch.ml.common.spi.tools;

import org.opensearch.core.action.ActionListener;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.opensearch.core.action.ActionListener;

/**
* General tool interface.
*/
Expand Down Expand Up @@ -68,7 +67,9 @@ public interface Tool {
String getDescription();

Map<String, Object> getAttributes();

void setAttributes(Map<String, Object> attributes);

/**
* Set tool description.
* @param description the description to set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

package org.opensearch.ml.common.spi.tools;


import java.util.List;

/**
Expand Down
Loading