Skip to content

Commit

Permalink
arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed May 22, 2024
1 parent 9cee1f7 commit ce84f28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.salesforce.apollo.choam;

import com.chiralbehaviors.tron.Fsm;
import com.google.common.base.Function;
import com.google.protobuf.ByteString;
import com.google.protobuf.Empty;
import com.google.protobuf.InvalidProtocolBufferException;
Expand Down Expand Up @@ -56,6 +55,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -109,10 +109,9 @@ public CHOAM(Parameters params) {

rotateViewKeys();
var bContext = new DelegatedContext<>(params.context());
var adapter = new MessageAdapter(_ -> true, (Function<ByteString, Digest>) this::signatureHash,
(Function<ByteString, List<Digest>>) _ -> Collections.emptyList(),
(_, any) -> any,
(Function<AgedMessageOrBuilder, ByteString>) AgedMessageOrBuilder::getContent);
var adapter = new MessageAdapter(_ -> true, this::signatureHash,
_ -> Collections.emptyList(),
(_, any) -> any, AgedMessageOrBuilder::getContent);

combine = new ReliableBroadcaster(bContext, params.member(), params.combine(), params.communications(),
params.metrics() == null ? null : params.metrics().getCombineMetrics(),
Expand Down Expand Up @@ -234,7 +233,9 @@ public static Block reconfigure(Digest nextViewId, Map<Digest, Join> joins, Hash
}

public static Map<Digest, Member> rosterMap(Context<Member> baseContext, Collection<Digest> members) {
return members.stream().collect(Collectors.toMap(m -> m, baseContext::getMember));
return members.stream()
.map(baseContext::getMember)
.collect(Collectors.toMap(Member::getId, Function.identity()));
}

public static List<Transaction> toGenesisData(List<? extends Message> initializationData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.salesforce.apollo.choam;

import com.codahale.metrics.Timer;
import com.google.common.base.Function;
import com.google.protobuf.Message;
import com.netflix.concurrency.limits.Limiter;
import com.netflix.concurrency.limits.internal.EmptyMetricRegistry;
Expand All @@ -33,6 +32,7 @@
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.function.Supplier;

/**
Expand Down

0 comments on commit ce84f28

Please sign in to comment.