Optional bug fix
This commit is contained in:
parent
9fa0cee97e
commit
9ad65ee486
1 changed files with 2 additions and 2 deletions
|
|
@ -367,7 +367,7 @@ public class Scheduler implements Runnable {
|
||||||
|
|
||||||
for (ShardInfo completedShard : completedShards) {
|
for (ShardInfo completedShard : completedShards) {
|
||||||
final String streamName = completedShard.streamName()
|
final String streamName = completedShard.streamName()
|
||||||
.orElse(appStreamTracker.map(mst -> null, sc -> sc.streamName()));
|
.orElseGet(() -> appStreamTracker.map(mst -> null, sc -> sc.streamName()));
|
||||||
Validate.notEmpty(streamName, "Stream name should not be null");
|
Validate.notEmpty(streamName, "Stream name should not be null");
|
||||||
if (createOrGetShardSyncTaskManager(streamName).syncShardAndLeaseInfo()) {
|
if (createOrGetShardSyncTaskManager(streamName).syncShardAndLeaseInfo()) {
|
||||||
log.info("Found completed shard, initiated new ShardSyncTak for " + completedShard.toString());
|
log.info("Found completed shard, initiated new ShardSyncTak for " + completedShard.toString());
|
||||||
|
|
@ -640,7 +640,7 @@ public class Scheduler implements Runnable {
|
||||||
checkpoint);
|
checkpoint);
|
||||||
// The only case where streamName is not available will be when multistreamtracker not set. In this case,
|
// The only case where streamName is not available will be when multistreamtracker not set. In this case,
|
||||||
// get the default stream name for the single stream application.
|
// get the default stream name for the single stream application.
|
||||||
final String streamName = shardInfo.streamName().orElse(appStreamTracker.map(mst -> null, sc -> sc.streamName()));
|
final String streamName = shardInfo.streamName().orElseGet(() -> appStreamTracker.map(mst -> null, sc -> sc.streamName()));
|
||||||
Validate.notEmpty(streamName, "StreamName should not be empty");
|
Validate.notEmpty(streamName, "StreamName should not be empty");
|
||||||
// Irrespective of single stream app or multi stream app, streamConfig should always be available.
|
// Irrespective of single stream app or multi stream app, streamConfig should always be available.
|
||||||
// TODO: Halo : if not available, construct a default config ?
|
// TODO: Halo : if not available, construct a default config ?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue