Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.cloud.bigtable.hbase.wrappers.BulkMutationWrapper;
import com.google.cloud.bigtable.hbase.wrappers.DataClientWrapper;
import java.io.IOException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.ReentrantReadWriteLock;
Expand Down Expand Up @@ -127,6 +128,14 @@ public long getWriteBufferSize() {
return this.settings.getBatchingMaxRequestSize();
}

public int getMaxRowKeyCount() {
return this.settings.getBulkMaxRowCount();
}

public Duration getAutoFlushInterval() {
return this.settings.getAutoFlushInterval();
}

public List<ApiFuture<?>> mutate(List<? extends Mutation> mutations) {
closedReadLock.lock();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import java.io.IOException;
import java.time.Duration;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;

Expand Down Expand Up @@ -101,6 +102,8 @@ public int getTtlSecondsForBackup() {

public abstract long getBatchingMaxRequestSize();

public abstract Duration getAutoFlushInterval();

// This is equivalent to allow server-side timestamp.
public abstract boolean isRetriesWithoutTimestampAllowed();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ public long getBatchingMaxRequestSize() {
return batchingMaxMemory;
}

@Override
public java.time.Duration getAutoFlushInterval() {
return dataSettings
.getStubSettings()
.bulkMutateRowsSettings()
.getBatchingSettings()
.getDelayThresholdDuration();
}

@Override
public boolean isRetriesWithoutTimestampAllowed() {
return allowRetriesWithoutTimestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ limitations under the License.
<exclude>org.apache.htrace:htrace-core4</exclude>
<exclude>commons-logging:commons-logging</exclude>
<exclude>org.apache.yetus:audience-annotations</exclude>
<exclude>jakarta.activation:jakarta.activation-api</exclude>
</excludes>
</artifactSet>
<relocations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.TableName;
Expand Down Expand Up @@ -88,6 +89,18 @@ public long getWriteBufferSize() {
return helper.getWriteBufferSize();
}

/** {@inheritDoc} */
@Override
public int getMaxMutations() {
return helper.getMaxRowKeyCount();
}

/** {@inheritDoc} */
@Override
public long getPeriodicalFlushTimeout(TimeUnit unit) {
return unit.convert(helper.getAutoFlushInterval().toNanos(), TimeUnit.NANOSECONDS);
}

/** {@inheritDoc} */
@Override
public List<CompletableFuture<Void>> mutate(List<? extends Mutation> mutations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public BigtableConnection(Configuration conf) throws IOException {

public BigtableConnection(Configuration conf, ExecutorService pool, User user)
throws IOException {
super(conf);
super(conf, false, pool, user);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ public AsyncBufferedMutatorBuilder setMaxAttempts(int arg0) {
return this;
}

@Override
public AsyncBufferedMutatorBuilder setMaxMutations(int i) {
return this;
}

@Override
public AsyncBufferedMutator build() {
return new BigtableAsyncBufferedMutator(bigtableApi, settings, createAdapter(tableName));
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ limitations under the License.

<!-- hbase dependency versions -->
<hbase1.version>1.7.2</hbase1.version>
<hbase2.version>2.5.7-hadoop3</hbase2.version>
<hbase2.version>2.5.13-hadoop3</hbase2.version>
<hbase2-testing-util-mockito.version>2.28.2</hbase2-testing-util-mockito.version>

<!-- bytebuddy dependency version for resolving hbase backward incompatible changes -->
Expand Down