Skip to content

Commit

Permalink
change imports instead of using full qualified names
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Dec 6, 2024
1 parent 413703d commit 21c4614
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.bigtable.v2.ReadChangeStreamResponse;
import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange;
import com.google.protobuf.ByteString;
import java.time.Instant;
import javax.annotation.Nonnull;

/**
Expand Down Expand Up @@ -115,16 +116,15 @@ interface ChangeStreamRecordBuilder<ChangeStreamRecordT> {
void startUserMutation(
@Nonnull ByteString rowKey,
@Nonnull String sourceClusterId,
java.time.Instant commitTimestamp,
Instant commitTimestamp,
int tieBreaker);

/**
* Called to start a new Garbage Collection ChangeStreamMutation. This will be called at most
* once. If called, the current change stream record must not include any close stream message
* or heartbeat.
*/
void startGcMutation(
@Nonnull ByteString rowKey, java.time.Instant commitTimestamp, int tieBreaker);
void startGcMutation(@Nonnull ByteString rowKey, Instant commitTimestamp, int tieBreaker);

/** Called to add a DeleteFamily mod. */
void deleteFamily(@Nonnull String familyName);
Expand Down Expand Up @@ -177,7 +177,7 @@ void mergeToCell(

/** Called once per stream record to signal that all mods have been processed (unless reset). */
ChangeStreamRecordT finishChangeStreamMutation(
@Nonnull String token, java.time.Instant estimatedLowWatermark);
@Nonnull String token, Instant estimatedLowWatermark);

/** Called when the current in progress change stream record should be dropped */
void reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ public void startUserMutation(

/** {@inheritDoc} */
@Override
public void startGcMutation(
ByteString rowKey, java.time.Instant commitTimestamp, int tieBreaker) {
public void startGcMutation(ByteString rowKey, Instant commitTimestamp, int tieBreaker) {
this.changeStreamMutationBuilder =
ChangeStreamMutation.createGcMutation(rowKey, commitTimestamp, tieBreaker);
}
Expand Down Expand Up @@ -176,7 +175,7 @@ public void finishCell() {
/** {@inheritDoc} */
@Override
public ChangeStreamRecord finishChangeStreamMutation(
String token, java.time.Instant estimatedLowWatermark) {
String token, Instant estimatedLowWatermark) {
this.changeStreamMutationBuilder.setToken(token);
this.changeStreamMutationBuilder.setLowWatermarkTime(estimatedLowWatermark);
return this.changeStreamMutationBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.IOException;
import java.time.Duration;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
Expand Down Expand Up @@ -108,7 +109,7 @@ public static CbtTestProxy create() {
* @param newTimeout The value that is used to set the timeout.
*/
private static BigtableDataSettings.Builder overrideTimeoutSetting(
java.time.Duration newTimeout, BigtableDataSettings.Builder settingsBuilder) {
Duration newTimeout, BigtableDataSettings.Builder settingsBuilder) {

updateTimeout(
settingsBuilder.stubSettings().bulkMutateRowsSettings().retrySettings(), newTimeout);
Expand All @@ -127,8 +128,8 @@ private static BigtableDataSettings.Builder overrideTimeoutSetting(
return settingsBuilder;
}

private static void updateTimeout(RetrySettings.Builder settings, java.time.Duration newTimeout) {
java.time.Duration rpcTimeout = settings.getInitialRpcTimeoutDuration();
private static void updateTimeout(RetrySettings.Builder settings, Duration newTimeout) {
Duration rpcTimeout = settings.getInitialRpcTimeoutDuration();

// TODO: this should happen in gax
// Clamp the rpcTimeout to the overall timeout
Expand Down Expand Up @@ -179,8 +180,8 @@ public synchronized void createClient(
.setAppProfileId(request.getAppProfileId());

if (request.hasPerOperationTimeout()) {
java.time.Duration newTimeout =
java.time.Duration.ofMillis(Durations.toMillis(request.getPerOperationTimeout()));
Duration newTimeout =
Duration.ofMillis(Durations.toMillis(request.getPerOperationTimeout()));
settingsBuilder = overrideTimeoutSetting(newTimeout, settingsBuilder);
logger.info(
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.cloud.bigtable.data.v2.models.sql.SqlType;
import com.google.cloud.bigtable.data.v2.models.sql.Statement;
import com.google.protobuf.Timestamp;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -156,8 +157,8 @@ static Object decodeArrayElement(Value value, SqlType<?> elemType) {
}
}

private static java.time.Instant toInstant(Timestamp timestamp) {
return java.time.Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos());
private static Instant toInstant(Timestamp timestamp) {
return Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos());
}

private static Date fromProto(com.google.type.Date proto) {
Expand Down

0 comments on commit 21c4614

Please sign in to comment.