@@ -2,23 +2,42 @@ package edu.uci.ics.amber.operator.split
2
2
3
3
import com .fasterxml .jackson .annotation .{JsonProperty , JsonPropertyDescription }
4
4
import com .google .common .base .Preconditions
5
+ import com .kjetland .jackson .jsonSchema .annotations .{
6
+ JsonSchemaInject ,
7
+ JsonSchemaString ,
8
+ JsonSchemaTitle
9
+ }
5
10
import edu .uci .ics .amber .core .executor .OpExecWithClassName
6
11
import edu .uci .ics .amber .core .virtualidentity .{ExecutionIdentity , WorkflowIdentity }
7
12
import edu .uci .ics .amber .core .workflow ._
8
13
import edu .uci .ics .amber .operator .LogicalOp
14
+ import edu .uci .ics .amber .operator .metadata .annotations .HideAnnotation
9
15
import edu .uci .ics .amber .operator .metadata .{OperatorGroupConstants , OperatorInfo }
10
16
import edu .uci .ics .amber .util .JSONUtils .objectMapper
11
17
12
- import scala .util .Random
13
18
class SplitOpDesc extends LogicalOp {
14
19
15
- @ JsonProperty (value = " split percentage" , required = false , defaultValue = " 80" )
16
- @ JsonPropertyDescription (" percentage of data going to the upper port (default 80%)" )
20
+ @ JsonSchemaTitle (" Split Percentage" )
21
+ @ JsonProperty (defaultValue = " 80" )
22
+ @ JsonPropertyDescription (" percentage of data going to the upper port" )
17
23
var k : Int = 80
18
24
19
- @ JsonProperty (value = " random seed" , required = false )
20
- @ JsonPropertyDescription (" Random seed for split" )
21
- var seed : Int = Random .nextInt()
25
+ @ JsonSchemaTitle (" Auto-Generate Seed" )
26
+ @ JsonPropertyDescription (" Shuffle the data based on a random seed" )
27
+ @ JsonProperty (defaultValue = " true" )
28
+ var random : Boolean = true
29
+
30
+ @ JsonSchemaTitle (" Seed" )
31
+ @ JsonProperty (defaultValue = " 1" )
32
+ @ JsonPropertyDescription (" An int for reproducible output across multiple run" )
33
+ @ JsonSchemaInject (
34
+ strings = Array (
35
+ new JsonSchemaString (path = HideAnnotation .hideTarget, value = " random" ),
36
+ new JsonSchemaString (path = HideAnnotation .hideType, value = HideAnnotation .Type .equals),
37
+ new JsonSchemaString (path = HideAnnotation .hideExpectedValue, value = " true" )
38
+ )
39
+ )
40
+ var seed : Int = 1
22
41
23
42
override def getPhysicalOp (
24
43
workflowId : WorkflowIdentity ,
0 commit comments