@@ -74,54 +74,66 @@ public class SlowDeterministicMonkeyFactory extends MonkeyFactory {
7474 private long rollingBatchSuspendRSSleepTime ;
7575 private float rollingBatchSuspendtRSRatio ;
7676
77+ protected Action [] getLightWeightedActions (){
78+ return new Action [] {
79+ new CompactTableAction (tableName , compactTableRatio ),
80+ new CompactRandomRegionOfTableAction (tableName , compactRandomRegionRatio ),
81+ new FlushTableAction (tableName ),
82+ new FlushRandomRegionOfTableAction (tableName ),
83+ new MoveRandomRegionOfTableAction (tableName )
84+ };
85+ }
86+
87+ protected Action [] getMidWeightedActions (){
88+ return new Action [] {
89+ new SplitRandomRegionOfTableAction (tableName ),
90+ new MergeRandomAdjacentRegionsOfTableAction (tableName ),
91+ new SnapshotTableAction (tableName ),
92+ new AddColumnAction (tableName ),
93+ new RemoveColumnAction (tableName , columnFamilies ),
94+ new ChangeEncodingAction (tableName ),
95+ new ChangeCompressionAction (tableName ),
96+ new ChangeBloomFilterAction (tableName ),
97+ new ChangeVersionsAction (tableName ),
98+ new ChangeSplitPolicyAction (tableName ),
99+ };
100+ }
101+
102+ protected Action [] getHeavyWeightedActions () {
103+ return new Action [] {
104+ new MoveRegionsOfTableAction (moveRegionsSleepTime , moveRegionsMaxTime ,
105+ tableName ),
106+ new MoveRandomRegionOfTableAction (moveRandomRegionSleepTime , tableName ),
107+ new RestartRandomRsAction (restartRandomRSSleepTime ),
108+ new BatchRestartRsAction (batchRestartRSSleepTime , batchRestartRSRatio ),
109+ new RestartActiveMasterAction (restartActiveMasterSleepTime ),
110+ new RollingBatchRestartRsAction (rollingBatchRestartRSSleepTime ,
111+ rollingBatchRestartRSRatio ),
112+ new RestartRsHoldingMetaAction (restartRsHoldingMetaSleepTime ),
113+ new DecreaseMaxHFileSizeAction (decreaseHFileSizeSleepTime , tableName ),
114+ new SplitAllRegionOfTableAction (tableName ),
115+ new GracefulRollingRestartRsAction (gracefulRollingRestartTSSLeepTime ),
116+ new RollingBatchSuspendResumeRsAction (rollingBatchSuspendRSSleepTime ,
117+ rollingBatchSuspendtRSRatio )
118+ };
119+ }
120+
77121 @ Override
78122 public ChaosMonkey build () {
79123
80124 loadProperties ();
81125 // Actions such as compact/flush a table/region,
82126 // move one region around. They are not so destructive,
83127 // can be executed more frequently.
84- Action [] actions1 = new Action [] {
85- new CompactTableAction (tableName , compactTableRatio ),
86- new CompactRandomRegionOfTableAction (tableName , compactRandomRegionRatio ),
87- new FlushTableAction (tableName ),
88- new FlushRandomRegionOfTableAction (tableName ),
89- new MoveRandomRegionOfTableAction (tableName )
90- };
128+ Action [] actions1 = getLightWeightedActions ();
91129
92130 // Actions such as split/merge/snapshot.
93131 // They should not cause data loss, or unreliability
94132 // such as region stuck in transition.
95- Action [] actions2 = new Action [] {
96- new SplitRandomRegionOfTableAction (tableName ),
97- new MergeRandomAdjacentRegionsOfTableAction (tableName ),
98- new SnapshotTableAction (tableName ),
99- new AddColumnAction (tableName ),
100- new RemoveColumnAction (tableName , columnFamilies ),
101- new ChangeEncodingAction (tableName ),
102- new ChangeCompressionAction (tableName ),
103- new ChangeBloomFilterAction (tableName ),
104- new ChangeVersionsAction (tableName ),
105- new ChangeSplitPolicyAction (tableName ),
106- };
133+ Action [] actions2 = getMidWeightedActions ();
107134
108135 // Destructive actions to mess things around.
109- Action [] actions3 = new Action [] {
110- new MoveRegionsOfTableAction (moveRegionsSleepTime , moveRegionsMaxTime ,
111- tableName ),
112- new MoveRandomRegionOfTableAction (moveRandomRegionSleepTime , tableName ),
113- new RestartRandomRsAction (restartRandomRSSleepTime ),
114- new BatchRestartRsAction (batchRestartRSSleepTime , batchRestartRSRatio ),
115- new RestartActiveMasterAction (restartActiveMasterSleepTime ),
116- new RollingBatchRestartRsAction (rollingBatchRestartRSSleepTime ,
117- rollingBatchRestartRSRatio ),
118- new RestartRsHoldingMetaAction (restartRsHoldingMetaSleepTime ),
119- new DecreaseMaxHFileSizeAction (decreaseHFileSizeSleepTime , tableName ),
120- new SplitAllRegionOfTableAction (tableName ),
121- new GracefulRollingRestartRsAction (gracefulRollingRestartTSSLeepTime ),
122- new RollingBatchSuspendResumeRsAction (rollingBatchSuspendRSSleepTime ,
123- rollingBatchSuspendtRSRatio )
124- };
136+ Action [] actions3 = getHeavyWeightedActions ();
125137
126138 // Action to log more info for debugging
127139 Action [] actions4 = new Action [] {
0 commit comments