use of com.qlangtech.tis.sql.parser.meta.TabExtraMeta in project tis by qlangtech.
the class ERRules method hasSetTimestampVerColumn.
public boolean hasSetTimestampVerColumn(EntityName tableName) {
DependencyNode dumpNode = getDumpNode(tableName);
TabExtraMeta extraMeta = dumpNode.getExtraMeta();
return extraMeta == null && StringUtils.isNotEmpty(extraMeta.getTimeVerColName());
}
use of com.qlangtech.tis.sql.parser.meta.TabExtraMeta in project tis by qlangtech.
the class StreamComponentCodeGeneratorFlink method getERRule.
// @Override
private IERRules getERRule() {
ERRules erRules = new ERRules() {
public List<PrimaryTableMeta> getPrimaryTabs() {
TabExtraMeta tabMeta = new TabExtraMeta();
PrimaryTableMeta ptab = new PrimaryTableMeta("tabName", tabMeta);
return Collections.singletonList(ptab);
}
};
return erRules;
}
use of com.qlangtech.tis.sql.parser.meta.TabExtraMeta in project tis by qlangtech.
the class ERRules method getTimestampVerColumn.
/**
* 取得表的时间戳生成列
*
* @param tableName
* @return
*/
@Override
public String getTimestampVerColumn(EntityName tableName) {
if (this.isTriggerIgnore(tableName)) {
throw new IllegalStateException("tab:" + tableName + " is not monitor in incr process");
}
DependencyNode dumpNode = getDumpNode(tableName);
TabExtraMeta extraMeta = dumpNode.getExtraMeta();
if (extraMeta == null || StringUtils.isEmpty(extraMeta.getTimeVerColName())) {
throw new IllegalStateException("table:" + tableName + " can not find 'timeVerColName' prop");
}
return extraMeta.getTimeVerColName();
}
use of com.qlangtech.tis.sql.parser.meta.TabExtraMeta in project tis by qlangtech.
the class ERRules method createErRule.
public static void createErRule(String topologyName, DependencyNode node, ColumnMetaData pkMeta) throws Exception {
/**
*********************************************************
* 设置TabExtraMeta
*********************************************************
*/
Objects.requireNonNull(pkMeta, "param pkMeta can not be null");
node.setExtraSql(null);
TabExtraMeta extraMeta = new TabExtraMeta();
extraMeta.setSharedKey(pkMeta.getKey());
extraMeta.setMonitorTrigger(true);
List<PrimaryLinkKey> primaryIndexColumnName = Lists.newArrayList();
PrimaryLinkKey pk = new PrimaryLinkKey();
pk.setName(pkMeta.getKey());
pk.setPk(true);
primaryIndexColumnName.add(pk);
extraMeta.setPrimaryIndexColumnNames(primaryIndexColumnName);
extraMeta.setPrimaryIndexTab(true);
node.setExtraMeta(extraMeta);
ERRules erRules = new ERRules();
erRules.addDumpNode(node);
erRules.setTimeCharacteristic(TimeCharacteristic.ProcessTime);
write(topologyName, erRules);
}
use of com.qlangtech.tis.sql.parser.meta.TabExtraMeta in project tis by qlangtech.
the class TestCoreAction method createMockErRules.
public ERRules createMockErRules(TableMeta totalpayMeta) {
ERRules erRules = mock("erRules", ERRules.class);
if (totalpayMeta != null) {
TabExtraMeta extraMeta = new TabExtraMeta();
extraMeta.setSharedKey(totalpayMeta.getSharedKey());
PrimaryTableMeta tabMeta = new PrimaryTableMeta(totalpayMeta.getTabName(), extraMeta);
EasyMock.expect(erRules.getPrimaryTabs()).andReturn(Lists.newArrayList(tabMeta)).anyTimes();
} else {
EasyMock.expect(erRules.getPrimaryTabs()).andReturn(Collections.emptyList()).anyTimes();
}
MockERRulesGetter.erRules = erRules;
return erRules;
}
Aggregations