Search in sources :

Example 1 with WeightBuckets

use of com.alibaba.otter.node.etl.load.loader.weight.WeightBuckets in project otter by alibaba.

the class DbLoadAction method buildWeightBuckets.

/**
     * 构建基于weight权重分组的item集合列表
     */
private WeightBuckets<EventData> buildWeightBuckets(DbLoadContext context, List<EventData> datas) {
    WeightBuckets<EventData> buckets = new WeightBuckets<EventData>();
    for (EventData data : datas) {
        // 获取对应的weight
        DataMediaPair pair = ConfigHelper.findDataMediaPair(context.getPipeline(), data.getPairId());
        buckets.addItem(pair.getPushWeight(), data);
    }
    return buckets;
}
Also used : DataMediaPair(com.alibaba.otter.shared.common.model.config.data.DataMediaPair) WeightBuckets(com.alibaba.otter.node.etl.load.loader.weight.WeightBuckets) EventData(com.alibaba.otter.shared.etl.model.EventData)

Example 2 with WeightBuckets

use of com.alibaba.otter.node.etl.load.loader.weight.WeightBuckets in project otter by alibaba.

the class FileLoadAction method buildWeightBuckets.

/**
     * 构建基于weight权重分组的item集合列表
     */
private WeightBuckets<FileData> buildWeightBuckets(Identity identity, List<FileData> datas) {
    WeightBuckets<FileData> buckets = new WeightBuckets<FileData>();
    for (FileData data : datas) {
        // 获取对应的weight
        DataMediaPair pair = ConfigHelper.findDataMediaPair(getPipeline(identity), data.getPairId());
        buckets.addItem(pair.getPushWeight(), data);
    }
    return buckets;
}
Also used : DataMediaPair(com.alibaba.otter.shared.common.model.config.data.DataMediaPair) WeightBuckets(com.alibaba.otter.node.etl.load.loader.weight.WeightBuckets) FileData(com.alibaba.otter.shared.etl.model.FileData)

Aggregations

WeightBuckets (com.alibaba.otter.node.etl.load.loader.weight.WeightBuckets)2 DataMediaPair (com.alibaba.otter.shared.common.model.config.data.DataMediaPair)2 EventData (com.alibaba.otter.shared.etl.model.EventData)1 FileData (com.alibaba.otter.shared.etl.model.FileData)1