mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-05 20:41:34 +08:00
Fix class not found
This commit is contained in:
parent
e463139cc2
commit
4f8e19ba2f
@ -8,24 +8,27 @@
|
|||||||
*/
|
*/
|
||||||
package mondrian.rolap;
|
package mondrian.rolap;
|
||||||
|
|
||||||
import mondrian.olap.*;
|
import mondrian.olap.MondrianProperties;
|
||||||
|
import mondrian.olap.Util;
|
||||||
import mondrian.olap.Util.Functor1;
|
import mondrian.olap.Util.Functor1;
|
||||||
import mondrian.server.Execution;
|
import mondrian.server.Execution;
|
||||||
import mondrian.server.Locus;
|
import mondrian.server.Locus;
|
||||||
import mondrian.server.monitor.*;
|
import mondrian.server.monitor.SqlStatementEndEvent;
|
||||||
|
import mondrian.server.monitor.SqlStatementEvent;
|
||||||
import mondrian.server.monitor.SqlStatementEvent.Purpose;
|
import mondrian.server.monitor.SqlStatementEvent.Purpose;
|
||||||
import mondrian.util.*;
|
import mondrian.server.monitor.SqlStatementExecuteEvent;
|
||||||
|
import mondrian.server.monitor.SqlStatementStartEvent;
|
||||||
|
import mondrian.util.Counters;
|
||||||
|
import mondrian.util.DelegatingInvocationHandler;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.sql.Connection;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import javax.sql.DataSource;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SqlStatement contains a SQL statement and associated resources throughout
|
* SqlStatement contains a SQL statement and associated resources throughout
|
||||||
@ -66,8 +69,6 @@ public class SqlStatement {
|
|||||||
MondrianProperties.instance().QueryLimit.get(), true);
|
MondrianProperties.instance().QueryLimit.get(), true);
|
||||||
|
|
||||||
private final DataSource dataSource;
|
private final DataSource dataSource;
|
||||||
private Connection jdbcConnection;
|
|
||||||
private ResultSet resultSet;
|
|
||||||
private final String sql;
|
private final String sql;
|
||||||
private final List<Type> types;
|
private final List<Type> types;
|
||||||
private final int maxRows;
|
private final int maxRows;
|
||||||
@ -75,14 +76,16 @@ public class SqlStatement {
|
|||||||
private final Locus locus;
|
private final Locus locus;
|
||||||
private final int resultSetType;
|
private final int resultSetType;
|
||||||
private final int resultSetConcurrency;
|
private final int resultSetConcurrency;
|
||||||
private boolean haveSemaphore;
|
private final List<Accessor> accessors = new ArrayList<Accessor>();
|
||||||
|
private final long id;
|
||||||
public int rowCount;
|
public int rowCount;
|
||||||
|
private final Functor1<Void, Statement> callback;
|
||||||
|
private Connection jdbcConnection;
|
||||||
|
private ResultSet resultSet;
|
||||||
private long startTimeNanos;
|
private long startTimeNanos;
|
||||||
private long startTimeMillis;
|
private long startTimeMillis;
|
||||||
private final List<Accessor> accessors = new ArrayList<Accessor>();
|
|
||||||
private State state = State.FRESH;
|
private State state = State.FRESH;
|
||||||
private final long id;
|
private boolean haveSemaphore;
|
||||||
private Functor1<Void, Statement> callback;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a SqlStatement.
|
* Creates a SqlStatement.
|
||||||
@ -107,8 +110,7 @@ public class SqlStatement {
|
|||||||
Locus locus,
|
Locus locus,
|
||||||
int resultSetType,
|
int resultSetType,
|
||||||
int resultSetConcurrency,
|
int resultSetConcurrency,
|
||||||
Util.Functor1<Void, Statement> callback)
|
Util.Functor1<Void, Statement> callback) {
|
||||||
{
|
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.id = ID_GENERATOR.getAndIncrement();
|
this.id = ID_GENERATOR.getAndIncrement();
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
@ -139,21 +141,23 @@ public class SqlStatement {
|
|||||||
querySemaphore.acquire();
|
querySemaphore.acquire();
|
||||||
haveSemaphore = true;
|
haveSemaphore = true;
|
||||||
// Trace start of execution.
|
// Trace start of execution.
|
||||||
if (RolapUtil.SQL_LOGGER.isDebugEnabled()) {
|
//region org.apache.log4j.Logger is no longer exists
|
||||||
StringBuilder sqllog = new StringBuilder();
|
// if (RolapUtil.SQL_LOGGER.isDebugEnabled()) {
|
||||||
sqllog.append(id)
|
// StringBuilder sqllog = new StringBuilder();
|
||||||
.append(": ")
|
// sqllog.append(id)
|
||||||
.append(locus.component)
|
// .append(": ")
|
||||||
.append(": executing sql [");
|
// .append(locus.component)
|
||||||
if (sql.indexOf('\n') >= 0) {
|
// .append(": executing sql [");
|
||||||
// SQL appears to be formatted as multiple lines. Make it
|
// if (sql.indexOf('\n') >= 0) {
|
||||||
// start on its own line.
|
// // SQL appears to be formatted as multiple lines. Make it
|
||||||
sqllog.append("\n");
|
// // start on its own line.
|
||||||
}
|
// sqllog.append("\n");
|
||||||
sqllog.append(sql);
|
// }
|
||||||
sqllog.append(']');
|
// sqllog.append(sql);
|
||||||
RolapUtil.SQL_LOGGER.debug(sqllog.toString());
|
// sqllog.append(']');
|
||||||
}
|
// RolapUtil.SQL_LOGGER.debug(sqllog.toString());
|
||||||
|
// }
|
||||||
|
//endregion
|
||||||
|
|
||||||
// Execute hook.
|
// Execute hook.
|
||||||
RolapUtil.ExecuteQueryHook hook = RolapUtil.getHook();
|
RolapUtil.ExecuteQueryHook hook = RolapUtil.getHook();
|
||||||
@ -251,12 +255,14 @@ public class SqlStatement {
|
|||||||
// Now handle this exception.
|
// Now handle this exception.
|
||||||
throw handle(e);
|
throw handle(e);
|
||||||
} finally {
|
} finally {
|
||||||
RolapUtil.SQL_LOGGER.debug(id + ": " + status);
|
//region org.apache.log4j.Logger is no longer exists
|
||||||
|
// RolapUtil.SQL_LOGGER.debug(id + ": " + status);
|
||||||
if (RolapUtil.LOGGER.isDebugEnabled()) {
|
//
|
||||||
RolapUtil.LOGGER.debug(
|
// if (RolapUtil.LOGGER.isDebugEnabled()) {
|
||||||
locus.component + ": executing sql [" + sql + "]" + status);
|
// RolapUtil.LOGGER.debug(
|
||||||
}
|
// locus.component + ": executing sql [" + sql + "]" + status);
|
||||||
|
// }
|
||||||
|
//endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +311,8 @@ public class SqlStatement {
|
|||||||
locus.execution.getQueryTiming().markFull(
|
locus.execution.getQueryTiming().markFull(
|
||||||
TIMING_NAME + locus.component, totalMs);
|
TIMING_NAME + locus.component, totalMs);
|
||||||
|
|
||||||
RolapUtil.SQL_LOGGER.debug(id + ": " + status);
|
// org.apache.log4j.Logger is no longer exists
|
||||||
|
// RolapUtil.SQL_LOGGER.debug(id + ": " + status);
|
||||||
|
|
||||||
Counters.SQL_STATEMENT_CLOSE_COUNT.incrementAndGet();
|
Counters.SQL_STATEMENT_CLOSE_COUNT.incrementAndGet();
|
||||||
boolean remove = Counters.SQL_STATEMENT_EXECUTING_IDS.remove(id);
|
boolean remove = Counters.SQL_STATEMENT_EXECUTING_IDS.remove(id);
|
||||||
@ -313,11 +320,13 @@ public class SqlStatement {
|
|||||||
+ ", close=" + Counters.SQL_STATEMENT_CLOSE_COUNT.get()
|
+ ", close=" + Counters.SQL_STATEMENT_CLOSE_COUNT.get()
|
||||||
+ ", open=" + Counters.SQL_STATEMENT_EXECUTING_IDS;
|
+ ", open=" + Counters.SQL_STATEMENT_EXECUTING_IDS;
|
||||||
|
|
||||||
if (RolapUtil.LOGGER.isDebugEnabled()) {
|
//region org.apache.log4j.Logger is no longer exists
|
||||||
RolapUtil.LOGGER.debug(
|
// if (RolapUtil.LOGGER.isDebugEnabled()) {
|
||||||
locus.component + ": done executing sql [" + sql + "]"
|
// RolapUtil.LOGGER.debug(
|
||||||
+ status);
|
// locus.component + ": done executing sql [" + sql + "]"
|
||||||
}
|
// + status);
|
||||||
|
// }
|
||||||
|
//endregion
|
||||||
|
|
||||||
if (!remove) {
|
if (!remove) {
|
||||||
throw new AssertionError(
|
throw new AssertionError(
|
||||||
@ -452,7 +461,7 @@ public class SqlStatement {
|
|||||||
public ResultSet getWrappedResultSet() {
|
public ResultSet getWrappedResultSet() {
|
||||||
return (ResultSet) Proxy.newProxyInstance(
|
return (ResultSet) Proxy.newProxyInstance(
|
||||||
null,
|
null,
|
||||||
new Class<?>[] {ResultSet.class},
|
new Class<?>[]{ResultSet.class},
|
||||||
new MyDelegatingInvocationHandler(this));
|
new MyDelegatingInvocationHandler(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,6 +514,13 @@ public class SqlStatement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private enum State {
|
||||||
|
FRESH,
|
||||||
|
ACTIVE,
|
||||||
|
DONE,
|
||||||
|
CLOSED
|
||||||
|
}
|
||||||
|
|
||||||
public interface Accessor {
|
public interface Accessor {
|
||||||
Object get() throws SQLException;
|
Object get() throws SQLException;
|
||||||
}
|
}
|
||||||
@ -517,8 +533,7 @@ public class SqlStatement {
|
|||||||
*/
|
*/
|
||||||
// must be public for reflection to work
|
// must be public for reflection to work
|
||||||
public static class MyDelegatingInvocationHandler
|
public static class MyDelegatingInvocationHandler
|
||||||
extends DelegatingInvocationHandler
|
extends DelegatingInvocationHandler {
|
||||||
{
|
|
||||||
private final SqlStatement sqlStatement;
|
private final SqlStatement sqlStatement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -550,13 +565,6 @@ public class SqlStatement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum State {
|
|
||||||
FRESH,
|
|
||||||
ACTIVE,
|
|
||||||
DONE,
|
|
||||||
CLOSED
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class StatementLocus extends Locus {
|
public static class StatementLocus extends Locus {
|
||||||
private final SqlStatementEvent.Purpose purpose;
|
private final SqlStatementEvent.Purpose purpose;
|
||||||
private final int cellRequestCount;
|
private final int cellRequestCount;
|
||||||
@ -566,8 +574,7 @@ public class SqlStatement {
|
|||||||
String component,
|
String component,
|
||||||
String message,
|
String message,
|
||||||
SqlStatementEvent.Purpose purpose,
|
SqlStatementEvent.Purpose purpose,
|
||||||
int cellRequestCount)
|
int cellRequestCount) {
|
||||||
{
|
|
||||||
super(
|
super(
|
||||||
execution,
|
execution,
|
||||||
component,
|
component,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user