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

KYLIN-3434 Support prepare statement in Kylin server side #160

Merged
merged 1 commit into from
Aug 14, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,14 @@ public String getQueryAccessController() {
return getOptional("kylin.query.access-controller", null);
}

public int getQueryMaxCacheStatementNum() {
return Integer.parseInt(this.getOptional("kylin.query.statement-cache-max-num", String.valueOf(50000)));
}

public int getQueryMaxCacheStatementInstancePerKey() {
return Integer.parseInt(this.getOptional("kylin.query.statement-cache-max-num-per-key", String.valueOf(50)));
}

public int getDimCountDistinctMaxCardinality() {
return Integer.parseInt(getOptional("kylin.query.max-dimension-count-distinct", "5000000"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public CubeInstance updateCubeStatus(CubeInstance cube, RealizationStatusEnum ne
cube = cube.latestCopyForWrite(); // get a latest copy
CubeUpdate update = new CubeUpdate(cube);
update.setStatus(newStatus);
ProjectManager.getInstance(config).touchProject(cube.getProject());
return updateCube(update);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,18 @@ public void removeExtFilterFromProject(String filterName, String projectName) th
save(projectInstance);
}
}

/**
* change the last project modify time
* @param projectName
* @throws IOException
*/
public void touchProject(String projectName) throws IOException {
try (AutoLock lock = prjMapLock.lockForWrite()) {
ProjectInstance projectInstance = getProject(projectName);
save(projectInstance);
}
}

private ProjectInstance save(ProjectInstance prj) throws IOException {
crud.save(prj);
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<commons-upload.version>1.3.3</commons-upload.version>
<commons-math3.version>3.1.1</commons-math3.version>
<commons-collections.version>3.2.2</commons-collections.version>
<commons-pool.version>2.5.0</commons-pool.version>

<!-- Calcite deps, keep compatible with calcite.version -->
<jackson.version>2.9.5</jackson.version>
Expand Down Expand Up @@ -507,6 +508,11 @@
<version>${commons-collections.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>${commons-pool.version}</version>
</dependency>

<!-- HBase2 dependencies -->
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions server-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
<groupId>net.sf.supercsv</groupId>
<artifactId>super-csv</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>

<dependency>
<groupId>org.apache.kylin</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*
*/
public class PrepareSqlRequest extends SQLRequest {
private boolean enableStatementCache = true;

public PrepareSqlRequest() {
super();
Expand All @@ -43,6 +44,14 @@ public void setParams(StateParam[] params) {
this.params = params;
}

public boolean isEnableStatementCache() {
return enableStatementCache;
}

public void setEnableStatementCache(boolean enableStatementCache) {
this.enableStatementCache = enableStatementCache;
}

public static class StateParam implements Serializable {
private String className;
private String value;
Expand Down