Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FUCoin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DistributedSystems4Students
FUCoin
Commits
ca838539
"README.md" did not exist on "fe89c93bc1ce9ceda746e3282b71e0fbec2eeb0b"
Commit
ca838539
authored
8 years ago
by
Simon Könnecke
Browse files
Options
Downloads
Patches
Plain Diff
snapshot load
parent
6041bba0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fucoin/gui/SuperVisorGuiControlImpl.java
+16
-8
16 additions, 8 deletions
src/main/java/fucoin/gui/SuperVisorGuiControlImpl.java
with
16 additions
and
8 deletions
src/main/java/fucoin/gui/SuperVisorGuiControlImpl.java
+
16
−
8
View file @
ca838539
...
@@ -14,9 +14,7 @@ import scala.concurrent.Future;
...
@@ -14,9 +14,7 @@ import scala.concurrent.Future;
import
scala.concurrent.duration.Duration
;
import
scala.concurrent.duration.Duration
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.LinkedList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
public
class
SuperVisorGuiControlImpl
implements
SuperVisorGuiControl
{
public
class
SuperVisorGuiControlImpl
implements
SuperVisorGuiControl
{
private
SuperVisorImpl
superVisor
;
private
SuperVisorImpl
superVisor
;
...
@@ -61,14 +59,24 @@ public class SuperVisorGuiControlImpl implements SuperVisorGuiControl {
...
@@ -61,14 +59,24 @@ public class SuperVisorGuiControlImpl implements SuperVisorGuiControl {
loadedSnapshotsOfWallets
.
clear
();
loadedSnapshotsOfWallets
.
clear
();
loadedSnapshotDateTime
=
time
;
loadedSnapshotDateTime
=
time
;
fucoin
.
supervisor
.
Snapshot
snapshot
=
superVisor
.
readSnapShot
(
time
);
try
{
try
{
Timeout
timeout
=
new
Timeout
(
Duration
.
create
(
10
,
"seconds"
));
Timeout
timeout
=
new
Timeout
(
Duration
.
create
(
10
,
"seconds"
));
for
(
Map
.
Entry
<
String
,
ActorRef
>
item
:
superVisor
.
getKnownNeighbors
().
entrySet
())
{
Vector
data
=
snapshot
.
getAmountTableModel
().
getDataVector
();
Future
<
Object
>
futureNeighbour
=
Patterns
.
ask
(
item
.
getValue
(),
new
ActionWalletGetSnapshot
(
time
),
timeout
);
/*AbstractNode node = new AbstractNode() {
ActionWalletGetSnapshotAnswer
snapshot
=
(
ActionWalletGetSnapshotAnswer
)
@Override
public void onReceive(Object message) {
}
};*/
for
(
Object
aData
:
data
)
{
String
name
=
(
String
)
((
ArrayList
<
Object
>)
aData
).
get
(
1
);
ActorRef
ref
=
superVisor
.
getKnownNeighbors
().
get
(
name
);
Future
<
Object
>
futureNeighbour
=
Patterns
.
ask
(
ref
,
new
ActionWalletGetSnapshot
(
time
),
timeout
);
ActionWalletGetSnapshotAnswer
snapshotAnswer
=
(
ActionWalletGetSnapshotAnswer
)
Await
.
result
(
futureNeighbour
,
timeout
.
duration
());
Await
.
result
(
futureNeighbour
,
timeout
.
duration
());
addSnapshot
(
snapshot
.
getSnapshot
());
addSnapshot
(
snapshotAnswer
.
getSnapshot
());
//addSnapshot(new Gson().fromJson(node.readSnapshot(name, time), Snapshot.class) );
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment