Skip to content
Merged
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
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ subprojects {
guiceVersion = '5.1.0'
guavaVersion = '32.1.3-jre'
slf4jVersion = '1.7.36'
log4jVersion = '2.24.3'
log4jVersion = '2.25.0'
jsonpVersion = '1.1.4'
jacksonVersion = '2.19.1'
toml4jVersion = '0.7.2'
scalarDbVersion = '3.15.3'
scalarDbVersion = '3.16.0'
scalarAdminVersion = '2.2.1'
resilience4jRetryVersion = '1.7.1'
dropwizardMetricsVersion = '4.2.32'
dropwizardMetricsVersion = '4.2.33'
prometheusVersion = '0.16.0'
jettyVersion = '9.4.57.v20241219'
assertjVersion = '3.27.3'
Expand Down Expand Up @@ -54,6 +54,12 @@ subprojects {

dependencies {
implementation group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
implementation(group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}") {
exclude group: 'com.github.spotbugs', module: 'spotbugs-annotations'
}
implementation(group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4jVersion}") {
exclude group: 'com.github.spotbugs', module: 'spotbugs-annotations'
}
implementation group: 'com.google.inject', name: 'guice', version: "${guiceVersion}"
implementation group: 'com.google.guava', name: 'guava', version: "${guavaVersion}"
implementation group: 'javax.json', name: 'javax.json-api', version: "${jsonpVersion}"
Expand Down
2 changes: 0 additions & 2 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ dependencies {
api project(':common')
implementation group: 'com.moandjiezana.toml', name: 'toml4j', version: "${toml4jVersion}"
implementation group: 'info.picocli', name: 'picocli', version: "${picoCliVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4jVersion}"
api group: 'com.scalar-labs', name: 'scalardb', version: "${scalarDbVersion}"
api group: 'javax.json', name: 'javax.json-api', version: "${jsonpVersion}"
api group: 'org.glassfish', name: 'javax.json', version: "${jsonpVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import com.scalar.db.api.Scan.Ordering;
import com.scalar.db.api.Scanner;
import com.scalar.db.api.TransactionState;
import com.scalar.db.common.error.CoreError;
import com.scalar.db.common.CoreError;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.io.Key;
import com.scalar.dl.client.exception.ClientException;
Expand All @@ -82,6 +82,10 @@

public class GenericContractObjectAndCollectionEndToEndTest
extends GenericContractEndToEndTestBase {
private static final String COORDINATOR_NAMESPACE = "coordinator";
private static final String COORDINATOR_STATE_TABLE = "state";
private static final String METADATA_TX_STATE = "tx_state";

private static final String ASSET_ID = "id";
private static final String ASSET_AGE = "age";
private static final String ASSET_OUTPUT = "output";
Expand Down Expand Up @@ -637,11 +641,13 @@ public void putObject_FunctionArgumentsGiven_ShouldPutRecordToFunctionTable()
.table(getFunctionTable())
.partitionKey(Key.ofText(SOME_COLUMN_NAME_1, SOME_OBJECT_ID))
.clusteringKey(Key.ofText(SOME_COLUMN_NAME_2, SOME_VERSION_ID_0))
.intValue("tx_state", TransactionState.ABORTED.get())
.intValue(METADATA_TX_STATE, TransactionState.PREPARED.get())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider using the constant METADATA_TX_STATE instead of the hardcoded string tx_state to improve code maintainability and readability.

Suggested change
.intValue(METADATA_TX_STATE, TransactionState.PREPARED.get())
.intValue(METADATA_TX_STATE, TransactionState.PREPARED.get())

.build();
clientService.executeContract(
ID_OBJECT_PUT, contractArguments0, ID_OBJECT_PUT_MUTABLE, functionArguments0);
// Make the transaction prepared state and non-expired
storage.put(put);
storageAdmin.truncateTable(COORDINATOR_NAMESPACE, COORDINATOR_STATE_TABLE);

// Act Assert
assertThatThrownBy(
Expand Down
2 changes: 0 additions & 2 deletions ledger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ dependencies {
implementation group: 'com.moandjiezana.toml', name: 'toml4j', version: "${toml4jVersion}"
implementation group: 'info.picocli', name: 'picocli', version: "${picoCliVersion}"
implementation group: 'io.github.resilience4j', name: 'resilience4j-retry', version: "${resilience4jRetryVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: "${log4jVersion}"

// The following packages are provided for ScalarDL contracts in runtime
implementation group: 'org.hashids', name: 'hashids', version: '1.0.3'
Expand Down