Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
be9ee23
Initial commit
inv-jishnu Apr 10, 2025
89b9f05
Spotless applied again
inv-jishnu Apr 11, 2025
49c83b6
Removed unused code
inv-jishnu Apr 11, 2025
b2871fb
Merge branch 'master' into feat/data-loader/import-log-2
ypeckstadt Apr 15, 2025
c5c9c0a
Removed unused classes and references
inv-jishnu Apr 15, 2025
4964e8d
Merge branch 'master' into feat/data-loader/import-log-2
inv-jishnu Apr 15, 2025
ff81f5f
Merge branch 'master' into feat/data-loader/import-log-2
inv-jishnu Apr 15, 2025
3934c2a
Improve Javadocs
ypeckstadt Apr 16, 2025
9958f95
Changes
inv-jishnu Apr 21, 2025
1afbc21
Renamed parameters
inv-jishnu Apr 21, 2025
8c5114d
logging changes
inv-jishnu Apr 21, 2025
ffab395
removed repeated code
inv-jishnu Apr 22, 2025
79df1ed
Merge branch 'master' into feat/data-loader/import-log-2
inv-jishnu Apr 22, 2025
cf31672
Merge branch 'master' into feat/data-loader/import-log-2
brfrn169 Apr 23, 2025
6dd213e
Added excetpion throw
inv-jishnu Apr 23, 2025
6542177
Synchronisation changes
inv-jishnu Apr 25, 2025
603e46e
Added volatile back to fix spotbugs issue
inv-jishnu Apr 25, 2025
eaf9d88
Removed unused variable
inv-jishnu Apr 25, 2025
502034e
Chanaged LOGGER to logger
inv-jishnu Apr 30, 2025
6b22d1a
logger name change in test
inv-jishnu Apr 30, 2025
7d5ad8c
Fix warnings and rename logger
inv-jishnu Apr 30, 2025
afd58f4
Fix added for warning and supress warning added for lombok related wa…
inv-jishnu Apr 30, 2025
3652f10
Merged latest changes from master after resolving conflicts
inv-jishnu May 14, 2025
cc5365b
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu May 15, 2025
570ab38
Merge branch 'master' into fix/data-loader/logger-rename
ypeckstadt May 22, 2025
977c6af
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu May 27, 2025
bcc3547
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu May 28, 2025
37c7b3b
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 2, 2025
2be52e5
Resolved conflicts and merged changes from master
inv-jishnu Jun 9, 2025
2018640
Merge branch 'master' into fix/data-loader/logger-rename
ypeckstadt Jun 11, 2025
5fba851
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 11, 2025
3de9ad7
Added annotation for same name but different
inv-jishnu Jun 11, 2025
f5bb662
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 11, 2025
0f03536
Changd put to mutate
inv-jishnu Jun 11, 2025
bfad6d3
Removed constant formatter to fix warning
inv-jishnu Jun 11, 2025
be503d6
Revert "Changd put to mutate"
inv-jishnu Jun 12, 2025
ac03202
Changes
inv-jishnu Jun 12, 2025
862bbb2
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 12, 2025
eecf28a
Scan order updated
inv-jishnu Jun 13, 2025
7e3784b
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 13, 2025
e179656
Fixed symbol not found issue
inv-jishnu Jun 13, 2025
f75d31b
Javadoc related fixes
inv-jishnu Jun 13, 2025
06a4a9a
Java doc related changes -2
inv-jishnu Jun 13, 2025
db73e47
Javadoc changes and removed an unused file
inv-jishnu Jun 16, 2025
0d30850
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 16, 2025
a2756c1
Merge branch 'master' into fix/data-loader/logger-rename
inv-jishnu Jun 16, 2025
52824bc
Merge branch 'master' into fix/data-loader/logger-rename
brfrn169 Jun 17, 2025
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 @@ -9,6 +9,7 @@
* <p>This class holds the metadata for a column, including the namespace (schema), table name, and
* the column name within the table.
*/
@SuppressWarnings("SameNameButDifferent")
@Value
@Builder
public class ColumnInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Value;

/** * The scan range which is used in data export scan filtering */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** * The scan range which is used in data export scan filtering */
/** The scan range which is used in data export scan filtering. */

@SuppressWarnings("SameNameButDifferent")
@Value
public class ScanRange {
/** The key for scan start filter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"SameNameButDifferent", "FutureReturnValueIgnored"})
@RequiredArgsConstructor
public abstract class ExportManager {
private static final Logger logger = LoggerFactory.getLogger(ExportManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import lombok.Builder;
import lombok.Data;

/** Options for a ScalarDB export data operation */
@SuppressWarnings("SameNameButDifferent")
/** Options for a ScalarDB export data operation. */
@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder(builderMethodName = "hiddenBuilder")
@Data
public class ExportOptions {
Expand All @@ -31,6 +31,15 @@ public class ExportOptions {
@Builder.Default private List<String> projectionColumns = Collections.emptyList();
private List<Scan.Ordering> sortOrders;

/**
* Generates and returns an export options builder.
*
* @param namespace namespaces for export
* @param tableName tableName for export
* @param scanPartitionKey scan partition key for export
* @param outputFileFormat output file format for export
* @return a configured export options builder
*/
public static ExportOptionsBuilder builder(
String namespace, String tableName, Key scanPartitionKey, FileFormat outputFileFormat) {
return hiddenBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JsonLineProducerTask extends ProducerTask {

private final DataLoaderObjectMapper objectMapper = new DataLoaderObjectMapper();
private static final Logger logger = LoggerFactory.getLogger(JsonLineProducerTask.class);

/**
* Class constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JsonProducerTask extends ProducerTask {

private final DataLoaderObjectMapper objectMapper = new DataLoaderObjectMapper();
private final boolean prettyPrintJson;
private static final Logger logger = LoggerFactory.getLogger(JsonProducerTask.class);

/**
* Class constructor
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Map;
import lombok.RequiredArgsConstructor;

@SuppressWarnings("SameNameButDifferent")
@RequiredArgsConstructor
public class ProducerTaskFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* A validator for ensuring that export options are consistent with the ScalarDB table metadata and
* follow the defined constraints.
*/
@SuppressWarnings("SameNameButDifferent")
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ExportOptionsValidator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* <li>Notifying listeners of various import events
* </ul>
*/
@SuppressWarnings("SameNameButDifferent")
@AllArgsConstructor
public class ImportManager implements ImportEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import lombok.Builder;
import lombok.Data;

/** Import options to import data into one or more ScalarDB tables */
/** Import options to import data into one or more ScalarDB tables. */
@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder
@Data
public class ImportOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Represents a control file that holds control file tables which contains the column mappings that
* maps a source file column to the actual database table column.
*/
@SuppressWarnings("SameNameButDifferent")
@Getter
@Setter
public class ControlFile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* table name, and field mappings. This class is used to define how data from a control file maps to
* a specific table in ScalarDB.
*/
@SuppressWarnings("SameNameButDifferent")
@Getter
@Setter
public class ControlFileTable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* This class defines how data from a specific field in the input source should be mapped to the
* corresponding column in the database.
*/
@SuppressWarnings("SameNameButDifferent")
@Getter
@Setter
public class ControlFileTableFieldMapping {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import lombok.Builder;
import lombok.Data;

/** * Import data chunk data */
/** * Import data chunk data. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** * Import data chunk data. */
/** Import data chunk data. */

@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Data
@Builder
public class ImportDataChunk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import lombok.Builder;
import lombok.Data;

/** * A DTO to store import data chunk details */
/** * A DTO to store import data chunk details. */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** * A DTO to store import data chunk details. */
/** A DTO to store import data chunk details. */

@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Data
@Builder
@JsonDeserialize(builder = ImportDataChunkStatus.ImportDataChunkStatusBuilder.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import com.fasterxml.jackson.databind.JsonNode;
import lombok.Value;

/** Stores data related to a single row on import file */
/** Stores data related to a single row on import file. */
@SuppressWarnings("SameNameButDifferent")
@Value
public class ImportRow {
int rowNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* logging transaction batch results and managing event listeners. Concrete implementations should
* define how to log transaction batches and handle errors.
*/
@SuppressWarnings("SameNameButDifferent")
@RequiredArgsConstructor
public abstract class AbstractImportLogger implements ImportEventListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
@Value
@Builder
@SuppressWarnings("SameNameButDifferent")
public class ImportLoggerConfig {
/**
* The directory path where log files will be stored. This path should end with a directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* it creates. It's annotated with Lombok's {@code @AllArgsConstructor} to automatically generate a
* constructor that initializes the configuration field.
*/
@SuppressWarnings("SameNameButDifferent")
@AllArgsConstructor
public class DefaultLogWriterFactory implements LogWriterFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
* supports both transactional and non-transactional (storage) modes and provides event notification
* capabilities for monitoring the import process.
*/
@SuppressWarnings("SameNameButDifferent")
@RequiredArgsConstructor
public abstract class ImportProcessor {

final ImportProcessorParams params;
private static final Logger LOGGER = LoggerFactory.getLogger(ImportProcessor.class);
private static final Logger logger = LoggerFactory.getLogger(ImportProcessor.class);
private final List<ImportEventListener> listeners = new ArrayList<>();

/**
Expand Down Expand Up @@ -316,13 +317,13 @@ private ImportTransactionBatchResult processTransactionBatch(

} catch (TransactionException e) {
isSuccess = false;
LOGGER.error(e.getMessage());
logger.error(e.getMessage());
try {
if (transaction != null) {
transaction.abort(); // Ensure transaction is aborted
}
} catch (TransactionException abortException) {
LOGGER.error(
logger.error(
"Failed to abort transaction: {}", abortException.getMessage(), abortException);
}
error = e.getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* <p>This class is immutable and uses the Builder pattern for construction. It encapsulates all
* required parameters and dependencies for processing data imports in ScalarDB.
*/
@SuppressWarnings("SameNameButDifferent")
@Builder
@Value
public class ImportProcessorParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* functionality to import data into single or multiple tables based on the provided import options
* and control file configurations.
*/
@SuppressWarnings({"SameNameButDifferent"})
@RequiredArgsConstructor
public abstract class ImportTask {

Expand Down Expand Up @@ -148,7 +149,8 @@ private List<ImportTargetResult> startMultiTableImportProcess(
copyNode);
targetResults.add(result);
}
return targetResults;
// Wrapped in unmodifiable list to fix MixedMutabilityReturnType error-prone warning
return Collections.unmodifiableList(targetResults);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Parameters required for executing an import task in the data loader. This class encapsulates all
* necessary information needed to process and import a single record into ScalarDB.
*/
@SuppressWarnings("SameNameButDifferent")
@Builder
@Value
public class ImportTaskParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import com.scalar.db.api.DistributedTransaction;
import com.scalar.db.api.Result;
import com.scalar.db.dataloader.core.dataimport.dao.ScalarDbDaoException;
import com.scalar.db.exception.transaction.AbortException;
import com.scalar.db.exception.transaction.TransactionException;
import com.scalar.db.io.Column;
import com.scalar.db.io.Key;
import java.util.List;
Expand Down Expand Up @@ -83,24 +81,4 @@ protected void saveRecord(
throws ScalarDbDaoException {
params.getDao().put(namespace, tableName, partitionKey, clusteringKey, columns, transaction);
}

/**
* Aborts the active ScalarDB transaction if it has not been committed.
*
* <p>This method provides a safe way to abort an active transaction, handling any abort-related
* exceptions by wrapping them in a {@link TransactionException}.
*
* @param tx the transaction to be aborted. If null, this method does nothing
* @throws TransactionException if an error occurs during the abort operation or if the underlying
* abort operation fails
*/
private void abortActiveTransaction(DistributedTransaction tx) throws TransactionException {
if (tx != null) {
try {
tx.abort();
} catch (AbortException e) {
throw new TransactionException(e.getMessage(), tx.getId());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import lombok.Builder;
import lombok.Value;

/** To store import target result. */
@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder
@Value
public class ImportTargetResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.Builder;
import lombok.Value;

@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder
@Value
@JsonDeserialize(builder = ImportTaskResult.ImportTaskResultBuilder.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,29 @@ public void addErrorMessage(String columnName, String errorMessage) {
this.errorMessages.add(errorMessage);
}

/** @return Immutable list of validation error messages */
/**
* Return error messages list.
*
* @return Immutable list of validation error messages.
*/
public List<String> getErrorMessages() {
return Collections.unmodifiableList(this.errorMessages);
}

/** @return Immutable set of columns that had errors */
/**
* A set of columns with errors is stored and returned.
*
* @return Immutable set of columns that had errors.
*/
public Set<String> getColumnsWithErrors() {
return Collections.unmodifiableSet(this.columnsWithErrors);
}

/** @return Validation is valid or not */
/**
* Stores validation result.
*
* @return Validation is valid or not.
*/
public boolean isValid() {
return this.errorMessages.isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

@SuppressWarnings("SameNameButDifferent")
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ImportSourceRecordValidator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import lombok.Value;

/** Transaction batch details */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** Transaction batch details */
/** Transaction batch details. */

@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder
@Value
public class ImportTransactionBatch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.Value;

/** Transaction batch result */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/** Transaction batch result */
/** Transaction batch result. */

@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder
@Value
@JsonDeserialize(builder = ImportTransactionBatchResult.ImportTransactionBatchResultBuilder.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import lombok.Builder;
import lombok.Value;

/** Batch status details */
/** Batch status details. */
@SuppressWarnings({"SameNameButDifferent", "MissingSummary"})
@Builder
@Value
public class ImportTransactionBatchStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.Getter;

/** Represents the request for metadata for a single ScalarDB table */
@SuppressWarnings("SameNameButDifferent")
@Getter
public class TableMetadataRequest {

Expand Down
Loading