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
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ subprojects {
googleJavaFormatVersion = '1.7'
dockerPluginVersion = '0.34.0'
bouncyCastleCryptoVersion = '1.70'
partiqlVersion = '1.2.2'

dockerVersion = project.properties['dockerVersion'] ?: project.version
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class Constants {
// Metadata
public static final String PACKAGE = "table";
public static final String VERSION = "v1_0_0";
public static final String CONTRACT_CREATE = PACKAGE + "." + VERSION + ".Create";
public static final String CONTRACT_INSERT = PACKAGE + "." + VERSION + ".Insert";
Comment on lines +10 to +11

Choose a reason for hiding this comment

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

medium

It is recommended to maintain consistency in the order of declarations. Consider placing CONTRACT_CREATE and CONTRACT_INSERT after CONTRACT_GET_ASSET_ID and CONTRACT_SCAN to maintain alphabetical order.

Suggested change
public static final String CONTRACT_CREATE = PACKAGE + "." + VERSION + ".Create";
public static final String CONTRACT_INSERT = PACKAGE + "." + VERSION + ".Insert";
public static final String CONTRACT_GET_ASSET_ID = PACKAGE + "." + VERSION + ".GetAssetId";
public static final String CONTRACT_SCAN = PACKAGE + "." + VERSION + ".Scan";
public static final String CONTRACT_CREATE = PACKAGE + "." + VERSION + ".Create";
public static final String CONTRACT_INSERT = PACKAGE + "." + VERSION + ".Insert";

public static final String CONTRACT_GET_ASSET_ID = PACKAGE + "." + VERSION + ".GetAssetId";
public static final String CONTRACT_SCAN = PACKAGE + "." + VERSION + ".Scan";

Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include 'rpc'
include 'client'
include 'schema-loader'
include 'generic-contracts'
include 'table-store'
52 changes: 52 additions & 0 deletions table-store/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
plugins {
id 'net.ltgt.errorprone' version "${errorpronePluginVersion}"
id "com.github.spotbugs" version "${spotbugsPluginVersion}"
}

dependencies {
implementation project(':client')
implementation project(':generic-contracts')
implementation group: 'org.partiql', name: 'partiql-parser', version: "${partiqlVersion}"

// for Error Prone
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
errorproneJavac "com.google.errorprone:javac:${errorproneJavacVersion}"

// for SpotBugs
spotbugs "com.github.spotbugs:spotbugs:${spotbugsVersion}"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
}

spotless {
java {
target 'src/*/java/**/*.java'
importOrder()
removeUnusedImports()
googleJavaFormat('1.7')
}
}

spotbugs {
ignoreFailures = false
showStackTraces = true
showProgress = true
effort = 'default'
reportLevel = 'default'
maxHeapSize = '1g'
extraArgs = [ '-nested:false' ]
jvmArgs = [ '-Duser.language=en' ]
}

spotbugsMain.reports {
html.enabled = true
}

spotbugsTest.reports {
html.enabled = true
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package com.scalar.dl.tablestore.client.error;

import com.scalar.dl.ledger.error.ScalarDlError;
import com.scalar.dl.ledger.service.StatusCode;

public enum TableStoreClientError implements ScalarDlError {

//
// Errors for INVALID_ARGUMENT(414)
//
SYNTAX_ERROR_IN_PARTIQL_PARSER(
StatusCode.INVALID_ARGUMENT,
"001",
"Syntax error. Line=%d, Offset=%d, Length=%d, Code=%s",
"",
""),
SYNTAX_ERROR_INVALID_PRIMARY_KEY_SPECIFICATION(
StatusCode.INVALID_ARGUMENT,
"002",
"Syntax error. The primary key column must be specified only once in a table.",
"",
""),
SYNTAX_ERROR_INVALID_COLUMN_CONSTRAINTS(
StatusCode.INVALID_ARGUMENT,
"003",
"Syntax error. The specified column constraint is invalid.",
"",
""),
SYNTAX_ERROR_INVALID_DATA_TYPE(
StatusCode.INVALID_ARGUMENT,
"004",
"Syntax error. The specified data type is invalid.",
"",
""),
SYNTAX_ERROR_INVALID_INSERT_STATEMENT(
StatusCode.INVALID_ARGUMENT,
"005",
"Syntax error. The specified insert statement is invalid.",
"",
""),
SYNTAX_ERROR_INVALID_STATEMENT(
StatusCode.INVALID_ARGUMENT,
"006",
"Syntax error. The specified statement is invalid.",
"",
""),
SYNTAX_ERROR_INVALID_EXPRESSION(
StatusCode.INVALID_ARGUMENT,
"007",
"Syntax error. The specified expression is invalid. Expression: %s",
"",
""),
SYNTAX_ERROR_INVALID_LITERAL(
StatusCode.INVALID_ARGUMENT,
"008",
"Syntax error. The specified literal is invalid. Literal: %s",
"",
""),
;

private static final String COMPONENT_NAME = "DL-TABLE-STORE";

private final StatusCode statusCode;
private final String id;
private final String message;
private final String cause;
private final String solution;

TableStoreClientError(
StatusCode statusCode, String id, String message, String cause, String solution) {
validate(COMPONENT_NAME, statusCode, id, message, cause, solution);

this.statusCode = statusCode;
this.id = id;
this.message = message;
this.cause = cause;
this.solution = solution;
}

@Override
public String getComponentName() {
return COMPONENT_NAME;
}

@Override
public StatusCode getStatusCode() {
return statusCode;
}

@Override
public String getId() {
return id;
}

@Override
public String getMessage() {
return message;
}

@Override
public String getCause() {
return cause;
}

@Override
public String getSolution() {
return solution;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.scalar.dl.tablestore.client.partiql;

public enum DataType {
BOOLEAN,
NUMBER,
STRING,
}
Loading