Search in sources :

Example 6 with BinlogFile

use of com.alibaba.otter.canal.parse.inbound.mysql.rds.data.BinlogFile in project canal by alibaba.

the class RdsBinlogOpenApiTest method testSimple.

@Test
public void testSimple() throws Throwable {
    Date startTime = DateUtils.parseDate("2018-08-10 12:00:00", new String[] { "yyyy-MM-dd HH:mm:ss" });
    Date endTime = DateUtils.parseDate("2018-08-11 12:00:00", new String[] { "yyyy-MM-dd HH:mm:ss" });
    String url = "https://rds.aliyuncs.com/";
    String ak = "";
    String sk = "";
    String dbInstanceId = "";
    RdsBackupPolicy backupPolicy = RdsBinlogOpenApi.queryBinlogBackupPolicy(url, ak, sk, dbInstanceId);
    System.out.println(backupPolicy);
    List<BinlogFile> binlogFiles = RdsBinlogOpenApi.listBinlogFiles(url, ak, sk, dbInstanceId, startTime, endTime);
    System.out.println(binlogFiles);
}
Also used : BinlogFile(com.alibaba.otter.canal.parse.inbound.mysql.rds.data.BinlogFile) RdsBackupPolicy(com.alibaba.otter.canal.parse.inbound.mysql.rds.data.RdsBackupPolicy) Date(java.util.Date) Test(org.junit.Test)

Aggregations

BinlogFile (com.alibaba.otter.canal.parse.inbound.mysql.rds.data.BinlogFile)6 CanalParseException (com.alibaba.otter.canal.parse.exception.CanalParseException)3 Date (java.util.Date)2 PositionNotFoundException (com.alibaba.otter.canal.parse.exception.PositionNotFoundException)1 RdsBackupPolicy (com.alibaba.otter.canal.parse.inbound.mysql.rds.data.RdsBackupPolicy)1 EntryPosition (com.alibaba.otter.canal.protocol.position.EntryPosition)1 HttpResponseStatus (io.netty.handler.codec.http.HttpResponseStatus)1 BufferedOutputStream (java.io.BufferedOutputStream)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Comparator (java.util.Comparator)1 Iterator (java.util.Iterator)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 TimeUnit (java.util.concurrent.TimeUnit)1 LockSupport (java.util.concurrent.locks.LockSupport)1 SSLContext (javax.net.ssl.SSLContext)1