package com.iplatform.gather; import com.iplatform.core.BeanContextAware; import com.walker.connector.LocalAddress; import com.walker.db.DatabaseType; import com.walker.store.AbstractStore; import com.walker.store.support.DatabaseStore; import com.walker.store.task.GatherTask; /** * 测试单表采集调度器实现。 * @author 时克英 * @date 2022-09-14 */ public class TestFileTableScheduler extends SingleTableGatherScheduler{ public TestFileTableScheduler(int id, String name, DatabaseStore store){ super(id, name, store); this.setPageSize(256); this.setTableName("s_file"); this.setCreateTableSql("create table s_file(id varchar(36) not null,create_time bigint not null,creator varchar(30),content_type varchar(120) not null,file_name varchar(255) not null,path varchar(255),ext varchar(6),content blob,store_type smallint not null,summary varchar(100),group_id varchar(36),file_size bigint not null default 0,primary key (id));"); this.setLoadSql("select * from s_file "); } @Override protected GatherTask providerTask(AbstractStore store) { LocalAddress localAddress = BeanContextAware.getBeanByType(LocalAddress.class); logger.info("localAddress.service = " + localAddress.getServiceName()); TestFileGatherTask task = new TestFileGatherTask(store, "测试采集表:s_file", localAddress); task.setDatabaseType(DatabaseType.MYSQL); task.setSrcPreferenceSize(1000); return task; } @Override protected void terminateGatherScheduler(int schedulerId) { logger.info("采集任务终止:" + schedulerId); } @Override protected String getPageSQLInfo(int index, int pageSize) { return " limit ?,?"; } }