Skip to content

Commit

Permalink
Merge branch 'helix' into release/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nefro85 committed Nov 22, 2023
2 parents a317177 + 0b02a43 commit b2f6f44
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ List of available commands:

- `helix`

Helix Toolkit.
Helix Toolkit, [more info](docs/samples/helix/readme.md)


## Usage
Expand Down
61 changes: 61 additions & 0 deletions docs/samples/helix/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,65 @@
# Apache Helix Toolkit

Read more about Apache Helix [here](https://github.com/apache/helix).

Command Overview:
```
Usage: doer helix [--help] [-c=<clusterName>] [--model=<helixModel>]
[-n=<instanceName>] [--num-partition=<numPartitions>]
[-r=<resource>] [--rebalanceMode=<rebalanceMode>]
[--replicas=<replicas>] [-s=<server>]
[--stateModel=<stateModel>] [-t=<type>]
[-f=<String=String>]... [-sf=<String=String>]...
Helix Toolkit.
-c=<clusterName>
-f=<String=String> Default: {}
--help
--model=<helixModel> Helix State Model YAML definition file.
-n=<instanceName> Default: doer
--num-partition=<numPartitions>
Default: 1
-r=<resource>
--rebalanceMode=<rebalanceMode>
Default: FULL_AUTO
--replicas=<replicas> Default: 1
-s=<server> Default: localhost:2181
-sf=<String=String>
--stateModel=<stateModel>
Default: MasterSlave
-t=<type> Default: spectator
```

## Commands:

- Create Cluster
```bash
doer helix -t create -c ${CLUSTER_NAME} -r ${RESOURCE} --replicas 3
```
- Create Cluster from yaml model definition, [see](grade-cluster.yaml)
```bash
doer helix -c ${CLUSTER_NAME} --model cluster-model.yaml
```
- Connect the Controller instance
```bash
doer helix -t controller -c ${CLUSTER_NAME} -n ${CLUSTER_NAME}-ctl
```

More examples [here](runHelixCluster.sh).
Usage:
```
main - Master Slave Model.
grade - Grade State Model.
msgs - Helix Messaging test.
misc:
ZKON=1 - local zookeeper
ESOUT=1 - log events into elasticsearch (DOER_OUTPUT="http://localhost:9200/helix/_doc")
SPECT=1 - run spectator with with 'all' listeners on
sample:
ZKON=1 ESOUT=1 SPECT=1 ./runHelixCluster.sh grade
```


### Notes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.s7i.doer.domain.helix;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -22,7 +23,9 @@ public class DoerRebalancer extends DelayedAutoRebalancer {
@Data
@Accessors(fluent = true)
public static class Context {
@JsonProperty
StateModelDefinition model;
@JsonProperty
IdealState idealState;
}

Expand Down

0 comments on commit b2f6f44

Please sign in to comment.