1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00

Fix Logger's package path

This commit is contained in:
dengchao@xgtl 2020-04-16 10:22:52 +08:00
parent 8dc7d9fd6b
commit 432cff26da
3 changed files with 56 additions and 69 deletions

View File

@ -18,28 +18,27 @@ import mondrian.resource.MondrianResource;
import mondrian.rolap.*; import mondrian.rolap.*;
import mondrian.spi.UserDefinedFunction; import mondrian.spi.UserDefinedFunction;
import mondrian.util.*; import mondrian.util.*;
import org.apache.commons.collections.keyvalue.AbstractMapEntry; import org.apache.commons.collections.keyvalue.AbstractMapEntry;
import org.apache.commons.vfs.*; import org.apache.commons.vfs.*;
import org.apache.commons.vfs.provider.http.HttpFileObject; import org.apache.commons.vfs.provider.http.HttpFileObject;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.eigenbase.xom.XOMUtil; import org.eigenbase.xom.XOMUtil;
import org.olap4j.impl.Olap4jUtil; import org.olap4j.impl.Olap4jUtil;
import org.olap4j.mdx.*; import org.olap4j.mdx.*;
import java.io.*; import java.io.*;
import java.lang.ref.Reference; import java.lang.ref.Reference;
import java.lang.reflect.*; import java.lang.reflect.*;
import java.lang.reflect.Array;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.sql.*;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -56,7 +55,7 @@ public class Util extends XOMUtil {
public static final String nl = System.getProperty("line.separator"); public static final String nl = System.getProperty("line.separator");
private static final Logger LOGGER = Logger.getLogger(Util.class); private static final Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(Util.class);
/** /**
* Placeholder which indicates a value NULL. * Placeholder which indicates a value NULL.
@ -428,7 +427,7 @@ public class Util extends XOMUtil {
* you wish to compare names, use {@link #equalName(String, String)}. * you wish to compare names, use {@link #equalName(String, String)}.
*/ */
public static boolean equals(String s, String t) { public static boolean equals(String s, String t) {
return equals((Object) s, (Object) t); return equals(s, t);
} }
/** /**
@ -2310,8 +2309,7 @@ public class Util extends XOMUtil {
} }
resultSet.close(); resultSet.close();
} catch (Throwable t) { } catch (Throwable t) {
firstException = new SQLException(); firstException = new SQLException(t);
firstException.initCause(t);
} }
} }
if (statement != null) { if (statement != null) {
@ -2319,8 +2317,7 @@ public class Util extends XOMUtil {
statement.close(); statement.close();
} catch (Throwable t) { } catch (Throwable t) {
if (firstException == null) { if (firstException == null) {
firstException = new SQLException(); firstException = new SQLException(t);
firstException.initCause(t);
} }
} }
} }
@ -2329,8 +2326,7 @@ public class Util extends XOMUtil {
connection.close(); connection.close();
} catch (Throwable t) { } catch (Throwable t) {
if (firstException == null) { if (firstException == null) {
firstException = new SQLException(); firstException = new SQLException(t);
firstException.initCause(t);
} }
} }
} }
@ -3371,7 +3367,7 @@ public class Util extends XOMUtil {
InputStream in = readVirtualFile(catalogUrl); InputStream in = readVirtualFile(catalogUrl);
try { try {
final byte[] bytes = Util.readFully(in, 1024); final byte[] bytes = Util.readFully(in, 1024);
return new String(bytes,"utf-8"); return new String(bytes, StandardCharsets.UTF_8);
} finally { } finally {
if (in != null) { if (in != null) {
in.close(); in.close();
@ -4256,7 +4252,7 @@ public class Util extends XOMUtil {
} }
} }
public static interface Functor1<RT, PT> { public interface Functor1<RT, PT> {
RT apply(PT param); RT apply(PT param);
} }
@ -4304,9 +4300,11 @@ public class Util extends XOMUtil {
public interface MemoryInfo { public interface MemoryInfo {
Usage get(); Usage get();
public interface Usage { interface Usage {
long getUsed(); long getUsed();
long getCommitted(); long getCommitted();
long getMax(); long getMax();
} }
} }
@ -4434,9 +4432,7 @@ public class Util extends XOMUtil {
} }
public boolean contains(Object o) { public boolean contains(Object o) {
if (o instanceof Entry) { if (o instanceof Entry) {
if (list.contains(((Entry) o).getKey())) { return list.contains(((Entry) o).getKey());
return true;
}
} }
return false; return false;
} }
@ -4475,11 +4471,7 @@ public class Util extends XOMUtil {
return list.size(); return list.size();
} }
public boolean contains(Object o) { public boolean contains(Object o) {
if (o == null && size() > 0) { return o == null && size() > 0;
return true;
} else {
return false;
}
} }
}; };
} }
@ -4490,11 +4482,7 @@ public class Util extends XOMUtil {
return list.contains(key); return list.contains(key);
} }
public boolean containsValue(Object o) { public boolean containsValue(Object o) {
if (o == null && size() > 0) { return o == null && size() > 0;
return true;
} else {
return false;
}
} }
} }
} }

View File

@ -11,17 +11,20 @@
package mondrian.olap.fun; package mondrian.olap.fun;
import mondrian.calc.*; import mondrian.calc.*;
import mondrian.calc.impl.*; import mondrian.calc.impl.DelegatingTupleList;
import mondrian.calc.impl.UnaryTupleList;
import mondrian.mdx.*; import mondrian.mdx.*;
import mondrian.olap.*; import mondrian.olap.*;
import mondrian.olap.type.*; import mondrian.olap.type.*;
import mondrian.resource.MondrianResource; import mondrian.resource.MondrianResource;
import mondrian.rolap.*; import mondrian.rolap.RolapHierarchy;
import mondrian.util.*; import mondrian.rolap.RolapUtil;
import mondrian.util.ConcatenableList;
import mondrian.util.IdentifierParser;
import mondrian.util.Pair;
import org.apache.commons.collections.ComparatorUtils; import org.apache.commons.collections.ComparatorUtils;
import org.apache.commons.collections.comparators.ComparatorChain; import org.apache.commons.collections.comparators.ComparatorChain;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import java.util.*; import java.util.*;
@ -34,7 +37,7 @@ import java.util.*;
*/ */
public class FunUtil extends Util { public class FunUtil extends Util {
private static final Logger LOGGER = private static final Logger LOGGER =
Logger.getLogger(FunUtil.class); org.apache.logging.log4j.LogManager.getLogger(FunUtil.class);
private static final String SORT_TIMING_NAME = "Sort"; private static final String SORT_TIMING_NAME = "Sort";
private static final String SORT_EVAL_TIMING_NAME = "EvalForSort"; private static final String SORT_EVAL_TIMING_NAME = "EvalForSort";
@ -2697,7 +2700,7 @@ public class FunUtil extends Util {
public final int TOO_SMALL = 8; public final int TOO_SMALL = 8;
private static final Logger LOGGER = private static final Logger LOGGER =
Logger.getLogger(Quicksorter.class); org.apache.logging.log4j.LogManager.getLogger(Quicksorter.class);
private final T[] vec; private final T[] vec;
private final Comparator<T> comp; private final Comparator<T> comp;
private final boolean traced; private final boolean traced;
@ -2812,9 +2815,7 @@ public class FunUtil extends Util {
while (less(pivot, vec[right])) { while (less(pivot, vec[right])) {
--right; --right;
} }
if (debug) { assert !debug || (left <= end) && (right >= start);
assert (left <= end) && (right >= start);
}
if (left < right) { // found a misplaced pair if (left < right) { // found a misplaced pair
swap(left, right); swap(left, right);
++left; --right; ++left; --right;
@ -2919,7 +2920,7 @@ public class FunUtil extends Util {
private static abstract class MemberComparator implements Comparator<Member> private static abstract class MemberComparator implements Comparator<Member>
{ {
private static final Logger LOGGER = private static final Logger LOGGER =
Logger.getLogger(MemberComparator.class); org.apache.logging.log4j.LogManager.getLogger(MemberComparator.class);
final Evaluator evaluator; final Evaluator evaluator;
final Calc exp; final Calc exp;

View File

@ -18,12 +18,13 @@ import mondrian.rolap.agg.*;
import mondrian.rolap.aggmatcher.AggStar; import mondrian.rolap.aggmatcher.AggStar;
import mondrian.rolap.sql.SqlQuery; import mondrian.rolap.sql.SqlQuery;
import mondrian.server.Locus; import mondrian.server.Locus;
import mondrian.spi.*; import mondrian.spi.DataSourceChangeListener;
import mondrian.spi.Dialect;
import mondrian.util.Bug; import mondrian.util.Bug;
import org.apache.commons.collections.map.ReferenceMap; import org.apache.commons.collections.map.ReferenceMap;
import org.apache.log4j.Logger; import org.apache.logging.log4j.Logger;
import javax.sql.DataSource;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
import java.lang.ref.SoftReference; import java.lang.ref.SoftReference;
@ -32,8 +33,6 @@ import java.sql.*;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import javax.sql.DataSource;
/** /**
* A <code>RolapStar</code> is a star schema. It is the means to read cell * A <code>RolapStar</code> is a star schema. It is the means to read cell
* values. * values.
@ -45,7 +44,7 @@ import javax.sql.DataSource;
* @since 12 August, 2001 * @since 12 August, 2001
*/ */
public class RolapStar { public class RolapStar {
private static final Logger LOGGER = Logger.getLogger(RolapStar.class); private static final Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(RolapStar.class);
private final RolapSchema schema; private final RolapSchema schema;
@ -83,9 +82,9 @@ public class RolapStar {
// temporary model, should eventually use RolapStar.Table and // temporary model, should eventually use RolapStar.Table and
// RolapStar.Column // RolapStar.Column
private StarNetworkNode factNode; private final StarNetworkNode factNode;
private Map<String, StarNetworkNode> nodeLookup = private final Map<String, StarNetworkNode> nodeLookup =
new HashMap<String, StarNetworkNode>(); new HashMap<String, StarNetworkNode>();
private final RolapStatisticsCache statisticsCache; private final RolapStatisticsCache statisticsCache;
@ -220,18 +219,17 @@ public class RolapStar {
}; };
private static class StarNetworkNode { private static class StarNetworkNode {
private StarNetworkNode parent; private final StarNetworkNode parent;
private MondrianDef.Relation origRel; private final MondrianDef.Relation origRel;
private String foreignKey; private final String foreignKey;
private String joinKey; private final String joinKey;
private StarNetworkNode( private StarNetworkNode(
StarNetworkNode parent, StarNetworkNode parent,
String alias, String alias,
MondrianDef.Relation origRel, MondrianDef.Relation origRel,
String foreignKey, String foreignKey,
String joinKey) String joinKey) {
{
this.parent = parent; this.parent = parent;
this.origRel = origRel; this.origRel = origRel;
this.foreignKey = foreignKey; this.foreignKey = foreignKey;
@ -872,14 +870,16 @@ public class RolapStar {
private boolean isNameColumn; private boolean isNameColumn;
/** this has a unique value per star */ /**
* this has a unique value per star
*/
private final int bitPosition; private final int bitPosition;
/** /**
* The estimated cardinality of the column. * The estimated cardinality of the column.
* {@link Integer#MIN_VALUE} means unknown. * {@link Integer#MIN_VALUE} means unknown.
*/ */
private AtomicInteger approxCardinality = new AtomicInteger( private final AtomicInteger approxCardinality = new AtomicInteger(
Integer.MIN_VALUE); Integer.MIN_VALUE);
private Column( private Column(
String name, String name,
@ -1722,9 +1722,7 @@ public class RolapStar {
public boolean equalsTableName(String tableName) { public boolean equalsTableName(String tableName) {
if (this.relation instanceof MondrianDef.Table) { if (this.relation instanceof MondrianDef.Table) {
MondrianDef.Table mt = (MondrianDef.Table) this.relation; MondrianDef.Table mt = (MondrianDef.Table) this.relation;
if (mt.name.equals(tableName)) { return mt.name.equals(tableName);
return true;
}
} }
return false; return false;
} }
@ -1883,8 +1881,8 @@ public class RolapStar {
public boolean containsColumn(String columnName) { public boolean containsColumn(String columnName) {
if (relation instanceof MondrianDef.Relation) { if (relation instanceof MondrianDef.Relation) {
return star.containsColumn( return star.containsColumn(
((MondrianDef.Relation) relation).getAlias(), relation.getAlias(),
columnName); columnName);
} else { } else {
// todo: Deal with join. // todo: Deal with join.
return false; return false;
@ -1893,7 +1891,7 @@ public class RolapStar {
} }
public static class Condition { public static class Condition {
private static final Logger LOGGER = Logger.getLogger(Condition.class); private static final Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(Condition.class);
private final MondrianDef.Expression left; private final MondrianDef.Expression left;
private final MondrianDef.Expression right; private final MondrianDef.Expression right;