修改
This commit is contained in:
19
ConsoleApp2/Options/CommandOptions.cs
Normal file
19
ConsoleApp2/Options/CommandOptions.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
namespace ConsoleApp2.Options
|
||||
{
|
||||
public class CommandOptions
|
||||
{
|
||||
|
||||
public string InputDir { get; set; } = "./MyDumper";
|
||||
|
||||
public int TaskCount { get; set; } = 16;
|
||||
|
||||
public int FlushCount { get; set; } = 20000;
|
||||
|
||||
public bool Isutf8mb4 { get; set; } = true;
|
||||
|
||||
public short OldestShardKey { get; set; } = 23010;
|
||||
}
|
||||
}
|
@@ -5,7 +5,7 @@ public class CsvOptions
|
||||
/// <summary>
|
||||
/// MyDumper导出的CSV文件目录
|
||||
/// </summary>
|
||||
public string InputDir { get; set; } = "./";
|
||||
//public string InputDir { get; set; } = "./";
|
||||
|
||||
/// <summary>
|
||||
/// 字符串的包围符号,默认为双引号"
|
||||
|
18
ConsoleApp2/Options/DataInputOptions.cs
Normal file
18
ConsoleApp2/Options/DataInputOptions.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using ConsoleApp2.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.PortableExecutable;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp2.Options
|
||||
{
|
||||
public enum InputFileType { CSV, JWT, JSV }
|
||||
public class DataInputOptions
|
||||
{
|
||||
public string InputDir { get; set; } = "./";
|
||||
|
||||
public Func<string, CsvSource>? CreateSource { get; set; }
|
||||
}
|
||||
}
|
@@ -1,4 +1,6 @@
|
||||
namespace ConsoleApp2.Options;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace ConsoleApp2.Options;
|
||||
|
||||
public enum ColumnType
|
||||
{
|
||||
@@ -10,7 +12,14 @@ public enum ColumnType
|
||||
public class DataTransformOptions
|
||||
{
|
||||
public Func<DataRecord, string>? DatabaseFilter { get; set; }
|
||||
|
||||
|
||||
public Func<string, string>? TransformBinary { get; set; }//Binary转字符串方法
|
||||
|
||||
public Func<DataRecord, bool>? RecordFilter { get; set; }//数据过滤方法
|
||||
public Action<DataRecord>? RecordModify { get; set; }//数据修改
|
||||
public Func<DataRecord, DataRecord?>? RecordReplace { get; set; }//数据替换
|
||||
public Func<DataRecord, IList<DataRecord>?>? RecordAdd { get; set; }//数据替换
|
||||
|
||||
/// <summary>
|
||||
/// 配置导入数据的特殊列
|
||||
/// </summary>
|
||||
|
@@ -7,11 +7,13 @@ public class DatabaseOutputOptions
|
||||
/// </summary>
|
||||
public string? ConnectionString { get; set; }
|
||||
/// <summary>
|
||||
/// 输出服务的最大任务(Task)数
|
||||
/// 输出服务的任务(Task)数
|
||||
/// </summary>
|
||||
public int MaxTask { get; set; }
|
||||
public int TaskCount { get; set; }
|
||||
/// <summary>
|
||||
/// 每个任务每次提交到数据库的记录数量(每N条构建一次SQL语句)
|
||||
/// </summary>
|
||||
public int FlushCount { get; set; }
|
||||
|
||||
public int MaxAllowedPacket { get; set; } = 32*1024*1024;
|
||||
}
|
17
ConsoleApp2/Options/InputTableOptions.cs
Normal file
17
ConsoleApp2/Options/InputTableOptions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ConsoleApp2.Options
|
||||
{
|
||||
public class TableInfo
|
||||
{
|
||||
public long SimulaRowCount { get; set; }//模拟的记录条数
|
||||
}
|
||||
public class InputTableOptions
|
||||
{
|
||||
public Dictionary<string, TableInfo> TableInfoConfig { get; set; } = new();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user