All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alicloud.openservices.tablestore.writer.dispatch.BaseDispatcher Maven / Gradle / Ivy

Go to download

Aliyun Open Services SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

There is a newer version: 5.17.5
Show newest version
package com.alicloud.openservices.tablestore.writer.dispatch;

import java.util.concurrent.atomic.AtomicLong;


public abstract class BaseDispatcher implements Dispatcher {
    private final AtomicLong[] bucketDispatchRowCount;

    public BaseDispatcher(int bucketCount) {
        bucketDispatchRowCount = new AtomicLong[bucketCount];
        for (int i = 0; i < bucketCount; i++) {
            bucketDispatchRowCount[i] = new AtomicLong(0);
        }
    }


    protected void addBucketCount(int bucketId) {
        bucketDispatchRowCount[bucketId].incrementAndGet();
    }


    /**
     * 分桶写入统计
     * */
    public AtomicLong[] getBucketDispatchRowCount() {
        return bucketDispatchRowCount;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy