Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import log classes and utils #2463

Draft
wants to merge 21 commits into
base: feat/data-loader/import-process
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e982d74
Add admin interface and operation attributes things for Attribute-Bas…
brfrn169 Dec 24, 2024
7faf7a5
Bump org.assertj:assertj-core from 3.26.3 to 3.27.0 in the dependenci…
dependabot[bot] Dec 25, 2024
8155eba
Add prefix to error code (#2444)
brfrn169 Jan 6, 2025
eba0c63
Fix Slf4j providers not found error (#2420)
Torch3333 Jan 6, 2025
e8de4c5
Bump the dependencies group with 2 updates (#2451)
dependabot[bot] Jan 7, 2025
a2a68f9
Add export options validator (#2435)
inv-jishnu Jan 7, 2025
822db19
Add utility setter methods for ImmutableMap to AbacOperationAttribute…
brfrn169 Jan 9, 2025
3abd13b
Initial commit
inv-jishnu Jan 9, 2025
9f0411b
Merge branch 'feat/data-loader/import-process' into feat/data-loader/…
inv-jishnu Jan 13, 2025
95183e9
Merge branch 'feat/data-loader/import-process' into feat/data-loader/…
inv-jishnu Jan 14, 2025
10409a8
Change code to be compatible with java 8
inv-jishnu Jan 14, 2025
0180a37
Change code to be compatible with java 8 -2
inv-jishnu Jan 14, 2025
8c96c1a
Fix missing unit tests for MariaDB RdbEngine (#2465)
Torch3333 Jan 20, 2025
c021b26
Add name to NamespacePolicy and TablePolicy (#2466)
brfrn169 Jan 20, 2025
029ad09
Bump the dependencies group across 1 directory with 5 updates (#2472)
dependabot[bot] Jan 21, 2025
86c26d3
Add time related types (#2468)
Torch3333 Jan 21, 2025
99f8b45
Remove unnecessary loggings in statement handlers (#2469)
KodaiD Jan 22, 2025
46726d9
Add importTable without overrideColumnsType to DecoratedDistributedTr…
brfrn169 Jan 22, 2025
040c85d
Update Scheduled Vulnerability Check and Dependabot configuration (#2…
brfrn169 Jan 24, 2025
a6d627e
Update ScalarDB dependency version to 3.15.0 in README (#2480)
brfrn169 Jan 24, 2025
b83215e
Merge branch 'master' into feat/data-loader/import-log
inv-jishnu Jan 28, 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
Prev Previous commit
Next Next commit
Add utility setter methods for ImmutableMap to AbacOperationAttributes (
brfrn169 authored Jan 9, 2025

Verified

This commit was signed with the committer’s verified signature.
oliverklee Oliver Klee
commit 822db196c41c4305e33576eea350aec7e8b57661
11 changes: 11 additions & 0 deletions core/src/main/java/com/scalar/db/api/AbacOperationAttributes.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.scalar.db.api;

import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.Optional;

@@ -16,6 +17,11 @@ public static void setReadTag(Map<String, String> attributes, String policyName,
attributes.put(READ_TAG_PREFIX + policyName, readTag);
}

public static void setReadTag(
ImmutableMap.Builder<String, String> attributesBuilder, String policyName, String readTag) {
attributesBuilder.put(READ_TAG_PREFIX + policyName, readTag);
}

public static void clearReadTag(Map<String, String> attributes, String policyName) {
attributes.remove(READ_TAG_PREFIX + policyName);
}
@@ -29,6 +35,11 @@ public static void setWriteTag(
attributes.put(WRITE_TAG_PREFIX + policyName, writeTag);
}

public static void setWriteTag(
ImmutableMap.Builder<String, String> attributesBuilder, String policyName, String writeTag) {
attributesBuilder.put(WRITE_TAG_PREFIX + policyName, writeTag);
}

public static void clearWriteTag(Map<String, String> attributes, String policyName) {
attributes.remove(WRITE_TAG_PREFIX + policyName);
}
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import com.google.common.collect.ImmutableMap;
import com.scalar.db.io.Key;
import java.util.HashMap;
import java.util.Map;
@@ -11,7 +12,7 @@
public class AbacOperationAttributesTest {

@Test
public void setReadTag_ShouldSetReadTag() {
public void setReadTag_MapGiven_ShouldSetReadTag() {
// Arrange
Map<String, String> attributes = new HashMap<>();
String policyName = "policyName";
@@ -25,6 +26,21 @@ public void setReadTag_ShouldSetReadTag() {
.containsEntry(AbacOperationAttributes.READ_TAG_PREFIX + policyName, readTag);
}

@Test
public void setReadTag_ImmutableMapBuilderGiven_ShouldSetReadTag() {
// Arrange
ImmutableMap.Builder<String, String> attributesBuilder = ImmutableMap.builder();
String policyName = "policyName";
String readTag = "readTag";

// Act
AbacOperationAttributes.setReadTag(attributesBuilder, policyName, readTag);

// Assert
assertThat(attributesBuilder.build())
.containsEntry(AbacOperationAttributes.READ_TAG_PREFIX + policyName, readTag);
}

@Test
public void clearReadTag_ShouldClearReadTag() {
// Arrange
@@ -60,7 +76,7 @@ public void clearReadTags_ShouldClearReadTags() {
}

@Test
public void setWriteTag_ShouldSetWriteTag() {
public void setWriteTag_MapGiven_ShouldSetWriteTag() {
// Arrange
Map<String, String> attributes = new HashMap<>();
String policyName = "policyName";
@@ -74,6 +90,21 @@ public void setWriteTag_ShouldSetWriteTag() {
.containsEntry(AbacOperationAttributes.WRITE_TAG_PREFIX + policyName, writeTag);
}

@Test
public void setWriteTag_ImmutableMapBuilderGiven_ShouldSetWriteTag() {
// Arrange
ImmutableMap.Builder<String, String> attributesBuilder = ImmutableMap.builder();
String policyName = "policyName";
String writeTag = "writeTag";

// Act
AbacOperationAttributes.setWriteTag(attributesBuilder, policyName, writeTag);

// Assert
assertThat(attributesBuilder.build())
.containsEntry(AbacOperationAttributes.WRITE_TAG_PREFIX + policyName, writeTag);
}

@Test
public void clearWriteTag_ShouldClearWriteTag() {
// Arrange