Skip to content

Commit 2c854f4

Browse files
committed
addition of license
1 parent 878cfe0 commit 2c854f4

File tree

9 files changed

+162
-21
lines changed

9 files changed

+162
-21
lines changed

docker-compose.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
version: '3'
2+
services:
3+
cassandra:
4+
image: cassandra:3.11
5+
ports:
6+
- "9042:9042"
7+
prometheus:
8+
image: prom/prometheus:latest
9+
volumes:
10+
- ./prometheus:/etc/prometheus
11+
command:
12+
- '--config.file=/etc/prometheus/prometheus.yml'
13+
ports:
14+
- '9090:9090'
15+
node-exporter:
16+
image: prom/node-exporter
17+
ports:
18+
- '9100:9100'
19+
cadence:
20+
image: ubercadence/server:master-auto-setup
21+
ports:
22+
- "8000:8000"
23+
- "8001:8001"
24+
- "8002:8002"
25+
- "8003:8003"
26+
- "7933:7933"
27+
- "7934:7934"
28+
- "7935:7935"
29+
- "7939:7939"
30+
- "7833:7833"
31+
environment:
32+
- "CASSANDRA_SEEDS=cassandra"
33+
- "PROMETHEUS_ENDPOINT_0=0.0.0.0:8000"
34+
- "PROMETHEUS_ENDPOINT_1=0.0.0.0:8001"
35+
- "PROMETHEUS_ENDPOINT_2=0.0.0.0:8002"
36+
- "PROMETHEUS_ENDPOINT_3=0.0.0.0:8003"
37+
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
38+
depends_on:
39+
- cassandra
40+
- prometheus
41+
cadence-web:
42+
image: ubercadence/web:latest
43+
environment:
44+
- "CADENCE_TCHANNEL_PEERS=cadence:7933"
45+
ports:
46+
- "8088:8088"
47+
depends_on:
48+
- cadence
49+
grafana:
50+
image: grafana/grafana
51+
user: "1000"
52+
depends_on:
53+
- prometheus
54+
ports:
55+
- '3000:3000'

src/main/java/com/uber/cadence/samples/clientsamples/CadenceUtil.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import com.uber.cadence.serviceclient.WorkflowServiceTChannel;
2626

2727
public class CadenceUtil {
28-
public static WorkflowClient getWorkflowClient() {
29-
return WorkflowClient.newInstance(
30-
new WorkflowServiceTChannel(ClientOptions.defaultInstance()),
31-
WorkflowClientOptions.newBuilder().setDomain(DOMAIN).build());
32-
}
33-
}
28+
public static WorkflowClient getWorkflowClient() {
29+
return WorkflowClient.newInstance(
30+
new WorkflowServiceTChannel(ClientOptions.defaultInstance()),
31+
WorkflowClientOptions.newBuilder().setDomain(DOMAIN).build());
32+
}
33+
}

src/main/java/com/uber/cadence/samples/clientsamples/HelloWorldSample.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626
import java.time.Duration;
2727

2828
public class HelloWorldSample {
29-
public static void main(String[] args) {
30-
WorkflowClient workflowClient = CadenceUtil.getWorkflowClient();
31-
WorkflowOptions workflowOptions =
32-
new WorkflowOptions.Builder()
33-
.setExecutionStartToCloseTimeout(Duration.ofSeconds(30))
34-
.setTaskList(Constant.TASK_LIST)
35-
.build();
29+
public static void main(String[] args) {
30+
WorkflowClient workflowClient = CadenceUtil.getWorkflowClient();
31+
WorkflowOptions workflowOptions =
32+
new WorkflowOptions.Builder()
33+
.setExecutionStartToCloseTimeout(Duration.ofSeconds(30))
34+
.setTaskList(Constant.TASK_LIST)
35+
.build();
3636

37-
HelloWorldWorkflow helloWorldWorkflow =
38-
workflowClient.newWorkflowStub(HelloWorldWorkflow.class, workflowOptions);
39-
WorkflowExecution execution =
40-
WorkflowClient.start(helloWorldWorkflow::sayHello, new SampleMessage("Uber"));
41-
System.out.printf("WorkflowID: %s, RunID: %s", execution.getWorkflowId(), execution.getRunId());
42-
}
43-
}
37+
HelloWorldWorkflow helloWorldWorkflow =
38+
workflowClient.newWorkflowStub(HelloWorldWorkflow.class, workflowOptions);
39+
WorkflowExecution execution =
40+
WorkflowClient.start(helloWorldWorkflow::sayHello, new SampleMessage("Uber"));
41+
System.out.printf("WorkflowID: %s, RunID: %s", execution.getWorkflowId(), execution.getRunId());
42+
}
43+
}

src/main/java/com/uber/cadence/samples/spring/models/SampleMessage.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
118
package com.uber.cadence.samples.spring.models;
219

320
public class SampleMessage {

src/main/java/com/uber/cadence/samples/spring/workflows/ChildWorkflow.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
118
package com.uber.cadence.samples.spring.workflows;
219

320
import com.uber.cadence.workflow.WorkflowMethod;

src/main/java/com/uber/cadence/samples/spring/workflows/ParentWorkflow.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
118
package com.uber.cadence.samples.spring.workflows;
219

320
import static com.uber.cadence.samples.spring.common.Constant.TASK_LIST;

src/main/java/com/uber/cadence/samples/spring/workflows/impl/ChildWorkflowImpl.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
118
package com.uber.cadence.samples.spring.workflows.impl;
219

320
import com.uber.cadence.samples.spring.workflows.ChildWorkflow;

src/main/java/com/uber/cadence/samples/spring/workflows/impl/ParentWorkflowImpl.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
7+
* use this file except in compliance with the License. A copy of the License is
8+
* located at
9+
*
10+
* http://aws.amazon.com/apache2.0
11+
*
12+
* or in the "license" file accompanying this file. This file is distributed on
13+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14+
* express or implied. See the License for the specific language governing
15+
* permissions and limitations under the License.
16+
*/
17+
118
package com.uber.cadence.samples.spring.workflows.impl;
219

320
import com.uber.cadence.samples.spring.models.SampleMessage;

src/main/java/com/uber/cadence/samples/spring/workflows/impl/SignalWorkflowImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public void getGreeting(SampleMessage sampleMessage) {
4242
this.greetingMsg = "";
4343

4444
// A workflow execution cannot receive infinite number of signals due to history limit
45-
// By default 10000 is MaximumSignalsPerExecution which can be configured by DynamicConfig of Cadence cluster.
45+
// By default 10000 is MaximumSignalsPerExecution which can be configured by DynamicConfig
46+
// of Cadence cluster.
4647
// But it's recommended to do continueAsNew after receiving certain number of signals.
4748
// in production, use a number <1000.
4849
if (count == 3) {

0 commit comments

Comments
 (0)