diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml index 0297c79f472..fd1fa38972e 100644 --- a/.baseline/checkstyle/checkstyle.xml +++ b/.baseline/checkstyle/checkstyle.xml @@ -43,7 +43,7 @@ - + diff --git a/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java b/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java index 4469e3fb7e8..46cf40dbdc9 100644 --- a/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java +++ b/atlasdb-api/src/main/java/com/palantir/atlasdb/keyvalue/api/RowResult.java @@ -45,7 +45,7 @@ public static RowResult of(Cell cell, T value) { cell.getRowName(), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(cell.getColumnName(), value) - .build()); + .buildOrThrow()); } public static RowResult create(byte[] row, SortedMap columns) { diff --git a/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java b/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java index bbcf559c99a..bf713b70f2d 100644 --- a/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java +++ b/atlasdb-autobatch/src/main/java/com/palantir/atlasdb/autobatch/Autobatchers.java @@ -237,7 +237,7 @@ public DisruptorAutobatcher build() { new TracingEventHandler<>(handler, parameters.batchSize()); EventHandler> profiledHandler = - new ProfilingEventHandler<>(tracingHandler, purpose, safeTags.build()); + new ProfilingEventHandler<>(tracingHandler, purpose, safeTags.buildOrThrow()); return DisruptorAutobatcher.create( profiledHandler, diff --git a/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java b/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java index d43b98b7d8d..58a7f7785e8 100644 --- a/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java +++ b/atlasdb-autobatch/src/test/java/com/palantir/atlasdb/autobatch/BatchSizeRecorderTest.java @@ -53,7 +53,7 @@ public void tagsArePassedThrough() { Map customTags = ImmutableMap.builder() .put("tag1", "value1") .put("tag2", "value2") - .build(); + .buildOrThrow(); BatchSizeRecorder recorder = BatchSizeRecorder.create(SAFE_IDENTIFIER, customTags); recorder.markBatchProcessed(5); diff --git a/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java b/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java index 6299432e0d3..45bc6005890 100644 --- a/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java +++ b/atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceIntegrationTest.java @@ -829,7 +829,7 @@ private CfDef createDefaultCfDef(String namespace, String tableName) { .setCompression_options(ImmutableMap.builder() .put("sstable_compression", "org.apache.cassandra.io.compress.LZ4Compressor") .put("chunk_length_kb", "4") - .build()) + .buildOrThrow()) .setBloom_filter_fp_chance(0.1) .setCaching("KEYS_ONLY") .setDclocal_read_repair_chance(0.0) diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java index 6a7543320a7..913a4272156 100644 --- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java +++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceImpl.java @@ -820,7 +820,7 @@ public Map get(TableReference tableRef, Map timestampBy } builder.putAll(collector.getCollectedResults()); } - return builder.build(); + return builder.buildOrThrow(); } catch (Exception e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java index f5ed0000dc3..1c66f9e37a3 100644 --- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java +++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/ColumnFamilyDefinitions.java @@ -94,7 +94,7 @@ private static Map getCompressionOptions(Optional .put( CassandraConstants.CFDEF_COMPRESSION_CHUNK_LENGTH_KEY, Integer.toString(actualCompressionBlockSizeKb)) - .build(); + .buildOrThrow(); } /** diff --git a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java index f25fb55991f..b0532af816e 100644 --- a/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java +++ b/atlasdb-cassandra/src/main/java/com/palantir/atlasdb/keyvalue/cassandra/pool/CassandraClientPoolMetrics.java @@ -57,7 +57,7 @@ private static Map>builder() .put(COLUMN_NAME_1, Pair.create(EMPTY_BYTE_ARRAY, VALUE_1)) .put(COLUMN_NAME_2, Pair.create(EMPTY_BYTE_ARRAY, VALUE_2)) - .build(); + .buildOrThrow(); @Test public void canGetValuesFromSelectionResult() { diff --git a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java index 0593eb61d8a..f2b4f3c45e6 100644 --- a/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java +++ b/atlasdb-cli/src/test/java/com/palantir/atlasdb/cli/command/TestKvsMigrationCommand.java @@ -175,7 +175,7 @@ private void seedKvs(AtlasDbServices services, int numTables, int numEntriesPerT Cell cell = Cell.create(PtBytes.toBytes("row" + j), PtBytes.toBytes("col")); toWrite.put(cell, PtBytes.toBytes("val" + j)); } - t.put(table, toWrite.build()); + t.put(table, toWrite.buildOrThrow()); return null; }); } @@ -190,7 +190,7 @@ private void checkKvs(AtlasDbServices services, int numTables, int numEntriesPer Cell cell = Cell.create(PtBytes.toBytes("row" + j), PtBytes.toBytes("col")); expectedBuilder.put(cell, PtBytes.toBytes("val" + j)); } - Map expected = expectedBuilder.build(); + Map expected = expectedBuilder.buildOrThrow(); Map result = t.get(table, expected.keySet()); assertThat(result.keySet()).containsExactlyInAnyOrderElementsOf(expected.keySet()); for (Map.Entry e : result.entrySet()) { diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java index d54e6451e87..af4d1259463 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueService.java @@ -124,7 +124,7 @@ public Map getMetadataForTables() { for (TableReference table : getAllTableNames()) { builder.put(table, getMetadataForTable(table)); } - return builder.build(); + return builder.buildOrThrow(); } protected int getMultiPutBatchCount() { diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java index b6563c48733..381bb086fff 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/Cells.java @@ -147,7 +147,7 @@ protected Map.Entry> computeNext() { mapBuilder.put(peek.getKey().getColumnName(), peek.getValue()); it.next(); } - map = mapBuilder.build(); + map = mapBuilder.buildOrThrow(); return Maps.immutableEntry(row, map); } }; diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java index c361150b255..588c1112762 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/InMemoryKeyValueService.java @@ -284,7 +284,7 @@ protected RowResult computeNext() { cellIter = takeCell(it, key); collectValueForTimestamp(key.col, cellIter, result, range, resultProducer); } - SortedMap columns = result.build(); + SortedMap columns = result.buildOrThrow(); if (!columns.isEmpty()) { return RowResult.create(row, columns); } diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java index 2cf4fe89b4f..484296016ac 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/KeyValueServices.java @@ -170,7 +170,7 @@ public static Map filterGetRowsToColumnRange( IdentityHashMap results = new IdentityHashMap<>(); for (Map.Entry> row : rowsToColumns.entrySet()) { - SortedMap map = row.getValue().build(); + SortedMap map = row.getValue().buildOrThrow(); Set> subMap; if ((columnRangeSelection.getStartCol().length == 0) && (columnRangeSelection.getEndCol().length == 0)) { subMap = map.entrySet(); diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java index d1bc1b4bcb9..07f30b07f9c 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/keyvalue/impl/RowResults.java @@ -83,7 +83,7 @@ public static RowResult merge(RowResult base, RowResult overwrite) colBuilder.putAll(overwrite.getColumns()); colBuilder.putAll( Maps.difference(base.getColumns(), overwrite.getColumns()).entriesOnlyOnLeft()); - return RowResult.create(base.getRowName(), colBuilder.build()); + return RowResult.create(base.getRowName(), colBuilder.buildOrThrow()); } public static long getApproximateSizeOfRowResult(RowResult rr) { diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java index 5baede50bce..c076257d42c 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/stream/AbstractPersistentStreamStore.java @@ -86,7 +86,7 @@ public final long getByHashOrStoreStreamAndMarkAsUsed( tx, ImmutableMap.builder() .put(streamId, reference) - .build()); + .buildOrThrow()); return streamId; } Pair pair = storeStream(stream); @@ -94,7 +94,7 @@ public final long getByHashOrStoreStreamAndMarkAsUsed( hash.equals(pair.rhSide), "passed hash: %s does not equal stream hash: %s", hash, pair.rhSide); markStreamsAsUsedInternal( tx, - ImmutableMap.builder().put(pair.lhSide, reference).build()); + ImmutableMap.builder().put(pair.lhSide, reference).buildOrThrow()); return pair.lhSide; } @@ -102,14 +102,14 @@ public final long getByHashOrStoreStreamAndMarkAsUsed( public void unmarkStreamAsUsed(Transaction tx, long streamId, byte[] reference) { unmarkStreamsAsUsed( tx, - ImmutableMap.builder().put(streamId, reference).build()); + ImmutableMap.builder().put(streamId, reference).buildOrThrow()); } @Override public void markStreamAsUsed(Transaction tx, long streamId, byte[] reference) { markStreamsAsUsed( tx, - ImmutableMap.builder().put(streamId, reference).build()); + ImmutableMap.builder().put(streamId, reference).buildOrThrow()); } @Override @@ -251,7 +251,7 @@ private void putMetadataAndHashIndexTask(Transaction tx, Long streamId, StreamMe tx, ImmutableMap.builder() .put(streamId, metadata) - .build()); + .buildOrThrow()); } protected abstract void putMetadataAndHashIndexTask(Transaction tx, Map streamIdsToMetadata); diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java index b0a41ee51dc..7ca7056ad51 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransaction.java @@ -27,7 +27,7 @@ public abstract class AbstractTransaction implements Transaction { protected static final ImmutableSortedMap> EMPTY_SORTED_ROWS = ImmutableSortedMap.>orderedBy(UnsignedBytes.lexicographicalComparator()) - .build(); + .buildOrThrow(); private TransactionType transactionType = TransactionType.DEFAULT; diff --git a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java index 840ed66a999..e8f5856dd5d 100644 --- a/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java +++ b/atlasdb-client/src/main/java/com/palantir/atlasdb/transaction/impl/CachingTransaction.java @@ -108,13 +108,13 @@ public NavigableMap> getRows( if (shouldLoad) { toLoad.add(row); } else if (nonEmpty) { - inCache.put(row, RowResult.create(row, matches.build())); + inCache.put(row, RowResult.create(row, matches.buildOrThrow())); } } SortedMap> results = super.getRows(tableRef, toLoad, columnSelection); cacheLoadedRows(tableRef, toLoad, columnSelection.getSelectedColumns(), results); inCache.putAll(results); - return inCache.build(); + return inCache.buildOrThrow(); } } diff --git a/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java b/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java index 7510f633e1e..2664388e5b9 100644 --- a/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java +++ b/atlasdb-client/src/test/java/com/palantir/atlasdb/transaction/impl/ReadTransactionShould.java @@ -58,7 +58,7 @@ public class ReadTransactionShould { .put("getRange", new Object[] {DUMMY_THOROUGH_TABLE, RangeRequest.all()}) .put("getRanges", new Object[] {DUMMY_THOROUGH_TABLE, ImmutableList.of(RangeRequest.all())}) .put("getRangesLazy", new Object[] {DUMMY_THOROUGH_TABLE, ImmutableList.of(RangeRequest.all())}) - .build(); + .buildOrThrow(); private ReadTransaction readTransaction; private CallbackAwareTransaction delegateTransaction; diff --git a/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java b/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java index 0d1bf956e43..792059ffee5 100644 --- a/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java +++ b/atlasdb-commons/src/main/java/com/palantir/common/collect/MapEntries.java @@ -51,7 +51,7 @@ public static ImmutableMap toMap(Iterable> it) { for (Map.Entry e : it) { builder.put(e.getKey(), e.getValue()); } - return builder.build(); + return builder.buildOrThrow(); } public static Function, Map.Entry> applyValue(final Function f) { diff --git a/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java b/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java index b78ea2717f4..0e159935b46 100644 --- a/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java +++ b/atlasdb-commons/src/main/java/com/palantir/common/collect/Maps2.java @@ -32,7 +32,7 @@ public static ImmutableMap fromEntries(Iterable e : it) { builder.put(e.getKey(), e.getValue()); } - return builder.build(); + return builder.buildOrThrow(); } public static ImmutableMap transformKeys(Map map, Function f) { diff --git a/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java b/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java index baf5e91558a..c1e42c10ff8 100644 --- a/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java +++ b/atlasdb-commons/src/test/java/com/palantir/remoting/HeaderAccessUtilsTest.java @@ -39,7 +39,7 @@ public class HeaderAccessUtilsTest { .put(KEY_1, VALUE_1) .put(KEY_2, VALUE_2) .put(KEY_3, VALUE_3) - .build(); + .buildOrThrow(); @Test public void caseInsensitiveContainsEntryIgnoresCaseOnKeys() { diff --git a/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java b/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java index b7d059242c0..01c4d9a3f6d 100644 --- a/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java +++ b/atlasdb-config/src/main/java/com/palantir/atlasdb/debug/TransactionPostMortemRunner.java @@ -147,7 +147,7 @@ private static FullDiagnosticDigest.CompletedTransactionDigest transactio Map> lockRequests = ImmutableMap.>builder() .putAll(clientLockDigest.lockRequests()) .put(clientLockDigest.immutableTimestampRequestId(), ImmutableSet.of()) - .build(); + .buildOrThrow(); Map lockDigests = KeyedStream.stream(lockRequests) .map((requestId, descriptors) -> lockDigest(descriptors, timelockLockInfo.map(info -> lockState(requestId, info)))) diff --git a/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java b/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java index 711639f2a03..7e57d569177 100644 --- a/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java +++ b/atlasdb-dbkvs-hikari/src/main/java/com/palantir/nexus/db/pool/InterceptorConnection.java @@ -38,7 +38,7 @@ public final class InterceptorConnection extends AbstractInvocationHandler imple .put("createStatement", Statement.class) .put("prepareCall", CallableStatement.class) .put("prepareStatement", PreparedStatement.class) - .build(); + .buildOrThrow(); private InterceptorConnection(final Connection delegate) { this.delegate = delegate; diff --git a/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java b/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java index 576e5e7eb9a..f2e37c0ffde 100644 --- a/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java +++ b/atlasdb-dbkvs-hikari/src/test/java/com/palantir/nexus/db/pool/config/OracleConnectionConfigTest.java @@ -158,7 +158,7 @@ public void protocolCaseInsensitiveTest() throws IOException { .put("\"tcp\"", ConnectionProtocol.TCP) .put("\"TCPS\"", ConnectionProtocol.TCPS) .put("\"tcps\"", ConnectionProtocol.TCPS) - .build(); + .buildOrThrow(); for (Map.Entry entry : serializedProtocols.entrySet()) { ConnectionProtocol protocol = mapper.readValue(entry.getKey(), ConnectionProtocol.class); diff --git a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java index ebf773966b1..545af721c85 100644 --- a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java +++ b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/oracle/OracleGetRange.java @@ -343,7 +343,7 @@ private static List> createRowResults( byte[] rowName = sqlRow.cell.getRowName(); if (currentRowName == null || !Arrays.equals(rowName, currentRowName)) { if (currentRowName != null) { - rowResults.add(RowResult.create(currentRowName, currentRowCells.build())); + rowResults.add(RowResult.create(currentRowName, currentRowCells.buildOrThrow())); } currentRowCells = ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()); currentRowName = rowName; @@ -358,7 +358,7 @@ private static List> createRowResults( TraceStatistics.incBytesRead(value); } if (currentRowName != null) { - rowResults.add(RowResult.create(currentRowName, currentRowCells.build())); + rowResults.add(RowResult.create(currentRowName, currentRowCells.buildOrThrow())); } return rowResults; } diff --git a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java index fa258824bed..74a1695d2d7 100644 --- a/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java +++ b/atlasdb-dbkvs/src/main/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresGetRange.java @@ -249,7 +249,7 @@ private void flushCurrentRow(@Output List> results) { } private Optional> getCurrentRowResult() { - ImmutableSortedMap cells = currentRowCells.build(); + ImmutableSortedMap cells = currentRowCells.buildOrThrow(); if (cells.isEmpty()) { return Optional.empty(); } else { diff --git a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java index 81b7a1b73e5..1aa75ce352a 100644 --- a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java +++ b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/OracleTableNameUnmapperTest.java @@ -138,7 +138,7 @@ public void getLongTableNamesFromMappingTableReturnsLongNames() throws TableMapp .put("shortNameOne", "superLongNameOne") .put("shortNameTwo", "superLongNameTwo") .put("shortNameThree", "superLongNameThree") - .build(); + .buildOrThrow(); mockShortNamesToLongNamesQuery(shortNamesToLongNames.values()); Set longNames = oracleTableNameUnmapper.getLongTableNamesFromMappingTable( diff --git a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java index ee649293685..5ad6afa76c2 100644 --- a/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java +++ b/atlasdb-dbkvs/src/test/java/com/palantir/atlasdb/keyvalue/dbkvs/impl/postgres/PostgresDdlTableTest.java @@ -142,7 +142,7 @@ private SqlConnection setUpSqlConnection(Long lastVacuumTimestamp, Long currentT .put("LAST", 0) .put("current", 1) .put("CURRENT", 1) - .build())); + .buildOrThrow())); return sqlConnection; } diff --git a/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java b/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java index 8308e85eaca..deb29728049 100644 --- a/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java +++ b/atlasdb-ete-tests/src/test/java/com/palantir/atlasdb/ete/DockerClientOrchestrationRule.java @@ -131,7 +131,7 @@ private Map getEnvironment() { return ImmutableMap.builder() .putAll(CassandraEnvironment.get()) .put("CONFIG_FILE_MOUNTPOINT", temporaryFolder.getRoot().getAbsolutePath()) - .build(); + .buildOrThrow(); } private String dockerExecOnClient(String... arguments) { diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java index 6a39f3ab2e5..a26303dc1ef 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/atomic/ResilientCommitTimestampAtomicTable.java @@ -238,7 +238,7 @@ private Map processReads(Map reads, Map getCachedValues(TableReference table, Set cel return ImmutableMap.builder() .putAll(locallyCachedReads) .putAll(snapshotCachedValues) - .build(); + .buildOrThrow(); } @Override diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java index 19bf6abf6fd..50a7d6d7df4 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImpl.java @@ -209,7 +209,7 @@ private synchronized Map processUncachedCells( return ImmutableMap.builder() .putAll(remoteReadValues) .putAll(filterEmptyValues(cacheHits)) - .build(); + .buildOrThrow(); } private synchronized NavigableMap> processUncachedRows( diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java index 0720697efe8..5f9ab227f9a 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/sweep/metrics/SweepOutcomeMetrics.java @@ -80,7 +80,7 @@ private static Supplier buildMetrics( ImmutableMap tags = ImmutableMap.builder() .putAll(additionalTags) .put(AtlasDbMetricNames.TAG_OUTCOME, outcome.name()) - .build(); + .buildOrThrow(); filter.ifPresent(presentFilter -> manager.addMetricFilter(forClass, AtlasDbMetricNames.SWEEP_OUTCOME, tags, filter.get())); manager.registerOrGet( diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java index e888cdbb4cd..9306f367bc8 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SerializableTransaction.java @@ -903,7 +903,7 @@ protected ListenableFuture> getCommitTimestamps( .putAll(AtlasFutures.getDone(preStartCommitTimestamps)) .putAll(AtlasFutures.getDone(postStartCommitTimestamps)) .putAll(partitionedTimestamps.myCommittedTransaction()) - .build(), + .buildOrThrow(), MoreExecutors.directExecutor()); } diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SnapshotTransaction.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SnapshotTransaction.java index 2d9aea2532f..cbeb243ee8c 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SnapshotTransaction.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/SnapshotTransaction.java @@ -415,7 +415,7 @@ private NavigableMap> getRowsInternal( } // We don't need to do work postFiltering if we have a write locally. - rawResults.keySet().removeAll(result.build().keySet()); + rawResults.keySet().removeAll(result.buildOrThrow().keySet()); NavigableMap> results = filterRowResults(tableRef, rawResults, result); long getRowsMillis = TimeUnit.NANOSECONDS.toMillis(timer.stop()); @@ -483,7 +483,8 @@ public Map>> getRowsColumnRangeIterator postFilteredResultsBuilder.put(row, scopeToTransaction(postFilteredIterator)); } - SortedMap>> postFilteredResults = postFilteredResultsBuilder.build(); + SortedMap>> postFilteredResults = + postFilteredResultsBuilder.buildOrThrow(); // validate requirements here as the first batch for each of the above iterators will not check validatePreCommitRequirementsOnReadIfNecessary(tableRef, getStartTimestamp()); return postFilteredResults; @@ -790,7 +791,7 @@ private NavigableMap> filterRowResults( TableReference tableRef, Map rawResults, ImmutableMap.Builder resultCollector) { ImmutableMap collected = resultCollector .putAll(getWithPostFilteringSync(tableRef, rawResults, Value.GET_VALUE)) - .build(); + .buildOrThrow(); Map filterDeletedValues = removeEmptyColumns(collected, tableRef); return RowResults.viewOfSortedMap(Cells.breakCellsUpByRow(filterDeletedValues)); } diff --git a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/metrics/ToplistDeltaFilteringTableLevelMetricsController.java b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/metrics/ToplistDeltaFilteringTableLevelMetricsController.java index eee2bd88b61..44f80f2a91f 100644 --- a/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/metrics/ToplistDeltaFilteringTableLevelMetricsController.java +++ b/atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/transaction/impl/metrics/ToplistDeltaFilteringTableLevelMetricsController.java @@ -88,6 +88,6 @@ private Map getTagsForTableReference(TableReference tableReferen return ImmutableMap.builder() .putAll(metricsManager.getTableNameTagFor(tableReference)) .put(CONTROLLER_GENERATED, TRUE) - .build(); + .buildOrThrow(); } } diff --git a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/LockWatchValueScopingCacheImplTest.java b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/LockWatchValueScopingCacheImplTest.java index 25fb8692968..8d9ef569c69 100644 --- a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/LockWatchValueScopingCacheImplTest.java +++ b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/LockWatchValueScopingCacheImplTest.java @@ -78,7 +78,7 @@ public final class LockWatchValueScopingCacheImplTest { private static final ImmutableMap VALUES = ImmutableMap.builder() .put(CELL_1, VALUE_1.value().get()) .put(CELL_2, VALUE_2.value().get()) - .build(); + .buildOrThrow(); private static final LockWatchEvent LOCK_EVENT = createLockEvent(); private static final LockWatchEvent WATCH_EVENT = createWatchEvent(); diff --git a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImplTest.java b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImplTest.java index 198c527a76a..ef5dc360c51 100644 --- a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImplTest.java +++ b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/TransactionScopedCacheImplTest.java @@ -85,7 +85,7 @@ public final class TransactionScopedCacheImplTest { .put(CELL_3, VALUE_3.value().get()) .put(CELL_4, VALUE_4.value().get()) .put(CELL_5, VALUE_5.value().get()) - .build(); + .buildOrThrow(); private static final CacheValue VALUE_EMPTY = CacheValue.empty(); private final CacheMetrics metrics = mock(CacheMetrics.class); diff --git a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/ValidatingTransactionScopedCacheTest.java b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/ValidatingTransactionScopedCacheTest.java index a4fac7d53b7..3e001869490 100644 --- a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/ValidatingTransactionScopedCacheTest.java +++ b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/keyvalue/api/cache/ValidatingTransactionScopedCacheTest.java @@ -66,7 +66,7 @@ public final class ValidatingTransactionScopedCacheTest { private static final ImmutableMap VALUES = ImmutableMap.builder() .put(CELL_1, VALUE_1.value().get()) .put(CELL_2, VALUE_2.value().get()) - .build(); + .buildOrThrow(); private final CacheMetrics metrics = mock(CacheMetrics.class); diff --git a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/sweep/queue/TargetedSweeperTest.java b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/sweep/queue/TargetedSweeperTest.java index 45cc923e3eb..095ed26027e 100644 --- a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/sweep/queue/TargetedSweeperTest.java +++ b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/sweep/queue/TargetedSweeperTest.java @@ -81,13 +81,13 @@ import com.palantir.lock.v2.LockResponse; import com.palantir.lock.v2.LockToken; import com.palantir.lock.v2.TimelockService; +import java.time.Duration; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -1450,9 +1450,9 @@ private void setSweepTimestamp(long timestamp) { private void await(final ThrowingRunnable assertion) { Awaitility.await() - .atMost(2L, TimeUnit.SECONDS) + .atMost(Duration.ofSeconds(2L)) .with() - .pollInterval(SMALL_REFRESH_MILLIS, TimeUnit.MILLISECONDS) + .pollInterval(Duration.ofMillis(SMALL_REFRESH_MILLIS)) .untilAsserted(assertion); } } diff --git a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/transaction/impl/AdvisoryLocksConditionTest.java b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/transaction/impl/AdvisoryLocksConditionTest.java index 6a0400fb2c3..dc3a416acaa 100644 --- a/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/transaction/impl/AdvisoryLocksConditionTest.java +++ b/atlasdb-impl-shared/src/test/java/com/palantir/atlasdb/transaction/impl/AdvisoryLocksConditionTest.java @@ -55,7 +55,7 @@ public class AdvisoryLocksConditionTest { TransactionConstants.TRANSACTION_TABLE.getQualifiedName(), TransactionConstants.getValueForTimestamp(0L)), LockMode.WRITE) - .build()); + .buildOrThrow()); private static final LockRequest LOCK_REQUEST = LockRequest.builder(LOCK_DESCRIPTORS).build(); private static final Supplier LOCK_REQUEST_SUPPLIER = () -> LOCK_REQUEST; diff --git a/atlasdb-perf/src/main/java/com/palantir/atlasdb/performance/benchmarks/HttpBenchmarks.java b/atlasdb-perf/src/main/java/com/palantir/atlasdb/performance/benchmarks/HttpBenchmarks.java index 78aad889bce..cf162a5743d 100644 --- a/atlasdb-perf/src/main/java/com/palantir/atlasdb/performance/benchmarks/HttpBenchmarks.java +++ b/atlasdb-perf/src/main/java/com/palantir/atlasdb/performance/benchmarks/HttpBenchmarks.java @@ -45,7 +45,7 @@ public class HttpBenchmarks { .put(HttpHeaders.USER_AGENT.toLowerCase(), ImmutableList.of("atlasdb/atlasdb-atlasdb")) .put(HttpHeaders.SET_COOKIE.toLowerCase(), ImmutableList.of("cookie")) .put(HttpHeaders.EXPECT.toLowerCase(), ImmutableList.of("12391572384129734")) - .build(); + .buildOrThrow(); @Benchmark @Threads(1) diff --git a/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/AtlasDeserializers.java b/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/AtlasDeserializers.java index a9646677499..30d2fb60c36 100644 --- a/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/AtlasDeserializers.java +++ b/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/AtlasDeserializers.java @@ -184,7 +184,7 @@ public static Map deserializeCellVals(final TableMetadata metadata builder.put(entry); } } - return builder.build(); + return builder.buildOrThrow(); } public static byte[] deserializeVal(ColumnValueDescription description, JsonNode node) { diff --git a/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/TableRowResultDeserializer.java b/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/TableRowResultDeserializer.java index c8297ad1610..139f0d8c88d 100644 --- a/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/TableRowResultDeserializer.java +++ b/atlasdb-service/src/main/java/com/palantir/atlasdb/jackson/TableRowResultDeserializer.java @@ -68,7 +68,7 @@ public TableRowResult deserialize(JsonParser jp, DeserializationContext ctxt) th } } } - rowResults.add(RowResult.create(row, cols.build())); + rowResults.add(RowResult.create(row, cols.buildOrThrow())); } return new TableRowResult(tableName, rowResults); } diff --git a/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueServiceTest.java b/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueServiceTest.java index 02ac33e6316..37f875054e7 100644 --- a/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueServiceTest.java +++ b/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/keyvalue/impl/AbstractKeyValueServiceTest.java @@ -737,7 +737,7 @@ public void testGetRange(boolean reverseSupported) { ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(column(0), Value.create(val(1, 0), TEST_TIMESTAMP)) .put(column(2), Value.create(val(1, 2), TEST_TIMESTAMP)) - .build())); + .buildOrThrow())); assertThat(rangeResult).hasNext(); assertThat(rangeResult.next()) .isEqualTo(RowResult.create( @@ -745,7 +745,7 @@ public void testGetRange(boolean reverseSupported) { ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(column(1), Value.create(val(2, 1), TEST_TIMESTAMP)) .put(column(2), Value.create(val(2, 2), TEST_TIMESTAMP)) - .build())); + .buildOrThrow())); } } @@ -775,7 +775,7 @@ private void doTestGetRangePaging(int numColumnsInMetadata, int batchSizeHint, b .put(Cell.create(PtBytes.toBytes("04"), RangeRequests.getLastRowName()), PtBytes.toBytes("h")) .put(Cell.create(PtBytes.toBytes("05"), PtBytes.toBytes("c1")), PtBytes.toBytes("i")) .put(Cell.create(RangeRequests.getLastRowName(), PtBytes.toBytes("c1")), PtBytes.toBytes("j")) - .build(); + .buildOrThrow(); keyValueService.put(tableRef, values, TEST_TIMESTAMP); RangeRequest request = @@ -788,25 +788,25 @@ private void doTestGetRangePaging(int numColumnsInMetadata, int batchSizeHint, b ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(PtBytes.toBytes("c1"), Value.create(PtBytes.toBytes("a"), TEST_TIMESTAMP)) .put(PtBytes.toBytes("c2"), Value.create(PtBytes.toBytes("b"), TEST_TIMESTAMP)) - .build()), + .buildOrThrow()), RowResult.create( PtBytes.toBytes("01"), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put( RangeRequests.getFirstRowName(), Value.create(PtBytes.toBytes("c"), TEST_TIMESTAMP)) - .build()), + .buildOrThrow()), RowResult.create( PtBytes.toBytes("02"), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(PtBytes.toBytes("c1"), Value.create(PtBytes.toBytes("d"), TEST_TIMESTAMP)) .put(PtBytes.toBytes("c2"), Value.create(PtBytes.toBytes("e"), TEST_TIMESTAMP)) - .build()), + .buildOrThrow()), RowResult.create( PtBytes.toBytes("03"), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(PtBytes.toBytes("c1"), Value.create(PtBytes.toBytes("f"), TEST_TIMESTAMP)) - .build()), + .buildOrThrow()), RowResult.create( PtBytes.toBytes("04"), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) @@ -814,17 +814,17 @@ private void doTestGetRangePaging(int numColumnsInMetadata, int batchSizeHint, b .put( RangeRequests.getLastRowName(), Value.create(PtBytes.toBytes("h"), TEST_TIMESTAMP)) - .build()), + .buildOrThrow()), RowResult.create( PtBytes.toBytes("05"), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(PtBytes.toBytes("c1"), Value.create(PtBytes.toBytes("i"), TEST_TIMESTAMP)) - .build()), + .buildOrThrow()), RowResult.create( RangeRequests.getLastRowName(), ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(PtBytes.toBytes("c1"), Value.create(PtBytes.toBytes("j"), TEST_TIMESTAMP)) - .build())); + .buildOrThrow())); if (reverse) { assertThat(results).containsExactlyElementsOf(Lists.reverse(expected)); @@ -861,7 +861,7 @@ private void doTestGetRangePagingLastRowEdgeCase(int numColumnsInMetadata, int b ImmutableSortedMap.orderedBy(UnsignedBytes.lexicographicalComparator()) .put(PtBytes.toBytes("c1"), Value.create(PtBytes.toBytes("a"), TEST_TIMESTAMP)) .put(last, Value.create(PtBytes.toBytes("b"), TEST_TIMESTAMP)) - .build())); + .buildOrThrow())); assertThat(results).containsExactlyElementsOf(expected); } } @@ -934,7 +934,7 @@ private static List> getExpectedResultForRangePagingWithColumnS byte[] colName = PtBytes.toBytes(Long.MIN_VALUE ^ col); builder.put(colName, Value.create(PtBytes.toBytes(row + "," + col), TEST_TIMESTAMP)); } - SortedMap columns = builder.build(); + SortedMap columns = builder.buildOrThrow(); if (!columns.isEmpty()) { byte[] rowName = PtBytes.toBytes(Long.MIN_VALUE ^ row); expected.add(RowResult.create(rowName, columns)); diff --git a/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransactionTest.java b/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransactionTest.java index 11665b6c3bf..f2f6761b08e 100644 --- a/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransactionTest.java +++ b/atlasdb-tests-shared/src/main/java/com/palantir/atlasdb/transaction/impl/AbstractTransactionTest.java @@ -771,7 +771,7 @@ public void testColumnRangePagingTransaction_batchingVisitable() { ImmutableList.of(row), BatchColumnRangeSelection.create(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY, 1)); List> expected = - ImmutableList.copyOf(writes.build().entrySet()); + ImmutableList.copyOf(writes.buildOrThrow().entrySet()); verifyMatchingResult(expected, row, columnRange); columnRange = tx.getRowsColumnRange( @@ -826,7 +826,7 @@ public void testColumnRangePagingTransaction_iterator() { ImmutableList.of(row), BatchColumnRangeSelection.create(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY, 1)); List> expected = - ImmutableList.copyOf(writes.build().entrySet()); + ImmutableList.copyOf(writes.buildOrThrow().entrySet()); verifyMatchingResultForIterator(expected, row, columnRange); columnRange = tx.getRowsColumnRangeIterator( @@ -921,7 +921,7 @@ public void testReadMyWritesColumnRangePagingTransaction() { ImmutableList.of(row), BatchColumnRangeSelection.create(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY, 1)); List> expected = - ImmutableList.copyOf(writes.build().entrySet()); + ImmutableList.copyOf(writes.buildOrThrow().entrySet()); verifyMatchingResult(expected, row, columnRange); Map>> columnRangeIterator = tx.getRowsColumnRangeIterator( @@ -960,7 +960,7 @@ public void testReadMyDeletesColumnRangePagingTransaction() { ImmutableList.of(row), BatchColumnRangeSelection.create(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY, 1)); List> expected = - ImmutableList.copyOf(writes.build().entrySet()); + ImmutableList.copyOf(writes.buildOrThrow().entrySet()); verifyMatchingResult(expected, row, columnRange); Map>> columnRangeIterator = tx.getRowsColumnRangeIterator( diff --git a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/keyvalue/impl/TableSplittingKeyValueServiceTest.java b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/keyvalue/impl/TableSplittingKeyValueServiceTest.java index 231fda4acda..82b215a5236 100644 --- a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/keyvalue/impl/TableSplittingKeyValueServiceTest.java +++ b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/keyvalue/impl/TableSplittingKeyValueServiceTest.java @@ -166,6 +166,6 @@ private Map merge( return ImmutableMap.builder() .putAll(left) .putAll(right) - .build(); + .buildOrThrow(); } } diff --git a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/CachingTransactionTest.java b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/CachingTransactionTest.java index 962e847b438..74e454a0029 100644 --- a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/CachingTransactionTest.java +++ b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/CachingTransactionTest.java @@ -70,7 +70,7 @@ public static Collection data() { ImmutableMap., Map, Expectations>>builder() .put(SYNC, CachingTransactionTest.this::syncGetExpectation) .put(ASYNC, CachingTransactionTest.this::asyncGetExpectation) - .build(); + .buildOrThrow(); public CachingTransactionTest(String name, Function transactionWrapper) { this.name = name; @@ -85,7 +85,7 @@ public void testCacheEmptyGets() { final ColumnSelection oneColumn = ColumnSelection.create(ImmutableList.of(COL_BYTES)); final SortedMap> emptyResults = ImmutableSortedMap.>orderedBy(PtBytes.BYTES_COMPARATOR) - .build(); + .buildOrThrow(); final Set noRows = ImmutableSortedSet.orderedBy(PtBytes.BYTES_COMPARATOR).build(); @@ -119,13 +119,13 @@ public void testGetRows() { ImmutableSortedSet.orderedBy(PtBytes.BYTES_COMPARATOR).build(); final SortedMap> emptyResults = ImmutableSortedMap.>orderedBy(PtBytes.BYTES_COMPARATOR) - .build(); + .buildOrThrow(); final RowResult rowResult = RowResult.of(Cell.create(ROW_BYTES, COL_BYTES), VALUE_BYTES); final SortedMap> oneResult = ImmutableSortedMap.>orderedBy( PtBytes.BYTES_COMPARATOR) .put(ROW_BYTES, rowResult) - .build(); + .buildOrThrow(); mockery.checking(new Expectations() { { @@ -148,7 +148,7 @@ public void testGetRows() { public void testGetCell() { final Cell cell = Cell.create(ROW_BYTES, COL_BYTES); final Map cellValueMap = - ImmutableMap.builder().put(cell, VALUE_BYTES).build(); + ImmutableMap.builder().put(cell, VALUE_BYTES).buildOrThrow(); // cell is cached after first call, so second call requests no cells testGetCellResults(cell, cellValueMap); diff --git a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/SnapshotTransactionTest.java b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/SnapshotTransactionTest.java index 799262e1d60..3fd167fb5fb 100644 --- a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/SnapshotTransactionTest.java +++ b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/SnapshotTransactionTest.java @@ -199,7 +199,7 @@ public static Collection data() { ImmutableMap.builder() .put(SYNC, SnapshotTransactionTest.this::syncGetExpectation) .put(ASYNC, SnapshotTransactionTest.this::asyncGetExpectation) - .build(); + .buildOrThrow(); private final TimestampCache timestampCache = new DefaultTimestampCache( metricsManager.getRegistry(), () -> AtlasDbConstants.DEFAULT_TIMESTAMP_CACHE_SIZE); private final ExecutorService getRangesExecutor = Executors.newFixedThreadPool(8); @@ -2320,7 +2320,7 @@ private HeldLocksToken getExpiredHeldLocksToken() { lockClient, creationDateMs, expirationDateMs, - LockCollections.of(builder.build()), + LockCollections.of(builder.buildOrThrow()), lockTimeout, versionId, "Dummy thread"); diff --git a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/metrics/TransactionOutcomeMetricsTest.java b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/metrics/TransactionOutcomeMetricsTest.java index a214a6cbce8..d0976a80861 100644 --- a/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/metrics/TransactionOutcomeMetricsTest.java +++ b/atlasdb-tests-shared/src/test/java/com/palantir/atlasdb/transaction/impl/metrics/TransactionOutcomeMetricsTest.java @@ -72,7 +72,7 @@ public void canMarkVariousOutcomes() { .put(4, transactionOutcomeMetrics::markPutUnlessExistsFailed) .put(5, transactionOutcomeMetrics::markRollbackOtherTransaction) .put(6, transactionOutcomeMetrics::markPreCommitCheckFailed) - .build(); + .buildOrThrow(); tasks.entrySet().forEach(entry -> IntStream.range(0, entry.getKey()) .forEach(unused -> entry.getValue().run())); diff --git a/build.gradle b/build.gradle index 0d47ed9e681..01b5af64f62 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { dependencies { classpath 'com.netflix.nebula:gradle-info-plugin:11.4.1' classpath 'com.netflix.nebula:nebula-publishing-plugin:18.4.0' - classpath 'com.palantir.baseline:gradle-baseline-java:4.173.0' + classpath 'com.palantir.baseline:gradle-baseline-java:4.180.0' classpath 'com.palantir.gradle.conjure:gradle-conjure:5.30.0' classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:2.11.0' classpath 'com.palantir.gradle.docker:gradle-docker:0.32.0' diff --git a/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksGrant.java b/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksGrant.java index 8b41143c0fd..f6ca4d0c9de 100644 --- a/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksGrant.java +++ b/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksGrant.java @@ -253,7 +253,7 @@ static class SerializationProxy implements Serializable { for (LockWithMode lock : lockMap) { localLockMapBuilder.put(lock.getLockDescriptor(), lock.getLockMode()); } - this.lockMap = LockCollections.of(localLockMapBuilder.build()); + this.lockMap = LockCollections.of(localLockMapBuilder.buildOrThrow()); this.lockTimeout = lockTimeout; this.versionId = versionId; } diff --git a/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksToken.java b/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksToken.java index ae41a33b17c..1d567fc6516 100644 --- a/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksToken.java +++ b/lock-api-objects/src/main/java/com/palantir/lock/HeldLocksToken.java @@ -257,7 +257,7 @@ static class SerializationProxy implements Serializable { for (LockWithMode lock : locks) { localLockMapBuilder.put(lock.getLockDescriptor(), lock.getLockMode()); } - this.lockMap = LockCollections.of(localLockMapBuilder.build()); + this.lockMap = LockCollections.of(localLockMapBuilder.buildOrThrow()); this.tokenId = Preconditions.checkNotNull(tokenId, "tokenId"); this.client = Preconditions.checkNotNull(client, "client"); this.creationDateMs = creationDateMs; diff --git a/lock-api-objects/src/main/java/com/palantir/lock/LockRequest.java b/lock-api-objects/src/main/java/com/palantir/lock/LockRequest.java index f2c8d490922..9559c670bc5 100644 --- a/lock-api-objects/src/main/java/com/palantir/lock/LockRequest.java +++ b/lock-api-objects/src/main/java/com/palantir/lock/LockRequest.java @@ -474,7 +474,7 @@ static class SerializationProxy implements Serializable { for (LockWithMode lock : locks) { localLockMapBuilder.put(lock.getLockDescriptor(), lock.getLockMode()); } - this.lockMap = LockCollections.of(localLockMapBuilder.build()); + this.lockMap = LockCollections.of(localLockMapBuilder.buildOrThrow()); this.lockTimeout = lockTimeout; this.lockGroupBehavior = lockGroupBehavior; this.blockingMode = blockingMode; diff --git a/lock-api-objects/src/main/java/com/palantir/lock/LockResponse.java b/lock-api-objects/src/main/java/com/palantir/lock/LockResponse.java index b0b47ce194a..22f55a7cd3d 100644 --- a/lock-api-objects/src/main/java/com/palantir/lock/LockResponse.java +++ b/lock-api-objects/src/main/java/com/palantir/lock/LockResponse.java @@ -208,7 +208,7 @@ static class SerializationProxy implements Serializable { for (LockWithClient lock : lockWithClients) { lockHoldersBuilder.put(lock.getLockDescriptor(), lock.getLockClient()); } - this.lockHolders = lockHoldersBuilder.build(); + this.lockHolders = lockHoldersBuilder.buildOrThrow(); } this.token = token; this.isBlockAndRelease = isBlockAndRelease; diff --git a/lock-impl/src/main/java/com/palantir/lock/impl/LockServiceImpl.java b/lock-impl/src/main/java/com/palantir/lock/impl/LockServiceImpl.java index cdb4ea4c496..ca2033f56ab 100644 --- a/lock-impl/src/main/java/com/palantir/lock/impl/LockServiceImpl.java +++ b/lock-impl/src/main/java/com/palantir/lock/impl/LockServiceImpl.java @@ -432,7 +432,7 @@ public LockResponse lockWithFullLockResponse(LockClient client, LockRequest requ } HeldLocksToken token = createHeldLocksToken( client, - LockCollections.of(lockDescriptorMap.build()), + LockCollections.of(lockDescriptorMap.buildOrThrow()), LockCollections.of(locks), request.getLockTimeout(), request.getVersionId(), diff --git a/lock-impl/src/main/java/com/palantir/lock/logger/LockServiceTestUtils.java b/lock-impl/src/main/java/com/palantir/lock/logger/LockServiceTestUtils.java index 2ee1de7dbd2..700224f63df 100644 --- a/lock-impl/src/main/java/com/palantir/lock/logger/LockServiceTestUtils.java +++ b/lock-impl/src/main/java/com/palantir/lock/logger/LockServiceTestUtils.java @@ -70,6 +70,6 @@ public static ImmutableSortedMap getLockDescriptorLock LockDescriptor descriptor1 = StringLockDescriptor.of(descriptor); builder.put(descriptor1, LockMode.WRITE); } - return builder.build(); + return builder.buildOrThrow(); } } diff --git a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/management/AllNodesDisabledNamespacesUpdaterFactory.java b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/management/AllNodesDisabledNamespacesUpdaterFactory.java index 8190ae01eb0..872e595752d 100644 --- a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/management/AllNodesDisabledNamespacesUpdaterFactory.java +++ b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/management/AllNodesDisabledNamespacesUpdaterFactory.java @@ -52,7 +52,7 @@ public AllNodesDisabledNamespacesUpdater create(TimelockNamespaces localNamespac .mapKeys(WithDedicatedExecutor::service) .map(WithDedicatedExecutor::executor) .collectToMap()) - .build(); + .buildOrThrow(); ImmutableList remoteServices = ImmutableList.copyOf( remoteUpdaters.stream().map(WithDedicatedExecutor::service).collect(Collectors.toList())); diff --git a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosRemoteClients.java b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosRemoteClients.java index 74851b1ef9f..91f7eaa45a5 100644 --- a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosRemoteClients.java +++ b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosRemoteClients.java @@ -64,7 +64,7 @@ Map paxosExecutors() { executorIndex)); executorIndex++; } - return builder.build(); + return builder.buildOrThrow(); } @Value.Derived @@ -82,7 +82,7 @@ Map pingExecutors() { executorIndex)); executorIndex++; } - return builder.build(); + return builder.buildOrThrow(); } @Value.Derived diff --git a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosResources.java b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosResources.java index 96db9a28391..be2254dde4e 100644 --- a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosResources.java +++ b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/PaxosResources.java @@ -56,7 +56,7 @@ public List resourcesForRegistration() { ImmutableMap.builder() .put(PaxosUseCase.TIMESTAMP, batchResourcesFromComponents(timestampPaxosComponents())) .putAll(leadershipBatchResources()) - .build(); + .buildOrThrow(); UseCaseAwareBatchPaxosResource combinedBatchResource = new UseCaseAwareBatchPaxosResource(new EnumMap<>(batchPaxosResourcesByUseCase)); diff --git a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/SingleLeaderNetworkClientFactories.java b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/SingleLeaderNetworkClientFactories.java index ca3bb07af38..5a485b2d56d 100644 --- a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/SingleLeaderNetworkClientFactories.java +++ b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/SingleLeaderNetworkClientFactories.java @@ -96,7 +96,7 @@ public Factory learner() { .put( localLearner, new CheckedRejectionExecutorService(MoreExecutors.newDirectExecutorService())) - .build(); + .buildOrThrow(); SingleLeaderLearnerNetworkClient uninstrumentedLearner = new SingleLeaderLearnerNetworkClient( localLearner, diff --git a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/TimeLockPaxosExecutors.java b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/TimeLockPaxosExecutors.java index 867e635a2f5..3b179c3d3c6 100644 --- a/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/TimeLockPaxosExecutors.java +++ b/timelock-agent/src/main/java/com/palantir/atlasdb/timelock/paxos/TimeLockPaxosExecutors.java @@ -56,7 +56,7 @@ static Map createBoundedExecutors( } remoteExecutors.put( localAndRemotes.local(), new CheckedRejectionExecutorService(MoreExecutors.newDirectExecutorService())); - return remoteExecutors.build(); + return remoteExecutors.buildOrThrow(); } /** diff --git a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/AcceptorCacheImplTests.java b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/AcceptorCacheImplTests.java index 298693c97af..0386339740b 100644 --- a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/AcceptorCacheImplTests.java +++ b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/AcceptorCacheImplTests.java @@ -47,7 +47,7 @@ public void cacheKeyWithNoUpdatesReturnsEmpty() throws InvalidAcceptorCacheKeyEx .put(Client.of("client1"), 5L) .put(Client.of("client2"), 6L) .put(Client.of("client3"), 7L) - .build(); + .buildOrThrow(); AcceptorCache cache = cache(before); AcceptorCacheDigest digest = cache.getAllUpdates(); @@ -69,7 +69,7 @@ public void updatingWithNonRecentValueDoesNotAffectCache() throws InvalidAccepto .put(Client.of("client1"), 5L) .put(Client.of("client2"), 6L) .put(Client.of("client3"), 7L) - .build(); + .buildOrThrow(); AcceptorCache cache = cache(before); AcceptorCacheDigest digest = cache.getAllUpdates(); @@ -129,7 +129,7 @@ public void updatesAreCoalesced() throws InvalidAcceptorCacheKeyException { Map diffAfterFirstUpdate = ImmutableMap.builder() .put(Client.of("client1"), 20L) .put(Client.of("client4"), 25L) - .build(); + .buildOrThrow(); assertThat(cache.updatesSinceCacheKey(cacheKey)) .map(AcceptorCacheDigest::updates) @@ -143,7 +143,7 @@ public void updatesAreCoalesced() throws InvalidAcceptorCacheKeyException { .put(Client.of("client1"), 20L) .put(Client.of("client4"), 30L) .put(Client.of("client3"), 50L) - .build(); + .buildOrThrow(); assertThat(cache.updatesSinceCacheKey(cacheKey)) .map(AcceptorCacheDigest::updates) diff --git a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/BatchingPaxosLatestSequenceCacheTests.java b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/BatchingPaxosLatestSequenceCacheTests.java index 1bc0faf42ba..dc4e907479b 100644 --- a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/BatchingPaxosLatestSequenceCacheTests.java +++ b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/BatchingPaxosLatestSequenceCacheTests.java @@ -47,7 +47,7 @@ public class BatchingPaxosLatestSequenceCacheTests { .put(CLIENT_1, PaxosLong.of(5L)) .put(CLIENT_2, PaxosLong.of(10L)) .put(CLIENT_3, PaxosLong.of(15L)) - .build(); + .buildOrThrow(); private final AtomicLong cacheTimestamp = new AtomicLong(); @@ -120,7 +120,7 @@ public void invalidCacheKeyRequestsEverything() throws InvalidAcceptorCacheKeyEx .put(CLIENT_1, 52L) .put(CLIENT_2, 17L) .put(CLIENT_3, 1123L) - .build(); + .buildOrThrow(); AcceptorCacheDigest newDigest = ImmutableAcceptorCacheDigest.builder() .newCacheKey(AcceptorCacheKey.newCacheKey()) diff --git a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LearnedValuesSinceCoalescingFunctionTests.java b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LearnedValuesSinceCoalescingFunctionTests.java index 4454c484b38..243e4c4f84d 100644 --- a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LearnedValuesSinceCoalescingFunctionTests.java +++ b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LearnedValuesSinceCoalescingFunctionTests.java @@ -67,7 +67,7 @@ public void batchesAndReturnsPreciselyValuesLearnedSinceSeq() { .put(CLIENT_1, 10L) .put(CLIENT_2, 15L) .put(CLIENT_3, 1L) - .build(); + .buildOrThrow(); SetMultimap remoteResponse = ImmutableSetMultimap.builder() .putAll(CLIENT_1, paxosValue1, paxosValue2, paxosValue4) diff --git a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LocalBatchPaxosLearnerTests.java b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LocalBatchPaxosLearnerTests.java index f681a4d44e3..4b5e27b5621 100644 --- a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LocalBatchPaxosLearnerTests.java +++ b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/LocalBatchPaxosLearnerTests.java @@ -100,7 +100,7 @@ public void weProxyGetLearnedValuesSince() { Map request = ImmutableMap.builder() .put(CLIENT_1, 1L) .put(CLIENT_2, 2L) - .build(); + .buildOrThrow(); SetMultimap expected = ImmutableSetMultimap.builder() .putAll(CLIENT_1, paxosValue1) diff --git a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/PaxosQuorumCheckingCoalescingFunctionTests.java b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/PaxosQuorumCheckingCoalescingFunctionTests.java index b174c29ab8f..4a213e15bca 100644 --- a/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/PaxosQuorumCheckingCoalescingFunctionTests.java +++ b/timelock-impl/src/test/java/com/palantir/atlasdb/timelock/paxos/PaxosQuorumCheckingCoalescingFunctionTests.java @@ -68,7 +68,7 @@ public void successfullyCombinesAndDeconstructs() { .put(1L, responsesFor(entry(node1, 2L), entry(node2, 6L), entry(node3, 3L))) .put(2L, responsesFor(entry(node1, 23L), entry(node2, 23L), entry(node3, 65L))) .put(5L, responsesFor(entry(node1, 65L), entry(node2, 32L), entry(node3, 32L))) - .build(); + .buildOrThrow(); Map> results = paxosQuorumChecker.apply(ImmutableSet.of(1L, 2L, 5L)); @@ -92,7 +92,7 @@ public void individualRequestsCanHaveQuorumFailures() { .put(1L, responsesFor(entry(node1, 2L))) .put(2L, responsesFor(entry(node1, 23L), entry(node2, 23L), entry(node3, 65L))) .put(5L, responsesFor(entry(node2, 32L))) - .build(); + .buildOrThrow(); Map> results = paxosQuorumChecker.apply(ImmutableSet.of(1L, 2L, 5L)); diff --git a/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/MultiNodePaxosTimeLockServerIntegrationTest.java b/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/MultiNodePaxosTimeLockServerIntegrationTest.java index 19ec03d733d..f11a54672a5 100644 --- a/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/MultiNodePaxosTimeLockServerIntegrationTest.java +++ b/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/MultiNodePaxosTimeLockServerIntegrationTest.java @@ -371,7 +371,7 @@ public void directLegacyAndConjureLockServicesInteractCorrectly() throws Interru com.palantir.lock.LockRequest.builder( ImmutableSortedMap.naturalOrder() .put(StringLockDescriptor.of("lock"), LockMode.WRITE) - .build()) + .buildOrThrow()) .build()); ConjureLockRefreshToken conjureAnalogue = ConjureLockRefreshToken.of(token.getTokenId(), token.getExpirationDateMs()); @@ -407,7 +407,7 @@ public void lockAcquiredByConjureLockServiceIsAlsoAcquiredInLegacy() throws Inte com.palantir.lock.LockRequest lockRequest = com.palantir.lock.LockRequest.builder( ImmutableSortedMap.naturalOrder() .put(StringLockDescriptor.of("lock"), LockMode.WRITE) - .build()) + .buildOrThrow()) .doNotBlock() .build(); String anonymousId = LockClient.ANONYMOUS.getClientId();