private void initialize(String schema) { hbTable = new Table(schema, TABLE_NAME); hbId = new Column("id", Types.BIGINT, true); // true => isNotNull hbSeqno = new Column("seqno", Types.BIGINT); hbEventId = new Column("eventid", Types.VARCHAR, 128); hbSourceTstamp = new Column("source_tstamp", Types.TIMESTAMP); hbTargetTstamp = new Column("target_tstamp", Types.TIMESTAMP); hbLagMillis = new Column("lag_millis", Types.BIGINT); hbSalt = new Column("salt", Types.BIGINT); hbName = new Column("name", Types.VARCHAR, 128); Key hbKey = new Key(Key.Primary); hbKey.AddColumn(hbId); hbTable.AddColumn(hbId); hbTable.AddColumn(hbSeqno); hbTable.AddColumn(hbEventId); hbTable.AddColumn(hbSourceTstamp); hbTable.AddColumn(hbTargetTstamp); hbTable.AddColumn(hbLagMillis); hbTable.AddColumn(hbSalt); hbTable.AddColumn(hbName); hbTable.AddKey(hbKey); sourceTsQuery = "SELECT source_tstamp from " + schema + "." + TABLE_NAME + " where id=" + KEY; }
private void initializeStage(String schema) { hbStageTable = new Table(schema, STAGE_TABLE_NAME); hbTOpcode = new Column("tungsten_opcode", Types.VARCHAR, 2); hbTSeqno = new Column("tungsten_seqno", Types.BIGINT, true); hbTRowId = new Column("tungsten_row_id", Types.BIGINT, true); hbTCommitTstamp = new Column("tungsten_commit_timestamp", Types.TIMESTAMP); Key hbKey = new Key(Key.Primary); hbKey.AddColumn(hbTOpcode); hbKey.AddColumn(hbTSeqno); hbKey.AddColumn(hbTRowId); hbStageTable.AddColumn(hbTOpcode); hbStageTable.AddColumn(hbTSeqno); hbStageTable.AddColumn(hbTRowId); hbStageTable.AddColumn(hbTCommitTstamp); hbStageTable.AddColumn(hbId); hbStageTable.AddColumn(hbSeqno); hbStageTable.AddColumn(hbEventId); hbStageTable.AddColumn(hbSourceTstamp); hbStageTable.AddColumn(hbTargetTstamp); hbStageTable.AddColumn(hbLagMillis); hbStageTable.AddColumn(hbSalt); hbStageTable.AddColumn(hbName); hbStageTable.AddKey(hbKey); }