src/main/java/toy/das/bbc/BbcService.java
/**
     * Delivers the consensus with (cid, cidSeries) result.
     * @param channel the channel that wish to decide
     * @param cidSeries an identifier of the consensus series (series changes due to an invocation of the synchronization
     *                  mechanism)
     * @param cid an identifier of the consensus in the given cidSeries
     * @return the decision
     * @throws InterruptedException
     */
Delivers the consensus with (cid, cidSeries) result.
Delivers the consensus with ( cid cidSeries ) result .
public Types.BbcDecision decide(int channel, int cidSeries, int cid) throws InterruptedException {
            Types.Meta key = Types.Meta.newBuilder()
                    .setCidSeries(cidSeries)
                    .setCid(cid)
                    .setChannel(channel)
                    .build();
            consVote v = rec.get(key);
            while (v == null || v.neg + v.pos < quorumSize) {
                    channelNotifyer[channel].acquire();
                v = rec.get(key);
            }
            return Types.BbcDecision.newBuilder()
                    .setM(Types.Meta.newBuilder()
                            .setChannel(channel)
                            .setCidSeries(cidSeries)
                            .setCid(cid)
                            .build())
                    .setDecosion(v.pos > v.neg ? 1: 0)
                    .build();
    }
public Types . BbcDecision decide ( int channel , int cidSeries , int cid ) throws InterruptedException { Types . Meta key = Types . Meta . newBuilder ( ) . setCidSeries ( cidSeries ) . setCid ( cid ) . setChannel ( channel ) . build ( ) ; consVote v = rec . get ( key ) ; while ( v == null || v . neg + v . pos < quorumSize ) { channelNotifyer [ channel ] . acquire ( ) ; v = rec . get ( key ) ; } return Types . BbcDecision . newBuilder ( ) . setM ( Types . Meta . newBuilder ( ) . setChannel ( channel ) . setCidSeries ( cidSeries ) . setCid ( cid ) . build ( ) ) . setDecosion ( v . pos > v . neg ? 1 : 0 ) . build ( ) ; }
Delivers the consensus with (cid, cidSeries) result.
Delivers the consensus with ( cid cidSeries ) result .