Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
qishipengqsp committed Sep 19, 2024
1 parent a08d427 commit 0a554c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import ldbc.finbench.datagen.generation.DatagenParams;
import ldbc.finbench.datagen.util.RandomGeneratorFarm;

public class LoanSubEvents implements Serializable {
public class LoanActivitiesEvents implements Serializable {
private final RandomGeneratorFarm randomFarm;
private final Random indexRandom;
private final Random actionRandom;
Expand All @@ -29,7 +29,7 @@ public class LoanSubEvents implements Serializable {
private final Map<String, AtomicLong> multiplicityMap;
private List<Account> targetAccounts;

public LoanSubEvents() {
public LoanActivitiesEvents() {
multiplicityMap = new ConcurrentHashMap<>();
randomFarm = new RandomGeneratorFarm();
indexRandom = new Random(DatagenParams.defaultSeed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,16 @@ class ActivityGenerator()(implicit spark: SparkSession)
.toList
)

val loanSubEvents = new LoanSubEvents
val afterLoanActions = loanRDD
.mapPartitionsWithIndex((index, loans) => {
loanSubEvents
.afterLoanApplied(
loans.toList.asJava,
sampledAccounts.value.asJava,
index
)
.iterator()
.asScala
})
afterLoanActions
loanRDD.mapPartitionsWithIndex((index, loans) => {
val loanSubEvents = new LoanActivitiesEvents
loanSubEvents
.afterLoanApplied(
loans.toList.asJava,
sampledAccounts.value.asJava,
index
)
.iterator()
.asScala
})
}
}

0 comments on commit 0a554c0

Please sign in to comment.