Skip to content

Commit 0351aff

Browse files
committed
small change.
1 parent d881cae commit 0351aff

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/EQueue/Broker/BrokerSetting.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class BrokerSetting
6161
/// </summary>
6262
public ChunkManagerConfig QueueChunkConfig { get; set; }
6363

64-
public BrokerSetting(string chunkFileStoreRootPath = @"c:\equeue-store", int messageChunkDataSize = 256 * 1024 * 1024, int chunkCacheMaxPercent = 75, int chunkCacheMinPercent = 40, bool syncFlush = false, bool enableCache = true)
64+
public BrokerSetting(string chunkFileStoreRootPath = @"c:\equeue-store", int messageChunkDataSize = 256 * 1024 * 1024, int chunkCacheMaxPercent = 75, int chunkCacheMinPercent = 40, int maxLogRecordSize = 4 * 1024 * 1024, int chunkWriteBuffer = 128 * 1024, int chunkReadBuffer = 128 * 1024, bool syncFlush = false, bool enableCache = true)
6565
{
6666
ProducerAddress = new IPEndPoint(SocketUtils.GetLocalIPV4(), 5000);
6767
ConsumerAddress = new IPEndPoint(SocketUtils.GetLocalIPV4(), 5001);
@@ -87,9 +87,9 @@ public BrokerSetting(string chunkFileStoreRootPath = @"c:\equeue-store", int mes
8787
enableCache,
8888
syncFlush,
8989
Environment.ProcessorCount * 2,
90-
4 * 1024 * 1024,
91-
128 * 1024,
92-
128 * 1024,
90+
maxLogRecordSize,
91+
chunkWriteBuffer,
92+
chunkReadBuffer,
9393
chunkCacheMaxPercent,
9494
chunkCacheMinPercent,
9595
1,
@@ -107,8 +107,8 @@ public BrokerSetting(string chunkFileStoreRootPath = @"c:\equeue-store", int mes
107107
syncFlush,
108108
Environment.ProcessorCount * 2,
109109
8,
110-
128 * 1024,
111-
128 * 1024,
110+
chunkWriteBuffer,
111+
chunkReadBuffer,
112112
chunkCacheMaxPercent,
113113
chunkCacheMinPercent,
114114
1,

src/EQueue/Clients/Producers/Producer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private int GetAvailableQueueId(Message message, string routingKey)
160160
}
161161
private IList<int> GetTopicQueueIds(string topic)
162162
{
163-
var queueIds = _topicQueueIdsDict.GetOrAdd(topic, new List<int>());
163+
var queueIds = _topicQueueIdsDict.GetOrAdd(topic, k => new List<int>());
164164
if (queueIds.IsEmpty())
165165
{
166166
try

src/Samples/QuickStart/QuickStart.BrokerServer/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static void Main(string[] args)
1818
ConfigurationManager.AppSettings["fileStoreRootPath"],
1919
chunkCacheMaxPercent: 95,
2020
messageChunkDataSize: int.Parse(ConfigurationManager.AppSettings["chunkSize"]) * 1024 * 1024,
21+
chunkWriteBuffer: int.Parse(ConfigurationManager.AppSettings["chunkWriteBuffer"]) * 1024,
2122
enableCache: bool.Parse(ConfigurationManager.AppSettings["enableCache"]))).Start();
2223
Console.ReadLine();
2324
}

src/Samples/QuickStart/QuickStart.BrokerServer/app.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
</startup>
66
<appSettings>
77
<add key="fileStoreRootPath" value="d:\equeue-store"/>
8-
<add key="chunkSize" value="256"/>
8+
<add key="chunkSize" value="256"/><!--MB-->
9+
<add key="chunkWriteBuffer" value="256"/><!--KB-->
910
<add key="enableCache" value="true"/>
1011
</appSettings>
1112
</configuration>

0 commit comments

Comments
 (0)