115
eventsBatches [][]*historypb.HistoryEvent,
116
versionHistoryItems []*historyspb.VersionHistoryItem,
118
>
for _, batch := range eventsBatches {
119
>
if len(batch) == 0 {
120
return nil, nil, serviceerror.NewInvalidArgument("Empty batch")
121
}
122
}
123
>
localVersionHistory, _ := versionhistory.SplitVersionHistoryByLastLocalGeneratedItem(versionHistoryItems, h.clusterMetadata.GetClusterID(), h.clusterMetadata.GetFailoverVersionIncrement())
history_events_handler.go
124
>
if len(localVersionHistory) == 0 {
125
return nil, eventsBatches, nil
126
}
128
>
firstBatch := eventsBatches[0]
129
>
lastBatch := eventsBatches[len(eventsBatches)-1]
130
>
131
>
if lastBatch[len(lastBatch)-1].EventId <= lastLocalEventId {
132
return eventsBatches, nil, nil
133
}
135
return nil, eventsBatches, nil
136
}