|
|
@ -1,28 +1,25 @@ |
|
|
|
package com.fr.plugin.db.redis.core; |
|
|
|
package com.fr.plugin.db.redis.core; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
|
|
|
|
import com.fr.base.TableData; |
|
|
|
|
|
|
|
import com.fanruan.api.conf.HolderKit; |
|
|
|
import com.fanruan.api.conf.HolderKit; |
|
|
|
|
|
|
|
import com.fanruan.api.data.ConnectionKit; |
|
|
|
|
|
|
|
import com.fanruan.api.log.LogKit; |
|
|
|
|
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
|
|
|
|
import com.fanruan.api.xml.XmlKit; |
|
|
|
|
|
|
|
import com.fr.base.TableData; |
|
|
|
|
|
|
|
import com.fr.config.holder.Conf; |
|
|
|
import com.fr.config.holder.factory.XmlHolders; |
|
|
|
import com.fr.config.holder.factory.XmlHolders; |
|
|
|
import com.fr.data.AbstractParameterTableData; |
|
|
|
import com.fr.data.AbstractParameterTableData; |
|
|
|
import com.fanruan.api.xml.XmlKit; |
|
|
|
|
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fr.data.impl.Connection; |
|
|
|
import com.fanruan.api.database.nameDatabase.NameReference; |
|
|
|
|
|
|
|
import com.fanruan.api.data.ConnectionKit; |
|
|
|
|
|
|
|
import com.fr.general.data.DataModel; |
|
|
|
import com.fr.general.data.DataModel; |
|
|
|
import com.fanruan.api.xml.XmlKit; |
|
|
|
|
|
|
|
import com.fr.intelli.record.Focus; |
|
|
|
import com.fr.intelli.record.Focus; |
|
|
|
import com.fanruan.api.log.LogKit; |
|
|
|
|
|
|
|
import com.fr.plugin.db.redis.core.order.OrderValue; |
|
|
|
import com.fr.plugin.db.redis.core.order.OrderValue; |
|
|
|
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue; |
|
|
|
import com.fr.plugin.db.redis.core.order.impl.NumberOrderValue; |
|
|
|
import com.fr.plugin.db.redis.util.RedisUtils; |
|
|
|
import com.fr.plugin.db.redis.util.RedisUtils; |
|
|
|
import com.fr.record.analyzer.EnableMetrics; |
|
|
|
import com.fr.record.analyzer.EnableMetrics; |
|
|
|
import com.fr.script.Calculator; |
|
|
|
import com.fr.script.Calculator; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
import com.fanruan.api.util.StringKit; |
|
|
|
|
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
import com.fr.stable.xml.XMLPrintWriter; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
import com.fr.config.holder.Conf; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author richie |
|
|
|
* @author richie |
|
|
@ -75,7 +72,7 @@ public class RedisScriptTableData extends AbstractParameterTableData { |
|
|
|
@Focus(id = RedisConstants.PLUGIN_ID, text = "Plugin-Redis_Script_Table_Data") |
|
|
|
@Focus(id = RedisConstants.PLUGIN_ID, text = "Plugin-Redis_Script_Table_Data") |
|
|
|
public DataModel createDataModel(Calculator calculator, int rowCount) { |
|
|
|
public DataModel createDataModel(Calculator calculator, int rowCount) { |
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
Parameter[] ps = Parameter.providers2Parameter(getParameters(calculator)); |
|
|
|
ParameterProvider[] ps = getParameters(calculator); |
|
|
|
Connection connection = database.get(); |
|
|
|
Connection connection = database.get(); |
|
|
|
if (connection instanceof NameReference) { |
|
|
|
if (connection instanceof NameReference) { |
|
|
|
String name = ((NameReference) connection).getName(); |
|
|
|
String name = ((NameReference) connection).getName(); |
|
|
@ -86,7 +83,7 @@ public class RedisScriptTableData extends AbstractParameterTableData { |
|
|
|
orderValue == null ? 0 : orderValue.toIndex(calculator, ps), |
|
|
|
orderValue == null ? 0 : orderValue.toIndex(calculator, ps), |
|
|
|
RedisUtils.calculateQuery(script.get(), ps), |
|
|
|
RedisUtils.calculateQuery(script.get(), ps), |
|
|
|
rowCount); |
|
|
|
rowCount); |
|
|
|
FineLoggerFactory.getLogger().info("Build data model spend time {} ms.", System.currentTimeMillis() - start); |
|
|
|
LogKit.info("Build data model spend time {} ms.", System.currentTimeMillis() - start); |
|
|
|
return model; |
|
|
|
return model; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|