@@ -172,35 +172,31 @@ public synchronized void shardingIfNecessary() throws JobShuttingDownException {
172
172
SHARDING_UN_NECESSARY .getBytes (StandardCharsets .UTF_8 )).and ();
173
173
curatorTransactionFinal .commit ();
174
174
} catch (BadVersionException e ) {
175
- LogUtils .warn (log , jobName , String .format (SaturnConstant .LOG_FORMAT_FOR_STRING , jobName ,
176
- "zookeeper bad version exception happens." ), e );
175
+ LogUtils .warn (log , jobName , "zookeeper bad version exception happens." , e );
177
176
needRetry = true ;
178
177
retryCount --;
179
178
} catch (Exception e ) {
180
179
// 可能多个sharding task导致计算结果有滞后,但是server机器已经被删除,导致commit失败
181
180
// 实际上可能不影响最终结果,仍然能正常分配分片,因为还会有resharding事件被响应
182
181
// 修改日志级别为warn级别,避免不必要的告警
183
- LogUtils .warn (log , jobName ,
184
- String .format (SaturnConstant .LOG_FORMAT_FOR_STRING , jobName , "Commit shards failed" ), e );
182
+ LogUtils .warn (log , jobName , "Commit shards failed" , e );
185
183
}
186
184
if (needRetry ) {
187
185
if (retryCount >= 0 ) {
188
- LogUtils .info (log , jobName , SaturnConstant . LOG_FORMAT , jobName ,
186
+ LogUtils .info (log , jobName ,
189
187
"Bad version because of concurrency, will retry to get shards later" );
190
188
Thread .sleep (200L ); // NOSONAR
191
189
getDataStat = getNecessaryDataStat ();
192
190
} else {
193
- LogUtils .warn (log , jobName , SaturnConstant .LOG_FORMAT , jobName ,
194
- "Bad version because of concurrency, give up to retry" );
191
+ LogUtils .warn (log , jobName , "Bad version because of concurrency, give up to retry" );
195
192
break ;
196
193
}
197
194
} else {
198
195
break ;
199
196
}
200
197
}
201
198
} catch (Exception e ) {
202
- LogUtils .error (log , jobName , String .format (SaturnConstant .LOG_FORMAT_FOR_STRING , jobName , e .getMessage ()),
203
- e );
199
+ LogUtils .error (log , jobName , e .getMessage (), e );
204
200
} finally {
205
201
getJobNodeStorage ().removeJobNodeIfExisted (ShardingNode .PROCESSING );
206
202
}
@@ -222,14 +218,14 @@ private boolean blockUntilShardingComplatedIfNotLeader() throws JobShuttingDownE
222
218
if (!(isNeedSharding () || getJobNodeStorage ().isJobNodeExisted (ShardingNode .PROCESSING ))) {
223
219
return true ;
224
220
}
225
- LogUtils .debug (log , jobName , "[{}] msg= Sleep short time until sharding completed" , jobName );
221
+ LogUtils .debug (log , jobName , "Sleep short time until sharding completed" );
226
222
BlockUtils .waitingShortTime ();
227
223
}
228
224
}
229
225
230
226
private void waitingOtherJobCompleted () {
231
227
while (!isShutdown && executionService .hasRunningItems ()) {
232
- LogUtils .info (log , jobName , "[{}] msg= Sleep short time until other job completed." , jobName );
228
+ LogUtils .info (log , jobName , "Sleep short time until other job completed." );
233
229
BlockUtils .waitingShortTime ();
234
230
}
235
231
}
0 commit comments