com.couchbase.client.core.deps.org.jctools.counters.CountersFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-io Show documentation
Show all versions of core-io Show documentation
The official Couchbase JVM Core IO Library
package com.couchbase.client.core.deps.org.jctools.counters;
import com.couchbase.client.core.deps.org.jctools.util.UnsafeAccess;
/**
* @author Tolstopyatov Vsevolod
*/
public final class CountersFactory {
private CountersFactory() {
}
public static FixedSizeStripedLongCounter createFixedSizeStripedCounter(int stripesCount) {
if (UnsafeAccess.SUPPORTS_GET_AND_ADD_LONG) {
return new FixedSizeStripedLongCounterV8(stripesCount);
} else {
return new FixedSizeStripedLongCounterV6(stripesCount);
}
}
public static FixedSizeStripedLongCounter createFixedSizeStripedCounterV6(int stripesCount) {
return new FixedSizeStripedLongCounterV6(stripesCount);
}
public static FixedSizeStripedLongCounter createFixedSizeStripedCounterV8(int stripesCount) {
return new FixedSizeStripedLongCounterV8(stripesCount);
}
}