-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to support generic inputs and triggers in remote monitors
Signed-off-by: Subhobrata Dey <[email protected]>
- Loading branch information
Showing
9 changed files
with
287 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...lugin/src/main/java/org/opensearch/alerting/monitor/inputs/SampleRemoteMonitorInput1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.alerting.monitor.inputs; | ||
|
||
import org.opensearch.core.common.io.stream.StreamInput; | ||
import org.opensearch.core.common.io.stream.StreamOutput; | ||
import org.opensearch.core.common.io.stream.Writeable; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
public class SampleRemoteMonitorInput1 implements Writeable { | ||
|
||
private String a; | ||
|
||
private Map<String, Object> b; | ||
|
||
private int c; | ||
|
||
public SampleRemoteMonitorInput1(String a, Map<String, Object> b, int c) { | ||
this.a = a; | ||
this.b = b; | ||
this.c = c; | ||
} | ||
|
||
public SampleRemoteMonitorInput1(StreamInput sin) throws IOException { | ||
this( | ||
sin.readString(), | ||
sin.readMap(), | ||
sin.readInt() | ||
); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(a); | ||
out.writeMap(b); | ||
out.writeInt(c); | ||
} | ||
|
||
public int getC() { | ||
return c; | ||
} | ||
|
||
public Map<String, Object> getB() { | ||
return b; | ||
} | ||
|
||
public String getA() { | ||
return a; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...lugin/src/main/java/org/opensearch/alerting/monitor/inputs/SampleRemoteMonitorInput2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.alerting.monitor.inputs; | ||
|
||
import org.opensearch.commons.alerting.model.DocLevelMonitorInput; | ||
import org.opensearch.core.common.io.stream.StreamInput; | ||
import org.opensearch.core.common.io.stream.StreamOutput; | ||
import org.opensearch.core.common.io.stream.Writeable; | ||
|
||
import java.io.IOException; | ||
|
||
public class SampleRemoteMonitorInput2 implements Writeable { | ||
|
||
private String a; | ||
|
||
private DocLevelMonitorInput b; | ||
|
||
public SampleRemoteMonitorInput2(String a, DocLevelMonitorInput b) { | ||
this.a = a; | ||
this.b = b; | ||
} | ||
|
||
public SampleRemoteMonitorInput2(StreamInput sin) throws IOException { | ||
this( | ||
sin.readString(), | ||
DocLevelMonitorInput.readFrom(sin) | ||
); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(a); | ||
b.writeTo(out); | ||
} | ||
|
||
public String getA() { | ||
return a; | ||
} | ||
|
||
public DocLevelMonitorInput getB() { | ||
return b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.