You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2024/07/24 12:41:12 UTC
Change in asterixdb[goldfish]: [NO ISSUE][*DB] Add product name to IdentifierUtil
From Michael Blow <mb...@apache.org>:
Michael Blow has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18519 )
Change subject: [NO ISSUE][*DB] Add product name to IdentifierUtil
......................................................................
[NO ISSUE][*DB] Add product name to IdentifierUtil
Ext-ref: MB-60871
Change-Id: I96fd7b1568a18061a3f9a88a88cf53b482743358
---
M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierMappingUtil.java
M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierUtil.java
2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/19/18519/1
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierMappingUtil.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierMappingUtil.java
index 8157125..7f30553 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierMappingUtil.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierMappingUtil.java
@@ -19,12 +19,16 @@
package org.apache.asterix.common.utils;
+import static org.apache.asterix.common.api.IIdentifierMapper.Modifier.NONE;
import static org.apache.asterix.common.utils.IdentifierUtil.DATASET;
import static org.apache.asterix.common.utils.IdentifierUtil.DATAVERSE;
+import static org.apache.asterix.common.utils.IdentifierUtil.PRODUCT_NAME;
import org.apache.asterix.common.api.IIdentifierMapper;
import org.apache.asterix.common.api.IIdentifierMapper.Modifier;
+import java.util.Objects;
+
public class IdentifierMappingUtil {
private static final String SINGULAR_DATASET = "a dataset";
@@ -57,6 +61,11 @@
default:
throw new IllegalArgumentException("unknown modifier " + modifier);
}
+ case PRODUCT_NAME:
+ if (modifier == NONE) {
+ return PRODUCT_NAME;
+ }
+ throw new IllegalArgumentException("unsupported modifier: " + modifier);
default:
throw new IllegalArgumentException("unmapped identifier: " + identifier);
}
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierUtil.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierUtil.java
index 88b7190..1fc21f2 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierUtil.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/IdentifierUtil.java
@@ -26,6 +26,7 @@
public static final String DATASET = "dataset";
public static final String DATAVERSE = "dataverse";
+ public static final String PRODUCT_NAME = "Apache AsterixDB";
public static String dataset() {
return IdentifierMappingUtil.map(DATASET, NONE);
@@ -38,4 +39,8 @@
public static String dataverse() {
return IdentifierMappingUtil.map(DATAVERSE, NONE);
}
+
+ public static String productName() {
+ return IdentifierMappingUtil.map(PRODUCT_NAME, NONE);
+ }
}
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18519
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: goldfish
Gerrit-Change-Id: I96fd7b1568a18061a3f9a88a88cf53b482743358
Gerrit-Change-Number: 18519
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-MessageType: newchange