Browse files

Create replication queue on startup

Starting the BackgroundReplication thread

git-svn-id: https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/experiments/dht/dht@2187 079b0acf-d9fa-0310-9935-e5ade295c882
  • Loading branch information...
1 parent 75b1d09 commit d413eeb86e3ab0697cfb0541a5c054a12af978f0 ayenderahien committed Jun 6, 2009
View
5 Rhino.DistributedHashTable.ClusterTests/Rhino.DistributedHashTable.ClusterTests.csproj
@@ -6,12 +6,14 @@
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D9377684-AC14-47F6-A3E8-E84AD0FC2BAA}</ProjectGuid>
- <OutputType>Library</OutputType>
+ <OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rhino.DistributedHashTable.ClusterTests</RootNamespace>
<AssemblyName>Rhino.DistributedHashTable.ClusterTests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
+ <StartupObject>
+ </StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -57,6 +59,7 @@
<Compile Include="FullIntegrationTest.cs" />
<Compile Include="MasterOverTheNetwork.cs" />
<Compile Include="NodeOverTheNetwork.cs" />
+ <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
View
2 Rhino.DistributedHashTable/Hosting/DistributedHashTableStorageHost.cs
@@ -39,7 +39,7 @@ public DistributedHashTableStorageHost(Uri master)
Async = new Uri("rhino.queues://" + Environment.MachineName + ":" + (port + 1) + "/replication")
};
queueManager = new QueueManager(new IPEndPoint(IPAddress.Any, port + 1), name + ".queue.esent");
-
+ queueManager.CreateQueues("replication");
node = new DistributedHashTableNode(
new DistributedHashTableMasterClient(master),
new ThreadPoolExecuter(),
View
2 Rhino.DistributedHashTable/Internal/DistributedHashTableNode.cs
@@ -182,6 +182,8 @@ public void Start()
StartPendingBackupsForCurrentNode(Topology);
var ownsSegments = assignedSegments.Any(x => x.AssignedEndpoint == endpoint);
+
+ backgroundReplication.Start();
State = ownsSegments ?
NodeState.Started :
NodeState.Starting;
View
2 Rhino.DistributedHashTable/Remote/DistributedHashTableNodeReplication.cs
@@ -96,7 +96,7 @@ public DistributedHashTableNodeReplication(PersistentHashTable.PersistentHashTab
{
foreach (var segment in segments)
{
- if (actions.HasTag((int)segment))
+ if (actions.HasTag(segment))
continue;
if (MarkSegmentAsAssignedToEndpoint(actions, replicationEndpoint, segment) == false)
continue;

0 comments on commit d413eeb

Please sign in to comment.