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.spi.UserDefinedFunction;
import mondrian.util.*;
import org.apache.commons.collections.keyvalue.AbstractMapEntry;
import org.apache.commons.vfs.*;
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.olap4j.impl.Olap4jUtil;
import org.olap4j.mdx.*;
import java.io.*;
import java.lang.ref.Reference;
import java.lang.reflect.*;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.sql.*;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -56,7 +55,7 @@ public class Util extends XOMUtil {
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.
@ -428,7 +427,7 @@ public class Util extends XOMUtil {
* you wish to compare names, use {@link #equalName(String, String)}.
*/
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();
} catch (Throwable t) {
firstException = new SQLException();
firstException.initCause(t);
firstException = new SQLException(t);
}
}
if (statement != null) {
@ -2319,8 +2317,7 @@ public class Util extends XOMUtil {
statement.close();
} catch (Throwable t) {
if (firstException == null) {
firstException = new SQLException();
firstException.initCause(t);
firstException = new SQLException(t);
}
}
}
@ -2329,8 +2326,7 @@ public class Util extends XOMUtil {
connection.close();
} catch (Throwable t) {
if (firstException == null) {
firstException = new SQLException();
firstException.initCause(t);
firstException = new SQLException(t);
}
}
}
@ -3371,7 +3367,7 @@ public class Util extends XOMUtil {
InputStream in = readVirtualFile(catalogUrl);
try {
final byte[] bytes = Util.readFully(in, 1024);
return new String(bytes,"utf-8");
return new String(bytes, StandardCharsets.UTF_8);
} finally {
if (in != null) {
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);
}
@ -4304,9 +4300,11 @@ public class Util extends XOMUtil {
public interface MemoryInfo {
Usage get();
public interface Usage {
interface Usage {
long getUsed();
long getCommitted();
long getMax();
}
}
@ -4434,9 +4432,7 @@ public class Util extends XOMUtil {
}
public boolean contains(Object o) {
if (o instanceof Entry) {
if (list.contains(((Entry) o).getKey())) {
return true;
}
return list.contains(((Entry) o).getKey());
}
return false;
}
@ -4475,11 +4471,7 @@ public class Util extends XOMUtil {
return list.size();
}
public boolean contains(Object o) {
if (o == null && size() > 0) {
return true;
} else {
return false;
}
return o == null && size() > 0;
}
};
}
@ -4490,11 +4482,7 @@ public class Util extends XOMUtil {
return list.contains(key);
}
public boolean containsValue(Object o) {
if (o == null && size() > 0) {
return true;
} else {
return false;
}
return o == null && size() > 0;
}
}
}

View File

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

View File

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