fixed issue #1032 , support raw config

This commit is contained in:
七锋
2018-10-25 13:11:34 +08:00
parent b5dac60cbb
commit 346d091d00
9 changed files with 28 additions and 11 deletions

View File

@@ -147,6 +147,7 @@ public class CanalInstanceWithManager extends AbstractCanalInstance {
memoryEventStore.setBufferMemUnit(parameters.getMemoryStorageBufferMemUnit());
memoryEventStore.setBatchMode(BatchMode.valueOf(parameters.getStorageBatchMode().name()));
memoryEventStore.setDdlIsolation(parameters.getDdlIsolation());
memoryEventStore.setRaw(parameters.getMemoryStorageRawEntry());
eventStore = memoryEventStore;
} else if (mode.isFile()) {
// 后续版本支持

View File

@@ -39,6 +39,7 @@ public class CanalParameter implements Serializable {
private BatchMode storageBatchMode = BatchMode.MEMSIZE; // 基于大小返回结果
private Integer memoryStorageBufferSize = 16 * 1024; // 内存存储的buffer大小
private Integer memoryStorageBufferMemUnit = 1024; // 内存存储的buffer内存占用单位,默认为1kb
private Boolean memoryStorageRawEntry = Boolean.TRUE; // 内存存储的对象是否启用raw的ByteString模式
private String fileStorageDirectory; // 文件存储的目录位置
private Integer fileStorageStoreCount; // 每个文件store存储的记录数
private Integer fileStorageRollverCount; // store文件的个数
@@ -955,6 +956,14 @@ public class CanalParameter implements Serializable {
this.gtidEnable = gtidEnable;
}
public Boolean getMemoryStorageRawEntry() {
return memoryStorageRawEntry;
}
public void setMemoryStorageRawEntry(Boolean memoryStorageRawEntry) {
this.memoryStorageRawEntry = memoryStorageRawEntry;
}
public String toString() {
return ToStringBuilder.reflectionToString(this, CanalToStringStyle.DEFAULT_STYLE);
}