@@ -130,8 +130,11 @@ public Repo<Manager> call(long tid, Manager manager) throws Exception {
130
130
int dirCount = 0 ;
131
131
132
132
TabletHostingGoal initialHostingGoal = tableInfo .initialHostingGoal ;
133
-
134
- boolean sawHostingGoal = false ;
133
+ if (initialHostingGoal == null ) {
134
+ log .error ("Initial hosting goal is null and shouldn't be, defaulting to "
135
+ + TabletHostingGoal .ONDEMAND );
136
+ initialHostingGoal = TabletHostingGoal .ONDEMAND ;
137
+ }
135
138
136
139
while (true ) {
137
140
key .readFields (in );
@@ -163,11 +166,8 @@ public Repo<Manager> call(long tid, Manager manager) throws Exception {
163
166
if (m == null || !currentRow .equals (metadataRow )) {
164
167
165
168
if (m != null ) {
166
- // if initial hosting goal was provided, use it, otherwise use ondemand
167
- TabletHostingGoal hostingGoal =
168
- (initialHostingGoal != null ) ? initialHostingGoal : TabletHostingGoal .ONDEMAND ;
169
-
170
- HostingColumnFamily .GOAL_COLUMN .put (m , TabletHostingGoalUtil .toValue (hostingGoal ));
169
+ HostingColumnFamily .GOAL_COLUMN .put (m ,
170
+ TabletHostingGoalUtil .toValue (initialHostingGoal ));
171
171
mbw .addMutation (m );
172
172
}
173
173
@@ -180,30 +180,17 @@ public Repo<Manager> call(long tid, Manager manager) throws Exception {
180
180
m = new Mutation (metadataRow );
181
181
ServerColumnFamily .DIRECTORY_COLUMN .put (m , new Value (tabletDir ));
182
182
currentRow = metadataRow ;
183
- sawHostingGoal = false ;
184
183
}
185
184
186
- if (initialHostingGoal != null ) {
187
- // add the initial hosting goal
188
- HostingColumnFamily .GOAL_COLUMN .put (m ,
189
- TabletHostingGoalUtil .toValue (initialHostingGoal ));
190
- sawHostingGoal = true ;
191
- }
192
- if (HostingColumnFamily .GOAL_COLUMN .hasColumns (key )) {
193
- sawHostingGoal = true ;
194
- }
185
+ // add the initial hosting goal
186
+ HostingColumnFamily .GOAL_COLUMN .put (m ,
187
+ TabletHostingGoalUtil .toValue (initialHostingGoal ));
188
+
195
189
m .put (key .getColumnFamily (), cq , val );
196
190
197
191
if (endRow == null && TabletColumnFamily .PREV_ROW_COLUMN .hasColumns (key )) {
198
-
199
- if (!sawHostingGoal ) {
200
- // add a default hosting goal
201
- HostingColumnFamily .GOAL_COLUMN .put (m ,
202
- TabletHostingGoalUtil .toValue (TabletHostingGoal .ONDEMAND ));
203
- }
204
-
205
192
mbw .addMutation (m );
206
- break ; // its the last column in the last row
193
+ break ; // it's the last column in the last row
207
194
}
208
195
}
209
196
break ;
0 commit comments