Skip to content

Commit 90e51ef

Browse files
authored
fix: Fix logging with PutAdapter and SchemaTranslator (#3635)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable-hbase/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent 0e4016f commit 90e51ef

File tree

2 files changed

+7
-2
lines changed
  • bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters
  • bigtable-hbase-1.x-parent/bigtable-hbase-1.x-tools/src/main/java/com/google/cloud/bigtable/hbase/tools

2 files changed

+7
-2
lines changed

bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/adapters/PutAdapter.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ public void adapt(
8585
// 20 bytes for metadata plus the length of all the elements.
8686
int keyValueSize = (20 + rowLength + familySize + qualifierLength + valueLength);
8787
if (maxKeyValueSize > 0 && keyValueSize > maxKeyValueSize) {
88-
throw new IllegalArgumentException("KeyValue size too large");
88+
throw new IllegalArgumentException(
89+
"KeyValue size too large. Got "
90+
+ keyValueSize
91+
+ " max allowed: "
92+
+ maxKeyValueSize
93+
+ ".");
8994
}
9095

9196
ByteString cellQualifierByteString =

bigtable-hbase-1.x-parent/bigtable-hbase-1.x-tools/src/main/java/com/google/cloud/bigtable/hbase/tools/HBaseSchemaTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public void writeSchema(ClusterSchemaDefinition schemaDefinition) {
341341
LOG.info("Created table {} in Bigtable.", tableName);
342342
} catch (Exception e) {
343343
failedTables.add(tableName);
344-
LOG.error("Failed to create table {}.", e, tableName);
344+
LOG.error("Failed to create table " + tableName + ".", e);
345345
// Continue creating tables in BT. Skipping creation failures makes the script idempotent
346346
// as BT will throw TableExistsException for a table that is already present.
347347
}

0 commit comments

Comments
 (0)