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

Reduce size of the variables type used #581

Merged
merged 1 commit into from
Jun 24, 2019
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ public class HugeVariables implements Graph.Variables {
private static final String VARIABLES = "variables";

// Variables properties
private static final String VARIABLE_KEY = "variableKey";
private static final String VARIABLE_TYPE = "variableType";
private static final String VARIABLE_KEY = "varKey";
private static final String VARIABLE_TYPE = "varType";

private static final String BYTE_VALUE = "byteValue";
private static final String BOOLEAN_VALUE = "booleanValue";
private static final String INTEGER_VALUE = "integerValue";
private static final String LONG_VALUE = "longValue";
private static final String FLOAT_VALUE = "floatValue";
private static final String DOUBLE_VALUE = "doubleValue";
private static final String STRING_VALUE = "stringValue";
private static final String BYTE_VALUE = "B";
private static final String BOOLEAN_VALUE = "Z";
private static final String INTEGER_VALUE = "I";
private static final String LONG_VALUE = "L";
private static final String FLOAT_VALUE = "F";
private static final String DOUBLE_VALUE = "D";
private static final String STRING_VALUE = "S";

// Variables properties suffix
private static final String UNIFORM_LIST = "UniformList";
private static final String SET = "Set";
private static final String LIST = "L";
private static final String SET = "S";

private static final String[] TYPES = {
Hidden.hide(BYTE_VALUE),
Expand All @@ -83,13 +83,13 @@ public class HugeVariables implements Graph.Variables {
Hidden.hide(FLOAT_VALUE),
Hidden.hide(DOUBLE_VALUE),
Hidden.hide(STRING_VALUE),
Hidden.hide(BYTE_VALUE + UNIFORM_LIST),
Hidden.hide(BOOLEAN_VALUE + UNIFORM_LIST),
Hidden.hide(INTEGER_VALUE + UNIFORM_LIST),
Hidden.hide(LONG_VALUE + UNIFORM_LIST),
Hidden.hide(FLOAT_VALUE + UNIFORM_LIST),
Hidden.hide(DOUBLE_VALUE + UNIFORM_LIST),
Hidden.hide(STRING_VALUE + UNIFORM_LIST),
Hidden.hide(BYTE_VALUE + LIST),
Hidden.hide(BOOLEAN_VALUE + LIST),
Hidden.hide(INTEGER_VALUE + LIST),
Hidden.hide(LONG_VALUE + LIST),
Hidden.hide(FLOAT_VALUE + LIST),
Hidden.hide(DOUBLE_VALUE + LIST),
Hidden.hide(STRING_VALUE + LIST),
Hidden.hide(BYTE_VALUE + SET),
Hidden.hide(BOOLEAN_VALUE + SET),
Hidden.hide(INTEGER_VALUE + SET),
Expand Down Expand Up @@ -134,19 +134,19 @@ public void initSchema() {
Cardinality.SINGLE);
createPropertyKey(Hidden.hide(STRING_VALUE), DataType.TEXT,
Cardinality.SINGLE);
createPropertyKey(Hidden.hide(BYTE_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(BYTE_VALUE + LIST),
DataType.BYTE, Cardinality.LIST);
createPropertyKey(Hidden.hide(BOOLEAN_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(BOOLEAN_VALUE + LIST),
DataType.BOOLEAN, Cardinality.LIST);
createPropertyKey(Hidden.hide(INTEGER_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(INTEGER_VALUE + LIST),
DataType.INT, Cardinality.LIST);
createPropertyKey(Hidden.hide(LONG_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(LONG_VALUE + LIST),
DataType.LONG, Cardinality.LIST);
createPropertyKey(Hidden.hide(FLOAT_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(FLOAT_VALUE + LIST),
DataType.FLOAT, Cardinality.LIST);
createPropertyKey(Hidden.hide(DOUBLE_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(DOUBLE_VALUE + LIST),
DataType.DOUBLE, Cardinality.LIST);
createPropertyKey(Hidden.hide(STRING_VALUE + UNIFORM_LIST),
createPropertyKey(Hidden.hide(STRING_VALUE + LIST),
DataType.TEXT, Cardinality.LIST);
createPropertyKey(Hidden.hide(BYTE_VALUE + SET),
DataType.BYTE, Cardinality.SET);
Expand Down Expand Up @@ -276,7 +276,7 @@ public String toString() {
private void setProperty(HugeVertex vertex, String key, Object value) {
String suffix;
if (value instanceof List) {
suffix = UNIFORM_LIST;
suffix = LIST;
} else if (value instanceof Set) {
suffix = SET;
} else {
Expand Down Expand Up @@ -331,7 +331,7 @@ private void createVariableVertex(String key, Object value) {
throw Graph.Variables.Exceptions
.dataTypeOfVariableValueNotSupported(value);
}
// AUTOMATIC id
// PrimaryKey id
vertex.assignId(null);

tx.addVertex(vertex);
Expand Down