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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public interface CacheCommand<T> extends Message {

ExecutionContext getExecutionContext();
ExecutionContext getExecutionContext();

T call() throws Exception;
}
249 changes: 109 additions & 140 deletions api/src/main/java/org/eclipse/daanse/olap/api/CacheControl.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

public interface CatalogCache {

void clear();
void clear();

}
391 changes: 157 additions & 234 deletions api/src/main/java/org/eclipse/daanse/olap/api/CatalogReader.java

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions api/src/main/java/org/eclipse/daanse/olap/api/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@
package org.eclipse.daanse.olap.api;

public enum Command {
BEGIN,
COMMIT,
ROLLBACK
BEGIN, COMMIT, ROLLBACK
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public class ConfigConstants {
public static final String EXECUTE_DURATION = "executeDuration";
public static final String EXECUTE_DURATION_UNIT = "executeDurationUnit";


public static final Integer QUERY_LIMIT_DEFAULT_VALUE = 40;
public static final String SEGMENT_CACHE_DEFAULT_VALUE = null;
public static final Boolean ENABLE_TOTAL_COUNT_DEFAULT_VALUE = false;
Expand Down
117 changes: 59 additions & 58 deletions api/src/main/java/org/eclipse/daanse/olap/api/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.eclipse.daanse.sql.guard.api.SqlGuardFactory;

/**
* The Context gives access to all resources and configurations that are needed
* The Context gives access to all resources and configurations that are needed
* to calculate and Data Cubes
*
* @author stbischof
Expand All @@ -42,27 +42,27 @@
*/
public interface Context<C extends Connection> {

List<String> KEYWORD_LIST = List.of("$AdjustedProbability",
"$Distance", "$Probability", "$ProbabilityStDev", "$ProbabilityStdDeV", "$ProbabilityVariance", "$StDev",
"$StdDeV", "$Support", "$Variance", "AddCalculatedMembers", "Action", "After", "Aggregate", "All", "Alter",
"Ancestor", "And", "Append", "As", "ASC", "Axis", "Automatic", "Back_Color", "BASC", "BDESC", "Before",
"Before_And_After", "Before_And_Self", "Before_Self_After", "BottomCount", "BottomPercent", "BottomSum",
"Break", "Boolean", "Cache", "Calculated", "Call", "Case", "Catalog_Name", "Cell", "Cell_Ordinal", "Cells",
"Chapters", "Children", "Children_Cardinality", "ClosingPeriod", "Cluster", "ClusterDistance",
"ClusterProbability", "Clusters", "CoalesceEmpty", "Column_Values", "Columns", "Content", "Contingent",
"Continuous", "Correlation", "Cousin", "Covariance", "CovarianceN", "Create", "CreatePropertySet",
"CrossJoin", "Cube", "Cube_Name", "CurrentMember", "CurrentCube", "Custom", "Cyclical", "DefaultMember",
"Default_Member", "DESC", "Descendents", "Description", "Dimension", "Dimension_Unique_Name", "Dimensions",
"Discrete", "Discretized", "DrillDownLevel", "DrillDownLevelBottom", "DrillDownLevelTop", "DrillDownMember",
"DrillDownMemberBottom", "DrillDownMemberTop", "DrillTrough", "DrillUpLevel", "DrillUpMember", "Drop",
"Else", "Empty", "End", "Equal_Areas", "Exclude_Null", "ExcludeEmpty", "Exclusive", "Expression", "Filter",
"FirstChild", "FirstRowset", "FirstSibling", "Flattened", "Font_Flags", "Font_Name", "Font_size",
"Fore_Color", "Format_String", "Formatted_Value", "Formula", "From", "Generate", "Global", "Head",
"Hierarchize", "Hierarchy", "Hierary_Unique_name", "IIF", "IsEmpty", "Include_Null", "Include_Statistics",
"Inclusive", "Input_Only", "IsDescendant", "Item", "Lag", "LastChild", "LastPeriods", "LastSibling", "Lead",
"Level", "Level_Number", "Level_Unique_Name", "Levels", "LinRegIntercept", "LinRegR2", "LinRegPoint",
"LinRegSlope", "LinRegVariance", "Long", "MaxRows", "Median", "Member", "Member_Caption", "Member_Guid",
"Member_Name", "Member_Ordinal", "Member_Type", "Member_Unique_Name", "Members", "Microsoft_Clustering",
List<String> KEYWORD_LIST = List.of("$AdjustedProbability", "$Distance", "$Probability", "$ProbabilityStDev",
"$ProbabilityStdDeV", "$ProbabilityVariance", "$StDev", "$StdDeV", "$Support", "$Variance",
"AddCalculatedMembers", "Action", "After", "Aggregate", "All", "Alter", "Ancestor", "And", "Append", "As",
"ASC", "Axis", "Automatic", "Back_Color", "BASC", "BDESC", "Before", "Before_And_After", "Before_And_Self",
"Before_Self_After", "BottomCount", "BottomPercent", "BottomSum", "Break", "Boolean", "Cache", "Calculated",
"Call", "Case", "Catalog_Name", "Cell", "Cell_Ordinal", "Cells", "Chapters", "Children",
"Children_Cardinality", "ClosingPeriod", "Cluster", "ClusterDistance", "ClusterProbability", "Clusters",
"CoalesceEmpty", "Column_Values", "Columns", "Content", "Contingent", "Continuous", "Correlation", "Cousin",
"Covariance", "CovarianceN", "Create", "CreatePropertySet", "CrossJoin", "Cube", "Cube_Name",
"CurrentMember", "CurrentCube", "Custom", "Cyclical", "DefaultMember", "Default_Member", "DESC",
"Descendents", "Description", "Dimension", "Dimension_Unique_Name", "Dimensions", "Discrete", "Discretized",
"DrillDownLevel", "DrillDownLevelBottom", "DrillDownLevelTop", "DrillDownMember", "DrillDownMemberBottom",
"DrillDownMemberTop", "DrillTrough", "DrillUpLevel", "DrillUpMember", "Drop", "Else", "Empty", "End",
"Equal_Areas", "Exclude_Null", "ExcludeEmpty", "Exclusive", "Expression", "Filter", "FirstChild",
"FirstRowset", "FirstSibling", "Flattened", "Font_Flags", "Font_Name", "Font_size", "Fore_Color",
"Format_String", "Formatted_Value", "Formula", "From", "Generate", "Global", "Head", "Hierarchize",
"Hierarchy", "Hierary_Unique_name", "IIF", "IsEmpty", "Include_Null", "Include_Statistics", "Inclusive",
"Input_Only", "IsDescendant", "Item", "Lag", "LastChild", "LastPeriods", "LastSibling", "Lead", "Level",
"Level_Number", "Level_Unique_Name", "Levels", "LinRegIntercept", "LinRegR2", "LinRegPoint", "LinRegSlope",
"LinRegVariance", "Long", "MaxRows", "Median", "Member", "Member_Caption", "Member_Guid", "Member_Name",
"Member_Ordinal", "Member_Type", "Member_Unique_Name", "Members", "Microsoft_Clustering",
"Microsoft_Decision_Trees", "Mining", "Model", "Model_Existence_Only", "Models", "Move", "MTD", "Name",
"Nest", "NextMember", "Non", "NonEmpty", "Normal", "Not", "Ntext", "Nvarchar", "OLAP", "On",
"OpeningPeriod", "OpenQuery", "Or", "Ordered", "Ordinal", "Pages", "ParallelPeriod", "Parent",
Expand All @@ -78,73 +78,74 @@ public interface Context<C extends Connection> {
"TupleToStr", "Under", "Uniform", "UniqueName", "Use", "Value", "Var", "Variance", "VarP", "VarianceP",
"VisualTotals", "When", "Where", "With", "WTD", "Xor");

CatalogCache getCatalogCache();
CatalogCache getCatalogCache();

/**
* Gives access to the javax.sql.DataSource that holds the java.sql.Connection}s to
* the Database.
* Gives access to the javax.sql.DataSource that holds the java.sql.Connection}s
* to the Database.
*
* @return DataSource
*/
DataSource getDataSource();

/**
* Gives access to the Dialect that must be used to generate SQL querys
* against the javax.sql.DataSource.
* Gives access to the Dialect that must be used to generate SQL querys against
* the javax.sql.DataSource.
*
* @return DataSource
*/
Dialect getDialect();

/**
* Gives access to a QueryProvider.
* Gives access to a QueryProvider.
*
* @return QueryProvider.
* @return QueryProvider.
*/
// QueryProvider getQueryProvider();
/*
* The human readable name of the Context. By default the name of the Schema.
* May be overridden.
*/
String getName();

/*
* The human readable description of the Context. By default the getDescription
* of the Schema. May be overridden.
*/
Optional<String> getDescription();
List<String> getAccessRoles();

ExpressionCompilerFactory getExpressionCompilerFactory();

/*
* Gives access to the Connection.
*/
C getConnectionWithDefaultRole();
/*
* The human readable name of the Context. By default the name of the Schema.
* May be overridden.
*/
String getName();

C getConnection(ConnectionProps props);
/*
* The human readable description of the Context. By default the getDescription
* of the Schema. May be overridden.
*/
Optional<String> getDescription();

List<String> getAccessRoles();

ExpressionCompilerFactory getExpressionCompilerFactory();

/*
* Gives access to the Connection.
*/
C getConnectionWithDefaultRole();

C getConnection(ConnectionProps props);

void addConnection(C rolapConnection);
void addConnection(C rolapConnection);

void removeConnection(C rolapConnection);
void removeConnection(C rolapConnection);

ResultShepherd getResultShepherd();
ResultShepherd getResultShepherd();

// AggregationManager getAggregationManager();

void addStatement(Statement statement);
void addStatement(Statement statement);

void removeStatement(Statement internalStatement);
void removeStatement(Statement internalStatement);

EventBus getMonitor();
EventBus getMonitor();

List<Statement> getStatements(C connection);
List<Statement> getStatements(C connection);

<T> T getConfigValue(String key, T dflt ,Class<T> clazz);
<T> T getConfigValue(String key, T dflt, Class<T> clazz);

Semaphore getQueryLimitSemaphore();

Optional<Map<Object, Object>> getSqlMemberSourceValuePool();
Optional<Map<Object, Object>> getSqlMemberSourceValuePool();

FunctionService getFunctionService();

Expand Down
10 changes: 4 additions & 6 deletions api/src/main/java/org/eclipse/daanse/olap/api/ContextGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,21 @@
import java.util.List;

/**
* The ContextGroup gives access to a set of Contexts.
* It guarantees that names of the Contexts are unique in the group.
* The ContextGroup gives access to a set of Contexts. It guarantees that names
* of the Contexts are unique in the group.
*
* @author stbischof
*
*/
public interface ContextGroup {

/**
* Gives access to the valid Contexts.
* Gives access to the valid Contexts.
*
* A Context is only valid, if it in unique in the this Group.
*
* @return Context
*/
List<Context<?>> getValidContexts();


List<Context<?>> getValidContexts();

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

public interface CubeMember extends Member {

String getMemberUniqueName();
String getMemberUniqueName();

}
79 changes: 40 additions & 39 deletions api/src/main/java/org/eclipse/daanse/olap/api/DataType.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,48 @@
//TODO: REMOVE and use New Type System. when this is free from inner values
public enum DataType {

ARRAY("array", "Array"), //
CUBE("cube", "Cube"), //
DATE_TIME("datetime", "DateTime"), //
DIMENSION("dimension", "Dimension"), //
EMPTY("empty", "Empty"), //
HIERARCHY("hierarchy", "Hierarchy"), //
INTEGER("integer", "Integer"), //
LEVEL("level", "Level"), //
LOGICAL("logical", "Logical Expression"), //
MEMBER("member", "Member"), //
NULL("null", "Null"), //
NUMERIC("numeric", "Numeric Expression"), //
SET("set", "Set"), //
STRING("string", "String"), //
SYMBOL("symbol", "Symbol"), //
TUPLE("tuple", "Tuple"), //
UNKNOWN("unknown", "Unknown"), //
/**
* A Category.VALUE is a expression that results in a string or numeric.
*/
VALUE("value", "Value");
ARRAY("array", "Array"), //
CUBE("cube", "Cube"), //
DATE_TIME("datetime", "DateTime"), //
DIMENSION("dimension", "Dimension"), //
EMPTY("empty", "Empty"), //
HIERARCHY("hierarchy", "Hierarchy"), //
INTEGER("integer", "Integer"), //
LEVEL("level", "Level"), //
LOGICAL("logical", "Logical Expression"), //
MEMBER("member", "Member"), //
NULL("null", "Null"), //
NUMERIC("numeric", "Numeric Expression"), //
SET("set", "Set"), //
STRING("string", "String"), //
SYMBOL("symbol", "Symbol"), //
TUPLE("tuple", "Tuple"), //
UNKNOWN("unknown", "Unknown"), //
/**
* A Category.VALUE is a expression that results in a string or numeric.
*/
VALUE("value", "Value");

private String name;
private String prittyName;
private String name;
private String prittyName;

DataType(String name, String prittyName) {
this.name = name;
this.prittyName = prittyName;
}
DataType(String name, String prittyName) {
this.name = name;
this.prittyName = prittyName;
}

public boolean isScalar() {
return switch (this) {
case VALUE, LOGICAL, NUMERIC, INTEGER, STRING, DATE_TIME -> true;
default -> false;
};
}
public boolean isScalar() {
return switch (this) {
case VALUE, LOGICAL, NUMERIC, INTEGER, STRING, DATE_TIME -> true;
default -> false;
};
}

public String getName() {
return name;
}
public String getPrittyName() {
return prittyName;
}
public String getName() {
return name;
}

public String getPrittyName() {
return prittyName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public enum DataTypeJdbc {

NUMERIC("Numeric"),

INTEGER("Integer"),
DECIMAL("Decimal"),
INTEGER("Integer"), DECIMAL("Decimal"),

FLOAT("Float"),

Expand Down Expand Up @@ -52,8 +51,6 @@ public String getValue() {
}

public static DataTypeJdbc fromValue(String v) {
return Stream.of(DataTypeJdbc.values())
.filter(e -> (e.getValue().equals(v)))
.findFirst().orElse(NUMERIC);
return Stream.of(DataTypeJdbc.values()).filter(e -> (e.getValue().equals(v))).findFirst().orElse(NUMERIC);
}
}
Loading
Loading